Bug #34670 [Opn]: imagettftext() doesn't combine combining chars

From: Date: Mon, 03 May 2021 11:28:51 +0000
Subject: Bug #34670 [Opn]: imagettftext() doesn't combine combining chars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233644@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=34670&edit=1

 ID:                 34670
 Updated by:         cmb@php.net
 Reported by:        klaus at glashoff dot net
-Summary:            imageTTFText for Indian scripts (Devanagari)
+Summary:            imagettftext() doesn't combine combining chars
 Status:             Open
 Type:               Bug
 Package:            GD related
 Operating System:   Windows XP
-PHP Version:        5.*, 6
+PHP Version:        7.4
 Block user comment: N
 Private report:     N

 New Comment:

I created a gist which clearly shows the misbehavior[1].  I'm
pretty sure this is actually an upstream issue, so should be
reported there[2].

[1] <https://gist.github.com/cmb69/0355b94c13631b7b1a64df21388039d5>
[2] <https://github.com/libgd/libgd/issues>


Previous Comments:
------------------------------------------------------------------------
[2019-09-19 04:02:33] kalpit dot jain at wagmob dot com

we are running into this bug when writing
क्षत्रिय on an image using imagettftext
imagettftext can not write क्ष

------------------------------------------------------------------------
[2015-08-08 20:53:30] jay dot scv at gmail dot com

I think, you got it. Problem is with most Indic and Arabic languages.

Please note that most of these fonts carry GPOS and GSUB tables. Font tables also have information
related to substitution of glyph combinations with a different glyph.

Refer: http://fontforge.github.io/gposgsub.html

------------------------------------------------------------------------
[2015-08-08 11:38:43] cmb@php.net

Thanks, now I got it. The problem isn't particularly related to
Bengali, but rather to combining characters in general, which are
not supported by imagettftext().

------------------------------------------------------------------------
[2015-08-08 05:01:48] jay dot scv at gmail dot com

A direct browser based text to image:

http://utils.net/caption/fidd-utf8:hi_in/fid-r/cn-1/fidd-utf8:hi_in/t-AnyHindiUnicodeStringHere

On every reload, it will use a random hindi unicode capable code.

For any other language change utf8:hi_in to
utf8:<2letter_language_code>_<2_letter_country_code>

------------------------------------------------------------------------
[2015-08-08 04:37:53] jay dot scv at gmail dot com

Please refer http://unicode.org/faq/indic.html#17

This will provide you enough information on how 'virama' combinations should be rendered. 

I could provide any supporting information you may need.

------------------------------------------------------------------------


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

    https://bugs.php.net/bug.php?id=34670


--
Edit this bug report at https://bugs.php.net/bug.php?id=34670&edit=1


Thread (22 messages)

« previous php.bugs (#233644) next »