Fix issue with some fonts where glyphs overhanging their advance would be cut off
@@ -427,11 +427,15 @@ class GDIPlusGlyphRenderer(Win32GlyphRenderer):
ord(text), ord(text), byref(abc)):
lsb = abc.abcA
+ width = abc.abcB
if lsb < 0:
# Negative LSB: we shift the layout rect to the right
# Otherwise we will cut the left part of the glyph
rect.x = -lsb
width -= lsb
+ else:
+ width += lsb
+
# XXX END HACK HACK HACK
# Draw character to bitmap
@@ -467,7 +471,6 @@ class GDIPlusGlyphRenderer(Win32GlyphRenderer):
# Only pass negative LSB info
lsb = min(lsb, 0)
glyph.set_bearings(-self.font.descent, lsb, advance)
-
return glyph
FontStyleBold = 1
