From 198009db79a85d3cab7fe3a6432635d36123a2d6 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 15 Aug 2014 15:55:12 +0200 Subject: Fix several regressions in font selection In Qt 5.3.0 a change was added which automatically adapts Common script to surrounding scripts in accordance with the Unicode tr#24. This broke *a lot* of cases of font selection because the font selection algorithm is not prepared for handling characters with adapted scripts. We need to disable this change for now and redo it later with patches to font selection to avoid the regressions. [ChangeLog][Text] Fixed several regressions in font selection when combining different writing systems in the same text. Task-number: QTBUG-39930 Task-number: QTBUG-39860 Change-Id: Id02b5ae2403c06542ed5d81e7c4deb2e0c7d816e Reviewed-by: Konstantin Ritt --- src/corelib/tools/qunicodetools.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib/tools/qunicodetools.cpp') diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp index fc36d07a4a..bb2c032e57 100644 --- a/src/corelib/tools/qunicodetools.cpp +++ b/src/corelib/tools/qunicodetools.cpp @@ -710,6 +710,7 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts) script = QChar::Script(prop->script); } +#if 0 // ### Disabled due to regressions. The font selection algorithm is not prepared for this change. if (Q_LIKELY(script != QChar::Script_Common)) { // override preceding Common-s while (sor > 0 && scripts[sor - 1] == QChar::Script_Common) @@ -719,6 +720,7 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts) if (sor > 0) script = scripts[sor - 1]; } +#endif while (sor < eor) scripts[sor++] = script; @@ -726,6 +728,8 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts) script = prop->script; } eor = length; + +#if 0 // ### Disabled due to regressions. The font selection algorithm is not prepared for this change. if (Q_LIKELY(script != QChar::Script_Common)) { // override preceding Common-s while (sor > 0 && scripts[sor - 1] == QChar::Script_Common) @@ -735,6 +739,8 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts) if (sor > 0) script = scripts[sor - 1]; } +#endif + while (sor < eor) scripts[sor++] = script; } -- cgit v1.2.3