Skip to content

Commit 837abd6

Browse files
authored
Merge pull request #3300 from jepler/count-missing-chars
gen_display_resources: report missing character count, if any
2 parents 8e77981 + 5056027 commit 837abd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/gen_display_resources.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,20 @@ def _load_row(self, y, row):
5858
# Try to pre-load all of the glyphs. Misses will still be slow later.
5959
f.load_glyphs(set(ord(c) for c in all_characters))
6060

61+
missing = 0
6162
# Get each glyph.
6263
for c in set(all_characters):
6364
if ord(c) not in f._glyphs:
65+
missing += 1
6466
filtered_characters = filtered_characters.replace(c, "")
6567
continue
6668
g = f.get_glyph(ord(c))
6769
if g["shift"][1] != 0:
6870
raise RuntimeError("y shift")
6971

72+
if missing > 0:
73+
print("Font missing", missing, "characters", file=sys.stderr)
74+
7075
x, y, dx, dy = f.get_bounding_box()
7176
tile_x, tile_y = x - dx, y - dy
7277
total_bits = tile_x * len(all_characters)

0 commit comments

Comments
 (0)