Skip to content

cogl-pango/glyph-cache: Add 1 pixel in each direction to ink rects

Jonas Dreßler requested to merge verdre/mutter:pango-glyph-cache+1 into master

When drawing a ClutterText on a scaled display and the actor has a resource scale of 2, ClutterText will use Pango to render text that's twice the size and then scale it down again. Now if the actor is present on multiple outputs where one output is not scaled, on that monitor the downscaled text will be shown without being upscaled by the view again.

For some reason if this is the case, all the glyphs are missing exactly one pixel at the bottom and right edge, which make the font rendering look quite broken (maybe the linear upscaling used if the view is actually scaled makes this less visible).

The fix (or rather a workaround, although we're also using the size + 1 when reserving space with the CoglAtlas) for this is to add one pixel to the ink rect we're creating the texture for rendering the glyphs into with.


Comparison (open with an image editor and zoom in):

Without this change:

Screenshot_from_2020-03-10_11-14-17

With this change:

Screenshot_from_2020-03-10_11-13-35

Merge request reports