TrueType Fonts in PHP |
Author: |
Message: |
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
O.P. TrueType Fonts in PHP
I'm having problems with migrating my 'Now Playin'' to TrueType Font setting, but I'm having problems.
I used the methods explained in http://uk2.php.net/manual/en/function.imagettftext.php (thanks to fluffy_lobster) but they seemed pointless to my server (probably they don't have the needed libs).
Is there any workaround or another way to achieve it?
|
|
02-12-2004 06:46 PM |
|
|
fluffy_lobster
Veteran Member
Posts: -2
Posts: 1391 Reputation: 23
36 / /
Joined: Nov 2002
|
RE: TrueType Fonts in PHP
You might not have the ttf module installed on you server.
Make a php file just containing:
code: <?php phpinfo(); ?>
and run it, and report back the third box, called Configure Command, and it'll tell you if you have that or any alternatives installed.
|
|
02-12-2004 07:17 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
O.P. RE: TrueType Fonts in PHP
--with-freetype-dir=/usr/include/freetype2
What am I doing wrong??
You saw how the script looked like, didn't you?
* KeyStorm is sure it's a stupid-programmer-error
btw: you don't need to be so explicit ('do a phpinfo' would've been enough )
|
|
02-12-2004 07:34 PM |
|
|
fluffy_lobster
Veteran Member
Posts: -2
Posts: 1391 Reputation: 23
36 / /
Joined: Nov 2002
|
RE: TrueType Fonts in PHP
that's the entire config? that can't be right, there's not even gd there
what's the error you're getting?
|
|
02-12-2004 07:41 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
O.P. RE: TrueType Fonts in PHP
no, I just showed you the interesting part (of course there is GD, otherways you wouldn't see the image in my sig)
I'm not getting no error, because the image is created and destroyed after passing the function (ie, if there's an error it doesn't brake the execution)
As it's image/png i don't see the parser notices
(i'm trying it in html)
|
|
02-12-2004 07:44 PM |
|
|
fluffy_lobster
Veteran Member
Posts: -2
Posts: 1391 Reputation: 23
36 / /
Joined: Nov 2002
|
RE: TrueType Fonts in PHP
Well in that case, don't declare the image/php header until you get to outputting the actual image. Is there nothing about ttf then in your phpinfo?
|
|
02-12-2004 07:49 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
O.P. RE: TrueType Fonts in PHP
huh, sorry: 'with-ttf=/usr/' and ''--enable-gd-imgstrttf'' I almost miss them.
code: <?php
//header("Content-type: image/jpeg");
$im = imagecreate(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 20, 0, 10, 20, $black, "_sans", "Testing... Omega: &#937;");
//I tried many common font names in font
imagejpeg($im, 'test.png');
imagedestroy($im);
?>
<img src=test.png border=1>
I have uploaded those two fonts from my font folder (maybe crappy idea):
/fonts/tahoma.ttf (apparently ClearType)
/fonts/decotype.ttf (apparently TT)
|
|
02-12-2004 07:57 PM |
|
|
fluffy_lobster
Veteran Member
Posts: -2
Posts: 1391 Reputation: 23
36 / /
Joined: Nov 2002
|
RE: TrueType Fonts in PHP
ah
you have to upload a ttf font and refer to it. So the font has to be specified "./fonts/tahoma.ttf"
|
|
02-12-2004 08:09 PM |
|
|
KeyStorm
Elite Member
Inn-sewer-ants-pollie-sea
Posts: 2156 Reputation: 45
38 / / –
Joined: Jan 2003
|
O.P. RE: TrueType Fonts in PHP
I did that already try this before, pointless... (I tried again now, btw)
Can I know which fonts are included in the library?
|
|
02-12-2004 08:33 PM |
|
|
fluffy_lobster
Veteran Member
Posts: -2
Posts: 1391 Reputation: 23
36 / /
Joined: Nov 2002
|
RE: TrueType Fonts in PHP
Well that's how you do it... do what I said so that it shows what error it's returning, then that might explain what's wrong.
|
|
02-12-2004 08:37 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|