#26901 [Bgs]: Imagettftext(). Some chars prints as square even though they exist in .ttf file
| From: | moriyoshi@php.net | Date: | Thu, 22 Jan 2004 23:12:54 +0000 |
| Subject: | #26901 [Bgs]: Imagettftext(). Some chars prints as square even though they exist in .ttf file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53776@lists.php.net to get a copy of this message | ||
ID: 26901
Updated by: moriyoshi@php.net
Reported By: jpg at pmers dot net
Status: Bogus
Bug Type: GD related
Operating System: Linux
PHP Version: 4.3.4
New Comment:
And this might be helpful too:
http://www.voltex.jp/articles/imagettf_m10n.htm
Previous Comments:
------------------------------------------------------------------------
[2004-01-16 10:20:03] moriyoshi@php.net
Some notes about using non-ASCII characters with GD
extension:
1. Don't enable --enable-gd-jis-conv if you don't really
understand what you are doing. The option is only
meaningful when it comes to handling Japanese texts.
Please refer to the relevant documentation included in
the GD library distribiton.
2. The FreeType2 library which is used by GD to render a
bitmap with a given TTF file always assumes the input
string to be encoded in UTF-8. This means passing
strings of another encoding (character set) doesn't make
any sense and it will most likely end up with a bunch of
square placeholders. Thus you have to encode strings by
UTF-8 before passing it to ImageTTFText().
3. Make sure that you are using a correct TTF file whose
glyphs are correctly mapped to the character set by
which the string you want to rasterlize is represented.
If it doesn't match, rendering will silently fail.
4. utf8_encode() can only handle the ISO-8859-1
character set, where the character set that is most
commonly used in Czech texts is ISO-8859-2. Use
mb_convert_encoding() or iconv() instead.
------------------------------------------------------------------------
[2004-01-16 09:12:35] sniper@php.net
Provide the script downloadadble somewhere.
------------------------------------------------------------------------
[2004-01-15 06:37:06] jpg at pmers dot net
I'm not sure if I understand what you mean, I have added the following
code:
setlocale(LC_ALL, 'cs_CZ');
Doesn't make any difference.
------------------------------------------------------------------------
[2004-01-14 19:48:10] iliaa@php.net
Have you tried exporting Czech locale before creating the
image?
------------------------------------------------------------------------
[2004-01-14 11:08:45] jpg at pmers dot net
example output: http://ccres.net/char_test.php
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26901
--
Edit this bug report at http://bugs.php.net/?id=26901&edit=1