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 #177885 is a reply to message #177877] Wed, 25 April 2012 12:06 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 4/25/2012 5:18 AM, Erwin Moller wrote:
> Hello,
>
> I just found something strange in the documentation (or my understanding
> of it).
> During some modification I am making to an older project I found I was
> using named entities (like ©) during true type font rendering.
> And that shouldn't work, according to the documentation, but it does
> work just fine.
>
> The function imagettftext(...) will write a text on an image-resource
> using a True Type font.
>
> Here follows a code snippet:
> $inImgText = " ∅ 50 mm)";
> imagettftext($myImg, $size, 0, $x, $y, $black, $font,$inImgText);
>
> (I left not related code out.)
>
> The result is the text: ∅ 50 mm appearing on the image, as intended.
> (In case the characters didn't survive it to your newsreader, that is
> DIAMETER symbol, followed by 50 mm)
>
> But according to the documentation it shouldn't.
> It clearly states "Named entities, such as ©, are not supported.".
> (Relevant part copied hereunder)
>
> What am I missing here?
> Or is the documentation wrong and ARE named entities supported?
>
> (I am using PHP 5.2.0 on this system)
>
> Thanks for your time.
>
> Regards,
> Erwin Moller
>
>
> [source]
> http://nl3.php.net/manual/en/function.imagettftext.php
> ======================================================================
> TEXT
> The text string in UTF-8 encoding.
>
> May include decimal numeric character references (of the form: €)
> to access characters in a font beyond position 127. The hexadecimal
> format (like ©) is supported. Strings in UTF-8 encoding can be
> passed directly.
>
> Named entities, such as ©, are not supported. Consider using
> html_entity_decode() to decode these named entities into UTF-8 strings
> (html_entity_decode() supports this as of PHP 5.0.0).
>
> If a character is used in the string which is not supported by the font,
> a hollow rectangle will replace the character.
> ======================================================================
>
>

This has nothing to do with PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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:23:11 GMT 2024

Total time taken to generate the page: 0.03735 seconds