Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #5721

Re: Usage of named entities (HTML) in imagettftext

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: Usage of named entities (HTML) in imagettftext
Date 2012-04-25 08:06 -0400
Organization A noiseless patient Spider
Message-ID <jn8pc5$99n$1@dont-email.me> (permalink)
References <4f97c160$0$6919$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


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 &copy;) 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 = " &empty; 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 &copy;, 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: &#8364;)
> to access characters in a font beyond position 127. The hexadecimal
> format (like &#xA9;) is supported. Strings in UTF-8 encoding can be
> passed directly.
>
> Named entities, such as &copy;, 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@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Usage of named entities (HTML) in imagettftext Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-04-25 11:18 +0200
  Re: Usage of named entities (HTML) in imagettftext Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-25 08:06 -0400
    Re: Usage of named entities (HTML) in imagettftext Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-04-25 15:34 +0200
      Re: Usage of named entities (HTML) in imagettftext Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-25 09:41 -0400
      Re: Usage of named entities (HTML) in imagettftext Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-25 13:11 -0400
  Re: Usage of named entities (HTML) in imagettftext "Peter H. Coffin" <hellsop@ninehells.com> - 2012-04-25 07:21 -0500
    Re: Usage of named entities (HTML) in imagettftext Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-04-25 14:57 +0200
  Re: Usage of named entities (HTML) in imagettftext "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-25 19:17 +0200
  Re: Usage of named entities (HTML) in imagettftext "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-25 22:49 +0200
    Re: Usage of named entities (HTML) in imagettftext "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-04-26 09:50 +0200

csiph-web