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 #177895 is a reply to message #177877] Wed, 25 April 2012 17:17 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 25.04.2012 11:18, schrieb Erwin Moller:
> 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.
> ======================================================================

I can tell you that the german help does not talk about named entities, it just says

Text ist der auszugebende String, der auch UTF-8-Zeichenfolgen enthalten darf (z.B.
{)

(can have utf-8 sequences like {)

Wrong is also the french and the spanish help. :-)

/Str.
[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 13:47:59 GMT 2024

Total time taken to generate the page: 0.03877 seconds