diff --git a/font-patcher b/font-patcher index 585eae11f..a5301088e 100755 --- a/font-patcher +++ b/font-patcher @@ -703,12 +703,20 @@ def copy_glyphs(sourceFont, sourceFontStart, sourceFontEnd, symbolFont, symbolFo align_matrix = psMat.translate(x_align_distance, y_align_distance) sourceFont.transform(align_matrix) - if args.single: - # Ensure the font is considered monospaced on Windows by setting the same - # width for all character glyphs. - # This needs to be done for all glyphs, even the ones that are empty and - # didn't go through the scaling operations. - sourceFont[currentSourceFontGlyph].width = font_dim['width'] + # Needed for setting 'advance width' on each glyph so they do not overlap, + # also ensures the font is considered monospaced on Windows by setting the + # same width for all character glyphs. + # This needs to be done for all glyphs, even the ones that are empty and + # didn't go through the scaling operations. + sourceFont[currentSourceFontGlyph].width = font_dim['width'] + + # Ensure after horizontal adjustments and centering that the glyph + # does not overlap the bearings (edges) + if sourceFont[currentSourceFontGlyph].left_side_bearing < 0: + sourceFont[currentSourceFontGlyph].left_side_bearing = 0.0 + + if sourceFont[currentSourceFontGlyph].right_side_bearing < 0: + sourceFont[currentSourceFontGlyph].right_side_bearing = 0.0 # reset selection so iteration works properly @todo fix? rookie misunderstanding? # This is likely needed because the selection was changed when the glyph was copy/pasted