On Tue, Jan 17, 2017 at 02:51:23PM +0100, Jean-Marc Lasgouttes wrote: > 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,
Hi JMcra :) > 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? Yes, but I would propose to do that in addition. Nonetheless, my feeling is that this issue is caused by the assumptions of Qt about a given font. For example, it refuses to draw the glyph of a character whose codepoint corresponds to a soft hyphen, irrespective of the actual font, and other such amenities. > JMarc > -- Enrico