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. RE: TrueType Fonts in PHP
look at http://funmail.keystorm.net/MP!/test.php

The code is:
code:
<?php
  //header("Content-type: image/jpeg");
  $im = imagecreate(400, 30);
  $white = imagecolorallocate($im, 255, 255, 255);
  $black = imagecolorallocate($im, 0, 0, 0);

  // Replace path by your own font path
  imagettftext($im, 20, 0, 10, 20, $black, "./fonts/decotype.ttf",
  "Testing... Omega: &amp;#937;");
  imagejpeg($im, 'test.png');
  imagedestroy($im);
?>
<img src=test.png border=1>


(I tried /fonts/decotype.ttf aswell, as stated in the php doc-page you told me)
02-12-2004 08:47 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
I just noticed your config sets the fonts path as /usr/include/freetype2 - maybe try adding that before the path?  Font files relative to the file you're running should work just as well though
02-12-2004 08:55 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
quote:
Originally posted by KeyStorm
imagejpeg($im, 'test.png');
This doesn't show anything either...

quote:
Originally posted by fluffy_lobster
/usr/include/freetype2
It's unlikely that it works... I don't have privileges to the user-root.
I mean there, which are the fonts installed by default in there by freetype? (I think I read somewhere some fonts were included)
02-12-2004 09:02 PM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: TrueType Fonts in PHP
quote:
when fontfile does not begin with a leading '/', '.ttf' will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.
That tells me this:

For custom fonts relative to the current dir, have a '/' as the first character (get rid of that dot). Otherwise (if you want to use a default font), no slash.
02-12-2004 09:05 PM
Profile 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
I'm not sure, it might be somewhere on their website at http://www.freetype.org/

Hmm, try uploading my IP sig as a test, to see whether it's a problem on your server or with the font you're trying to use
02-12-2004 09: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
quote:
Originally posted by WDZ
For custom fonts relative to the current dir, have a '/' as the first character (get rid of that dot). Otherwise (if you want to use a default font), no slash.

quote:
Originally posted by KeyStorm
(I tried /fonts/decotype.ttf aswell, as stated in the php doc-page you told me)

quote:
Originally posted by KeyStorm
which are the fonts installed by default in there by freetype?

Thanks for your help, so far :)
02-12-2004 09:34 PM
Profile E-Mail PM Web Find Quote Report
bach_m
Veteran Member
*****

Avatar
4837 :P

Posts: 2863
Reputation: 7
37 / Male / –
Joined: Feb 2003
RE: TrueType Fonts in PHP
quote:
Originally posted by KeyStorm
(I tried /fonts/decotype.ttf aswell, as stated in the php doc-page you told me)

to make it relative to the current point, if ur server is running linux, use ~/path.

thats because of the filesystem linux uses, where the top directory is /, and everything is below thatt (its kinda complicated...)
02-12-2004 11: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