[php] ttf niet?

Pagina: 1
Acties:

  • _-= Erikje =-_
  • Registratie: Maart 2000
  • Laatst online: 09-09 15:42
Ik heb het volgende script van webmonkey af geripped om me gd te testen
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?
//Send a header to the browser indicating 
//that this is a PNG image.
//Remember to never send anything 
//to the browser before the header,
//unless you're just itching for an error.

header("Content-type: image/png");

//create a new image called $image, 200 by 200 pixels

$width = 200;

$height = 200;

$image = imagecreate($width, $height);

//Allocate some colors.

$white = imagecolorallocate($image, 255, 255, 255);

$black = imagecolorallocate($image, 0, 0, 0);

//Fill in the entire image with a white background.
//Note that the first two arguments (after the 
//image name) are the X and Y coordinates of 
//the upper left corner of the rectangle,
//the second two are the coordinates of the lower
//right corner, and the last argument is the fill color

imagefilledrectangle($image, 10, 10, 180, 180, $black);

//Write a message in black.
//The arguments to ImageTTFText are, in order, 
//the image name, the height in pixels of the text, 
//the angle (starting at 0 for normal text,
//and proceeding counterclockwise, 
//the X and Y coordinates of the starting point, 
//the color, the TrueType font file, and the
//content of the text.

imagettftext($image, 150, 0, 20, 110, $white, "verdana.ttf", "I love you!");

//Push the completed image out.

imagepng($image);

//Finally, free up the memory allocated for the image.

imagedestroy($image);

?> 
?>

zo krijg ik netjes een Afbeeldingslocatie: http://www.nix.ocm/blaat.png als ik
PHP:
1
2
3
<?
imagettftext($image, 150, 0, 20, 110, $white, "verdana.ttf", "I love you!");
?>

eruit haal dan werkt ie wel (netjes een zwart/wit vierkant) verdana.ttf staat in de zelfde dir als het php scrippie..

wie weet wat er mis gaat..

  • vinnux
  • Registratie: Maart 2001
  • Niet online
Zoals bekend is GD zelf weer van een aantal andere programma's afhankelijk o.a. JPEG.
Voor de ondersteunign van TrueType fonts is er ook een programma. heb je die meegecompileer din gd ?

Of doe je alles onder windows ?

  • _-= Erikje =-_
  • Registratie: Maart 2000
  • Laatst online: 09-09 15:42
't is een linuxdoos, freetype 2 is geinstalleerd en gd is gecompileerd met freetype 2 en php is gecompiled met
code:
1
2
3
4
5
6
7
8
9
10
11
'./configure' 
'--sysconfdir=/etc' 
'--with-apxs=/usr/local/apache/bin/apxs' 
'--enable-calendar' 
'--enable-ftp' 
'--with-gd' 
'--with-freetype-dir=/usr/local/lib' 
'--enable-gd-native-ttf' 
'--with-jpeg-dir=/usr/lib' 
'--with-png-dir=/usr/lib' 
'--with-zlib-dir=/usr/lib'

zlib, libjpeg en libpng zijn ook geinstalleerd...

  • Aceton
  • Registratie: Februari 2001
  • Laatst online: 28-11-2021
Op vrijdag 28 december 2001 20:39 schreef _-= Erikje =-_ het volgende:
Ik heb het volgende script van webmonkey af geripped om me gd te testen
PHP:
1
2
3
4
5
6
<?
header("Content-type: image/png");
// ......

imagettftext($image, 150, 0, 20, 110, $white, "verdana.ttf", "I love you!");
?>

wie weet wat er mis gaat..
Misschien moet je even die "Content-type" veranderen in text/plain (of text/html) en dan nog een keer draaien. Je krijgt dan de error gewoon in plaintext te zien, en dan weet je weer iets meer.

  • _-= Erikje =-_
  • Registratie: Maart 2000
  • Laatst online: 09-09 15:42
ff proberen

  • _-= Erikje =-_
  • Registratie: Maart 2000
  • Laatst online: 09-09 15:42
weer wat dichterbij de oplossing:)

libgd was not built with FreeType font

lekker wasig want die staat wel in de makefile geloof ik :(
Pagina: 1