imageloadfont – PHP

  php

Q(Question):

Hi!

Does enybody know how to make file
with verdana 10 font for imageloadfont() function?

I found few working fonts on:
http://www.30mb.com/x/dryes/fonts/fonts.html

ozi

A(Answer):

ozi <oz*@post.pl> wrote:

Hi!
Does enybody know how to make file
with verdana 10 font for imageloadfont() function?

I assume you mean a TrueType font called verdana?

imageloadfont() is for bitmap fonts; you want likely want to use
imagettftext():

http://www.php.net/manual/en/function.imagettftext.php


niall

A(Answer):

> I assume you mean a TrueType font called verdana?

Yes 🙂

imageloadfont() is for bitmap fonts;

And i want to create verdana 10 bitmap font or convert
verdana from ttf to bitmap to use it with
imagestringup() function.
I need to write vertical text.
you want likely want to use
imagettftext():

http://www.php.net/manual/en/function.imagettftext.php

imagettftext() example:
http://217.153.145.170/~ozi/image/vertical_text.php
Can You see the difference?

ozi

A(Answer):

"ozi" <oz*@post.pl> wrote in message news:<c8**********@atlantis.news.tpi.pl>…
<snip>

imagettftext() example:
http://217.153.145.170/~ozi/image/vertical_text.php
Can You see the difference?

Do you mean this (user note)? <http://in.php.net/imagettftext#27685>


| Just another PHP saint |
Email: rrjanbiah-at-Y!com

A(Answer):

ozi <oz*@post.pl> wrote:

I assume you mean a TrueType font called verdana?

Yes 🙂
imageloadfont() is for bitmap fonts;
And i want to create verdana 10 bitmap font or convert
verdana from ttf to bitmap to use it with
imagestringup() function.

Converting a font is not possible in PHP, and so offtopic.
I need to write vertical text.

Use the "angle" parameter for imagettftext() to specify what direction
to write the text.
you want likely want to use
imagettftext():

http://www.php.net/manual/en/function.imagettftext.php

imagettftext() example:
http://217.153.145.170/~ozi/image/vertical_text.php
Can You see the difference?

I only see an error message. ;( Could you post your code?


niall

A(Answer):

> Converting a font is not possible in PHP, and so offtopic.

I don’t want to convert font in PHP.
I wanto to create this font under linux or windows to use if with
imageloadfont().
I just can’t find the tool to do this 🙁

I need to write vertical text.

Use the "angle" parameter for imagettftext() to specify what direction
to write the text.

I know that 🙂
I only see an error message. ;( Could you post your code?

Hmmmm, it works on my computer.

header("content-type:image/png");
$Image=ImageCreate(400,30);
$black=ImageColorAllocate($Image,0,0,0);
$white=ImageColorAllocate($Image,255,255,255);
imagefill($Image, 0, 0, $white);
ImageTTFText($Image, 10, 0, 10, 20, $black,
"/home/ozi/public_html/image/verdana.ttf","This is verdana 10");
ImagePNG($Image, "/home/ozi/public_html/image/im.png");
ImageDestroy($Image);
echo ‘<img src="im.png" border="0"><br />’;
echo ‘This is verdana 10 from css file (body { font: normal 10px
Verdana; })!’;

Screenshot:
http://reglowa.ktr.pl/~ozi/image/example.html

ozi

A(Answer):

> Do you mean this (user note)? <http://in.php.net/imagettftext#27685>

Interesting but i changed my code to:
$r = (10/96)*72;
ImageTTFText($Image, $r, 0, 10, 20, $black,
"/home/ozi/public_html/image/verdana.ttf","This is verdana 10");
and still the difference is big.
http://reglowa.ktr.pl/~ozi/image/vertical_text.php

ozi

LEAVE A COMMENT