diff options
author | Khaled Hosny <khaled@aliftype.com> | 2023-04-01 23:34:59 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2023-04-02 01:52:25 +0200 |
commit | 96aad0d0497c8486f8affc8fed79e63a060c9a59 (patch) | |
tree | 4806e89037a9346d4692dfc810a99529c183ce2e /vcl | |
parent | 574a5519e23e8ed50c54fb27587afb1b5b5c13c5 (diff) |
tdf#154549: Make combining marks inherit the script of their base
... regardless of the script of the mark itself.
Change-Id: I15a5d8cb2e1d7b7a26316689ffa11c278d1f6365
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149925
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/scrptrun.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/source/gdi/scrptrun.cxx b/vcl/source/gdi/scrptrun.cxx index fbc68ca41bf1..19cb54772b30 100644 --- a/vcl/source/gdi/scrptrun.cxx +++ b/vcl/source/gdi/scrptrun.cxx @@ -41,6 +41,7 @@ #include <sal/config.h> #include <rtl/character.hxx> +#include <unicode/uchar.h> #include <unicode/utypes.h> #include <unicode/uscript.h> @@ -119,14 +120,21 @@ struct PairIndices }; -// There are three Unicode script codes for Japanese text, but only one -// OpenType script tag, so we want to keep them in one run as splitting is -// pointless for the purpose of OpenType shaping. UScriptCode getScript(UChar32 ch, UErrorCode* status) { + // tdf#154549 + // Make combining marks inherit the script of their bases, regardless of + // their own script. + if (u_getIntPropertyValue(ch, UCHAR_GENERAL_CATEGORY) == U_NON_SPACING_MARK) + return USCRIPT_INHERITED; + UScriptCode script = uscript_getScript(ch, status); if (U_FAILURE(*status)) return script; + + // There are three Unicode script codes for Japanese text, but only one + // OpenType script tag, so we want to keep them in one run as splitting is + // pointless for the purpose of OpenType shaping. if (script == USCRIPT_KATAKANA || script == USCRIPT_KATAKANA_OR_HIRAGANA) return USCRIPT_HIRAGANA; return script; |