Skip to content

Commit

Permalink
Add fallback for characters not in newstroke font
Browse files Browse the repository at this point in the history
Fixes #89
  • Loading branch information
qu1ck committed Apr 8, 2019
1 parent 833369f commit 07b8da7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion InteractiveHtmlBom/core/fontparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def parse_font_char(self, chr):
lines = []
line = []
glyph_x = 0
glyph_str = NEWSTROKE_FONT[ord(chr) - ord(' ')]
index = ord(chr) - ord(' ')
if index >= len(NEWSTROKE_FONT):
index = ord('?') - ord(' ')
glyph_str = NEWSTROKE_FONT[index]
for i in range(0, len(glyph_str), 2):
coord = glyph_str[i:i + 2]

Expand Down

0 comments on commit 07b8da7

Please sign in to comment.