[Libreoffice-bugs] [Bug 118884] Unary/Binary Operators glyph rendering initially misplaced

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Sep 8 04:34:42 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=118884

--- Comment #7 from Jan-Marek Glogowski <glogow at fbihome.de> ---
The primary fix is https://gerrit.libreoffice.org/#/c/60091/. I'm not sure why
the old code was working at all.

The problem was the completely ignored nFallbackLevel of the glyphs.

For the rendering of the symbols, we do

1. set fallback 0 font OpenSymbol
2. set current scale factor to font 0
3. we render the glyphs to the cache

<something happens here - probably some normal glyphs are rendered which>

1. sets fallback 1 some normal font, as we can't render normal text with the
Symbol font
2. set current scale factor to font 1

now we ask for the glyph bounding boxes of our symbols

The old code was wrong here, as it
1. used the wrong "current scale"
2. ignored the fallback level of the glyphs

This is why the glyph were rendered correct, but overlapping, because the
non-Symbol fonts characters with the same glyph id are overall not so width.

Sometimes you were able to get the correct symbol rendered in the math window,
but when you moved the cursor in the editor to the different parts of the
formular, you could see the highlight frame was smaller then the glyph.
Took me a while to figure all this out...

This global "current scale factor" was always wrong. Probably before we were
lucky and didn't get a fallback font. I don't know.

So the patch moves the scaling factor to the font object, where it belongs - no
more global var.
And now, when we ask for the glyph bounding boxes, we check for the glyphs'
fallback level, eventually change the font and use the correct scaling to get
the correct bounding box.

https://gerrit.libreoffice.org/#/c/60093/ might also be a fix. Font lookup
depends on the SalGraphics in strange way and not just the HDC (look at
ImplDoSetFont). At least this moves the real lookup into the
LogicalFontInstance, where it belongs.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180908/7eca38e4/attachment-0001.html>


More information about the Libreoffice-bugs mailing list