Le 17/01/2017 à 12:19, Enrico Forestieri a écrit :
This seems to be a Qt issue. QTextLine::naturalTextWidth() should report
the width of the line occupied by text. If a zero-width character is
present, it is correctly accounted for, except when it is the only
character in the line. That is to say that "/=" has the same width
as "=" if "/" has zero-width, but "/" by alone is reported to have
its real width. The metrics in math are computed char by char, so that
explains the behavior. The solution is to compute the width by using
the old method when when the font is one of ours. See attached patch.

Hello Enroci,

Thanks for the analysis. You patch is a solution, but wouldn't it more in line with what you propose to use width(s[0]) when there is only one character?

JMarc

Reply via email to