]> 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>
Mon, 24 Oct 2016 14:31:40 +0000 (16:31 +0200)
commite832d2e90f300afb1b1255a486e56d059b2dfab7
tree2e0e2bbb6e6666ff44f5d95913fca01e2d501ea4
parent8b5dc3c6623271d27807a20d29b738f6790c346a
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.
src/frontends/qt4/GuiFontMetrics.cpp