Harfbuzz-thai: Hide ZWJ and ZWNJ characters and show Inherited characters
authorJohn Tapsell <john.tapsell.ext@basyskom.com>
Wed, 8 Feb 2012 10:12:13 +0000 (10:12 +0000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 23 Feb 2012 14:07:58 +0000 (15:07 +0100)
commit785e95ef0a95ca8fb39ef57678cd4876ee657c43
tree6791a39301cd8823482f4a045ed0b53f2df2cc8c
parentcf2ca62dcd2494155b9c07d6a14df7c453226c1e
Harfbuzz-thai: Hide ZWJ and ZWNJ characters and show Inherited characters

Thai is not supposed to have ZWJ and ZWNJ characters or any other of the
Inherited Unicode Scripts
(http://www.verisigninc.com/assets/idn-inherited-unicode-script.pdf)
- they don't have a mapping to the thai encoding tis620 which libthai
requires.  However it is an unfortunate fact that there are many websites
etc that liberally place these ZWJ and ZWNJ characters throughout thai text
to force word boundaries, so we must also deal with them.

We deal with all Inherited characters by mapping them to the invalid code ~0
in tis620 encoding, following what libthai does internally in its own tis620
encoding functions, and then replacing this character with the original
unicode and setting dontPrint to true to hide the ZWJ and ZWNJ
characters.

Includes a unit test to check the behaviour.

Change-Id: I1ee8388b650cb5fc61bcb265efb9843c73f327ac
Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/3rdparty/harfbuzz/src/harfbuzz-thai.c
tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp