Skip to content

Commit

Permalink
Merge pull request ryanoasis#394 from Finii/bugfix/diacritics_in_mono
Browse files Browse the repository at this point in the history
Bugfix/diacritics in mono
  • Loading branch information
ryanoasis authored Dec 22, 2019
2 parents 10b5978 + 2b45044 commit 328b490
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,19 @@ class font_patcher:
""" Makes self.sourceFont monospace compliant """

for glyph in self.sourceFont.glyphs():
self.remove_glyph_neg_bearings(glyph)
if (glyph.width == self.font_dim['width']):
# Don't tough the (negative) bearings if the width is ok
# Ligartures will have these.
continue

if (glyph.width != 0):
# If the width is zero this glyph is intened to be printed on top of another one.
# In this case we need to keep the negative bearings to shift it 'left'.
# Things like Ä have these: composed of U+0041 'A' and U+0308 'double dot above'
#
# If width is not zero, correct the bearings such that they are within the width:
self.remove_glyph_neg_bearings(glyph)

self.set_glyph_width_mono(glyph)


Expand Down

0 comments on commit 328b490

Please sign in to comment.