]> git.lyx.org Git - features.git/commit
Try to use the right width for math symbols
authorEnrico Forestieri <forenr@lyx.org>
Tue, 8 Sep 2020 23:25:12 +0000 (01:25 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 8 Sep 2020 23:25:12 +0000 (01:25 +0200)
commit34f33b27a36ec3e7298546588768747802f99fcc
treed6266ae79f7d8c36cb998415e12ec0d04736e6c5
parentede483856e91f7d906887cd70cec6659378849eb
Try to use the right width for math symbols

The rules for typesetting math differ from the rules for typesetting
text. For example, two italic 'f' chars have to be typeset more closely
than two 'o' chars in text mode, but not in math mode. Qt provides a
method that returns the distance appropriate for drawing a subsequent
character in text mode, but nothing for math mode. Typically, the
distance appropriate for drawing the next character in math mode is
the actual width span by the character, corrected by the rules of
an appendix in the TeXbook. Recently, those rules are followed more
closely in LyX but not exactly, and we have to find a way to adapt to them.
Some symbols may need more spacing around them than the width they span.
So, we use the distance suggested by Qt, unless it is less than the
width of the rectangle bounding the symbol. Before Qt 5.11 the used method
was QFontMetrics::width(), but since then it has been declared obsolete
in favor of QFontMetrics::horizontalAdvance(), whose name conveys better
its meaning.

No status entry is needed as this amends 79998fdc.
src/frontends/qt4/GuiFontMetrics.cpp