freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] Re: [PHP] Does function ImageTTFText work with php 4.1.2 and


From: Tom Rogers
Subject: [Freetype] Re: [PHP] Does function ImageTTFText work with php 4.1.2 and freetype 2.0.5?
Date: Tue, 05 Mar 2002 10:33:09 +1000

Hi
The following worked for me with gd gd-2.0.1 php-4.1.2  freetype-2.0.5

<?php
Header("Content-type: image/jpeg");
$im = @imagecreate (400, 30);
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 10, 20, $white, "/usr/local/jdk1.3.1_01/jre/lib/fonts/LucidaBrightDemiBold.ttf", "Testing... Omega: &#937;");
ImageJPEG($im);
ImageDestroy ($im);
?>

(putting html in the jpeg output didn't work for me :)

for other people having trouble getting this to work here are the various settings that worked for me on linux:

gd-2.0.1 Makefile...
CFLAGS=-g -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_XPM
LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lXpm -lm
INCLUDEDIRS=-I. -I/usr/local/jpeg-6b -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/include

freetype-2.0.5 was built with:
make setup CFG="--prefix=/usr"

and php was configured with:
./configure \
--prefix=/usr \
--with-apache=/usr/src/apache_1.3.23 \
--enable-trans-sid \
--with-swf=/usr \
--with-vpopmail=/usr/local/apache \
--with-jpeg-dir=/usr/src/jpeg-6b \
--with-tiff-dir=/usr/src/tiff-v3.5.5 \
--with-png-dir=/usr/src/libpng-1.2.0 \
--with-zlib-dir=/usr/src/zlib \
--with-xpm-dir=/usr/X11R6 \
--with-pdflib \
--with-mysql=/usr/local/mysql \
--enable-static-pddflib \
--enable-ftp \
--with-gd=/usr \
--enable-gd-native-tt \
--enable-gd-imgstrttf \
--with-freetype-dir=/usr/include/freetype2 \
--with-mcrypt=/usr/src/mcrypt-2.5.10 \
--with-mhash=/usr/src/mhash-0.8.9 \
--with-pspell=/usr \
--enable-track-vars

Hope this helps
Tom




At 08:01 AM 5/03/2002, Ziying Sherwin wrote:

We installed php 4.1.2 with freetype 2.0.5 library support on our Solaris
2.8 machine using gcc 2.95.2. However, the php function ImageTTFText()
stopped to work properly with the new installation.

We used the following sample code from php web site for testing:

<?php

  Header("Content-type: image/jpeg");

  $im = @imagecreate (400, 30);
  $black = ImageColorAllocate ($im, 0, 0, 0);
  $white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 10, 20, $white, "/usr/openwin/lib/X11/fonts/TrueType/TimesNewRoman.ttf", "Testing... Omega: &#937;");

echo "<html> <title>TTF result</title><center> <body bgcolor=\"white\"></center><hr> ";
  echo "<P><IMG SRC=\"".ImageJPEG($im)."\"> ";

  ImageDestroy ($im);
?>

But there is no text generated in the image. When we tried to use cyberbit
fonts to generate a UTF-8 string, we kept getting the warning message and
no image file is generated.

The same code works with php 4.0.1 and freetype 1.3.1 library. So is it a
problem with php 4.1.1 and freetype 2 library? Is there anyone who successfully used php 4.1.2 with freetype 2 library?

I am not on the mailing list, please send emails to address@hidden

Thanks,
Ziying Sherwin




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




reply via email to

[Prev in Thread] Current Thread [Next in Thread]