downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

imagepsslantfont> <imagepsfreefont
[edit] Last updated: Fri, 24 May 2013

view this page in

imagepsloadfont

(PHP 4, PHP 5)

imagepsloadfontCargar una fuente PostScript Type 1 desde un archivo

Descripción

resource imagepsloadfont ( string $filename )

Carga una fuente PostScript Type 1 desde el archivo filename.

Parámetros

filename

Ruta al archivo de fuente Postscript.

Valores devueltos

En el caso de que todo haya ido bien, un índice de fuente válido será devuelto y se podrá usar para más propósitos. De otra manera, la función devuelve FALSE.

Ejemplos

Ejemplo #1 Ejemplo de imagepsloadfont()

<?php
// Crear una nueva instancia de imagen
$im imagecreatetruecolor(35045);

// Asignar colores y rellenar el fondo
$negro imagecolorallocate($im000);
$blanco imagecolorallocate($im255255255);
imagefilledrectangle($im0034944$blanco);

// Cargar una fuente, escribir en la imagen y liberar la fuente de la memoria
$fuente imagepsloadfont("bchbi.pfb");
imagepstext($im"Probando... ¡Funcionó!"$fuente32$blanco$negro3232);
imagepsfreefont($fuente);

// Imprimir la fuente
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>

Notas

Nota: Esta función sólo está disponible si PHP fue compilado usando --with-t1lib[=DIR] .

Ver también



add a note add a note User Contributed Notes imagepsloadfont - [1 notes]
up
-1
seymour at itsyourdomain dot com
9 years ago
I had to use a full path to the font file or else I received errors from t1lib. Using just a filename, I received error 14. Using ./filename I received error 2.

 
show source | credits | sitemap | contact | advertising | mirror sites