Skip to content

Commit

Permalink
Fix Noto 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 Noto has the '1/2', '1/4', '3/4' that are all wider then the
normal (i.e. letter) glyphs.

[how]
Exclude a small sub-range from the 'find the widest glyph' that contain
no glyphs one would call 'letter'.

Fixes: ryanoasis#610

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

0 comments on commit fbe07b8

Please sign in to comment.