Add font for imagestring?
#1
Posted 25 July 2007 - 09:15 PM
#2 _*Creative Insanity_*
Posted 25 July 2007 - 09:17 PM
#3
Posted 25 July 2007 - 11:30 PM
If that's the case, check the manual.
http://php.net/manua...imagefttext.php
#4
Posted 25 July 2007 - 11:35 PM
Wrong, WRONG! =/You can't. Only default fonts are used by a browser. It also depends what the viewer has installed and 99% of the time they have not got the one you are using. If you want to use a special font for some reason use it as an image.
You can install fonts onto your server if you have root access to do so. Otherwise, you can upload them if they are on your computer and point it to the absolute font path.
For instance:
/home/jamie/public_html/fonts/Arial.ttf
Or what ever the font format is.
#5
Posted 26 July 2007 - 06:30 AM
Like I said, not fully sure.
Matt
#6
Posted 26 July 2007 - 07:17 AM
if you really need the font, use flash text replacement sifr thingy works a treat
#7
Posted 26 July 2007 - 03:26 PM
Not 100% confirmed on this. But i remember a while back trying to use some fancy font i found on a site i was doing. It worked for me while viewing, but for others it just restored back to default. So maybe if the font is on the users machine, it may be used.
Like I said, not fully sure.
Matt
yer ur right, if its on users system it will work, otherwise default to a system font, hence why you have font family's in CSS
if you really need the font, use flash text replacement sifr thingy works a treat
Guys, he is talking about using custom font with his GD library in PHP. I don't know where you guys got CSS From all this.
#8
Posted 26 July 2007 - 04:21 PM
#9
Posted 26 July 2007 - 04:27 PM
letters, numbers & special chars you plan on using.
then just have php call those images depending on what the user input is?
#10
Posted 26 July 2007 - 05:06 PM
Just follow the link Matt gave and all you need is right there.
#11
Posted 26 July 2007 - 10:55 PM
I believe he is talking PHP, not CSS.
If that's the case, check the manual.
http://php.net/manua...imagefttext.php
Seriously though, this isn't a complicated matter. It takes 2 steps
1. Upload the font file. I don't care where you put it just put it some where and know where some where is.
2. Use the function i told you about in the 3rd post. Read the manual for EXACT info on how to use it.
If for some reason you don't like/want to use the method i provided, heres a couple more straight out of the PHP MANUAL.
http://php.net/manua...ageloadfont.php
http://php.net/manua...magettfbbox.php
Edited by rc69, 26 July 2007 - 10:56 PM.
#12
Posted 27 July 2007 - 01:22 AM
Demonslay, you're slipping. Matt hasn't posted any links
I believe he is talking PHP, not CSS.
If that's the case, check the manual.
http://php.net/manua...imagefttext.php
Seriously though, this isn't a complicated matter. It takes 2 steps
1. Upload the font file. I don't care where you put it just put it some where and know where some where is.
2. Use the function i told you about in the 3rd post. Read the manual for EXACT info on how to use it.
If for some reason you don't like/want to use the method i provided, heres a couple more straight out of the PHP MANUAL.
http://php.net/manua...ageloadfont.php
http://php.net/manua...magettfbbox.php
Thankyou for the links, Now is there a function to get all the fonts on the server?
My php doesn't support imagettftext.
"Call to undefined function: imagettftext()"
imageloadfont wont work because my fonts are .ttf
Edited by high6, 27 July 2007 - 02:54 AM.
#13
Posted 27 July 2007 - 07:32 AM
Just contact your host and tell them to install the GD library.
#14
Posted 27 July 2007 - 11:46 AM
*sigh*
Just contact your host and tell them to install the GD library.
It is installed... The newest version too.
#15
Posted 27 July 2007 - 12:31 PM
Nothing specifically for that reason, no. But through the use of something like glob() i'm sure you can come up with something.Thankyou for the links, Now is there a function to get all the fonts on the server?
My php doesn't support imagettftext.
"Call to undefined function: imagettftext()"
imageloadfont wont work because my fonts are .ttf
As for the .ttf problem, have you tried read the user comments? Often times those are more useful than the manual itself.
http://www.php.net/m...dfont.php#72223
*sigh**sigh*
Just contact your host and tell them to install the GD library.
Note: This function requires GD 2.0.1 or later (2.0.28 or later is recommended).
Note: This function is only available if PHP is compiled with freetype support (--with-freetype-dir=DIR)
Edited by rc69, 27 July 2007 - 12:32 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users