]> git.lyx.org Git - lyx.git/commit
Adopt a 'belt and braces' approach to bidi forcing
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 27 Jan 2020 17:38:21 +0000 (18:38 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 27 Jan 2020 22:23:10 +0000 (23:23 +0100)
commit4d6041a7b68de5856b657cfd3b735596b3d7e0e0
tree36b423f7f506eade0e683fae06698a43177cd3a1
parenta6f9c6ae43520335fa8243d84d940c411f3e9eec
Adopt a 'belt and braces' approach to bidi forcing

There are two techniques that I know of for forcing the direction of a
string, regardlessly of whether its contents is naturally LtR, RtL or
undecided.

1/ The unicode LTR/LTR override characters. This is supposed to be the
   clean way, however, it does not seem to work with Qt 5.14 (see
   #11691).

2/ The undocumented QTextLayout::setFlags method. This is used
   internally and allows to pass the (undocumented) flags
   Qt::TextForceRightToLeft and Qt::TextForceLeftToRight. This was
   used until we had issues with Qt 5.11 (see #11284).

In order to get the best of both worlds, this patch allows to enable
those two methods separately, and actually enables both at the same
time by default!

(hopefully) Fixes bug #11691.
src/frontends/qt/GuiFontMetrics.cpp