RE: [PHP-ES] freetype y gd2

From: Date: Sun, 11 May 2003 21:03:35 +0000
Subject: RE: [PHP-ES] freetype y gd2
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-36113@lists.php.net to get a copy of this message
Hola, me meto en el thread porque tengo el mismo problema he probado el codigo tanto con "arial.ttf" como con "Arial.ttf" y mil variantes mas... pero siempre obtengo el maldito: Warning: imagettftext() [function.imagettftext]: Could not find/open font in c:\mis documentos\projects\test\ttf\test.php on line 7 con el codigo: <?php header("Content-type: image/png"); $im = imagecreate(200,200); $blanco = ImageColorAllocate($im, 255,255,255); $negro = ImageColorAllocate($im, 0,0,0); $azul = ImageColorAllocate($im, 0,0,255); ImageTTFText($im, 20, 0, 10, 20, $azul, "arial.ttf", "texto"); imagepng($im); imagedestroy($im); ?> Tengo php 4.3.1 y apache 1.3.27 bajo win98 Desde ya, si alguien logra o logro hacer funcionar ImageTTFText bajo GD2+ en plataformas win, seria interesante que lo postee. Bye! -- ...ThE PhP_KiD. -> -----Mensaje original----- -> De: Gerardo Morales [mailto:gerardo@laplaza.com.mx] -> Enviado el: Lunes, 12 de Mayo de 2003 01:36 p.m. -> Para: lista@phpes.com -> Asunto: Re: [PHP-ES] freetype y gd2 -> -> -> Hola -> -> Tengo el ttf completamente en mayusculas es decir ARIAL.TTF -> -> voy a intentar colocar la carpeta con los archivos web en otro -> directorio -> directamente desde raiz o C: y ver commo me funciona. -> -> Gracias -> -> Kid. si encuentro alguna otra solucion la hare llegar al grupo -> -> -> -> -> On Mon, 12 May 2003 13:54:11 +0200, Antonio Garcia Marin -> <proyectoantonio@lycos.es> wrote: -> -> > Buenas, -> > He probado tu codigo y funciona bien. -> > Tengo igual q tu php 4.3.0 y apache (win32) 1.3.27 configurado con -> > la libreria gd2. -> > La unica diferencia contigo es q no uso el directorio htdocs sino otro -> > q tiene una ruta con directorios q no tengan espacios(me han dado -> > problemas -> > en el pasado con otros programas). -> > Otra cosa : la fichero de la fuentes se llama arial.ttf o Arial.ttf ? -> > Aqui si es importante las minusculas y/o mayusculas. -> > -> > -> > ----- Original Message ----- -> > From: "Gerardo Morales" <gerardo@laplaza.com.mx> -> > To: <lista@phpes.com> -> > Sent: Friday, May 09, 2003 8:47 PM -> > Subject: [PHP-ES] freetype y gd2 -> > -> > -> >> Actualmente estoy utilizando la Version 4.3.1 (en apache, -> win32) la cual -> > ya -> >> tiene integrado y activado gd2, he estado realizando algunas pruebas -> >> para -> >> insertar texto en un grafico y no me lo permite. cuando -> intento generar -> >> algun grafico me aparece el sig warning -> >> Warning: imagettftext() [function.imagettftext]: Could not find/open -> >> font -> >> in c:\apache 1.3\apache\htdocs\menu.php on line 7 -> >> -> >> el cual tiene el siguiente codigo -> >> -> >> <?php -> >> header("Content-type: image/png"); -> >> $im = imagecreate(200,200); -> >> $blanco = ImageColorAllocate($im, 255,255,255); -> >> $negro = ImageColorAllocate($im, 0,0,0); -> >> $azul = ImageColorAllocate($im, 0,0,255); -> >> ImageTTFText($im, 20, 0, 10, 20, $azul, "arial.ttf", "texto"); -> >> imagepng($im); -> >> imagedestroy($im); -> >> ?> -> >> -> >> Dentro de php.ini esta habilitado gd2 -> >> -> >> Al usar phpinfo me despliega -> >> -> >> gd -> >> GD Support enabled GD Version bundled (2.0 compatible) FreeType -> > Support -> >> enabled FreeType Linkage with freetype JPG Support enabled PNG -> >> Support enabled WBMP Support enabled -> >> -> >> Ya he intentado poniendol rutas absolutas, relativas, usar -> dirname etc y -> > me -> >> sigue marcando el mismo mensaje de error. El archivo -> arial.ttf esta en -> >> el -> >> mismo directorio que el archivo menu -> >> -> >> No se si sea necesario que actualice la version de GD que tiene esta -> >> version de php, instalarle otra version de freetype o cual -> puede ser el -> >> problema con esto -> >> -> >> Saludos -> >> -> >> --------------------------------------------------------------------- -> >> Archivo On-line: http://www.phpes.com/ -> >> via news: news://news.phpes.com/ -> >> Manual PHP en español: http://www.php.net/manual/es/ -> >> Para dar de baja la suscripción, mande un mensaje a: -> >> lista-unsubscribe@phpes.com -> >> -> >> -> >> -> > -> > -> > --------------------------------------------------------------------- -> > Archivo On-line: http://www.phpes.com/ -> > via news: news://news.phpes.com/ -> > Manual PHP en español: http://www.php.net/manual/es/ -> > Para dar de baja la suscripción, mande un mensaje a: -> > lista-unsubscribe@phpes.com -> > -> > -> > -> -> -> -> -> --------------------------------------------------------------------- -> Archivo On-line: http://www.phpes.com/ -> via news: news://news.phpes.com/ -> Manual PHP en español: http://www.php.net/manual/es/ -> Para dar de baja la suscripción, mande un mensaje a: -> lista-unsubscribe@phpes.com

« previous php.general.es (#36113) next »