]> git.lyx.org Git - features.git/commit
Work around issues with Qt5 and Arabic text
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 23 Oct 2016 18:52:01 +0000 (20:52 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 26 Oct 2016 14:17:18 +0000 (16:17 +0200)
commit24648404b3c85015584b1ca127e257cbecf3342d
treefed8e1d4a8e6ae68a42d53986299a7c6e31c2fc8
parent10b8421ed6803381ab87a044d7407f48bcbc82ae
Work around issues with Qt5 and Arabic text

This fixes two particular problems

* with Qt5, it seems that QFontMetrics::width does not return the
  correct value for some Arabic text; this patch uses QTextLayout
  instead to compute a string width

* Likewise, the undocumented layout flags TextForceRightToLeft and
  TextForceLeftToRight do not work with Arabic text; this patch uses
  unicode override characters instead.

It might be that the two issues are related. In any case, they do not
happen with latin text where right-to-left direction is enforced. And
they do not happen with Qt4.

Additionally, remove some dead code in GuiFontMetrics::pos2x().

Fixes bug #10436.

(cherry picked from commit e832d2e90f300afb1b1255a486e56d059b2dfab7)
src/frontends/qt4/GuiFontMetrics.cpp