What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » TrueType Fonts in PHP

Pages: (2): « First [ 1 ] 2 » Last »
TrueType Fonts in PHP
Author: Message:
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
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
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
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
Profile E-Mail PM Web Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
O.P. RE: TrueType Fonts in PHP
--with-freetype-dir=/usr/include/freetype2 :S

What am I doing wrong?? ^o)

You saw how the script looked like, didn't you?

* KeyStorm is sure it's a stupid-programmer-error :dodgy:

btw: you don't need to be so explicit ('do a phpinfo' would've been enough ;))
02-12-2004 07:34 PM
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
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
Profile E-Mail PM Web Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
O.P. RE: TrueType Fonts in PHP
no, I just showed you the interesting part :P (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 :P

(i'm trying it in html)
02-12-2004 07:44 PM
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
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
Profile E-Mail PM Web Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
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: &amp;#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
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: TrueType Fonts in PHP
ah (I)

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
Profile E-Mail PM Web Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
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
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
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
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On