Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 11, 2020 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7bc027c682fb78c46bf7eece14ea6c82 to your computer and use it in GitHub Desktop.
Save parzibyte/7bc027c682fb78c46bf7eece14ea6c82 to your computer and use it in GitHub Desktop.
<?php
$rutaFuente = __DIR__ . "/" . "sansita.ttf";
$nombreImagen = "imagen.png";
$imagen = imagecreatefrompng($nombreImagen);
$color = imagecolorallocate($imagen, 0, 0, 0);
$tamanio = 20;
$angulo = 0;
$x = 400;
$y = 50;
$texto = "parzibyte.me";
imagettftext($imagen, $tamanio, $angulo, $x, $y, $color, $rutaFuente, $texto);
header("Content-Type: image/png");
imagepng($imagen);
imagedestroy($imagen);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment