Skip to content

Commit

Permalink
font-patcher: Fix Overpass Mono too wide
Browse files Browse the repository at this point in the history
[why]
The 'monospace' width is determined by examining all the 'normal' glyphs
and taking the widest one.

'Normal' means 0x00-0x17f: the Latin Extended-A range.

Unfortunately Overpass (Mono) has wide-as-two-letters IJ and ij ligatures.

[how]
Exclude a small sub-range from the 'find the widest glyph' that contain
these ligatures. Yes they will kind of break, but what can we do if we
want to create a strictly monospaced font?

[note]
Related commit
  fbe07b8  Fix Noto too wide

Related: #1043

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Jan 10, 2023
1 parent 9514cbc commit 2945cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,8 @@ class font_patcher:
#
# 0x00-0x17f is the Latin Extended-A range
for glyph in range(0x21, 0x17f):
if glyph in range(0x7F, 0xBF):
continue # ignore special characters like '1/4' etc
if glyph in range(0x7F, 0xBF) or glyph in range(0x132, 0x134):
continue # ignore special characters like '1/4' etc and 'IJ' 'ij'
try:
(_, _, xmax, _) = self.sourceFont[glyph].boundingBox()
except TypeError:
Expand Down

0 comments on commit 2945cec

Please sign in to comment.