FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Usage of named entities (HTML) in imagettftext
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Usage of named entities (HTML) in imagettftext [message #177900 is a reply to message #177896] Thu, 26 April 2012 07:50 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 25/04/2012 22:49, M. Strobel escribió/wrote:
> To make the thread complete, here a minimal test program: (adjust the path to your
> ttf font)
>
> <?php
> Header ("Content-type: image/gif");
> $im = imagecreate (400, 30);
> $black = ImageColorAllocate ($im, 0, 0, 0);
> $white = ImageColorAllocate ($im, 255, 255, 255);
> ImageTTFText ($im, 20, 0, 10, 20, $white,
> "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf",
> "&laquo;Test&raquo;&copy; /Str. Omega:&#937;");
> ImageGif ($im);
> ImageDestroy ($im);

It works as advertised here (PHP/5.3.10 on Windows): only numeric
entities get parsed. Which is crazy enough: I don't even know by heart
what PHP function can be used to escape HTML entities (using numeric
notation) but not HTML tags.

I've had lots of similar problems working with text and image*
functions, such as non-ASCII characters completely breaking in one minor
update and getting fixed in the next one, or text align algorithm
getting replaced by a worse one without prior notice. I guess that's the
way life is.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What happens when i dont use the semicolon for closing my statement
Next Topic: Data injection problems
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 14:27:17 GMT 2024

Total time taken to generate the page: 0.03718 seconds