Skip to content

Commit

Permalink
font-patcher: Remove leftover code
Browse files Browse the repository at this point in the history
[why]
There is a bit of code that is not needed anymore (or was never needed).
This makes things look more complicated than they are.

[how]
1. It is plain wrong to write that we add one (1) glyph if we do not add
   any glyph.
2. One (1) is added to index later anyhow, so we do not need to distort
   the counting in the beginning (the code will run with index=1 for
   both the first and the second patched in glyph).

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Feb 13, 2023
1 parent d2721c2 commit 0590b68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,6 @@ class font_patcher:
""" Copies symbol glyphs into self.sourceFont """
progressText = ''
careful = False
glyphSetLength = 0
sourceFontCounter = 0

if self.args.careful:
Expand All @@ -1148,14 +1147,12 @@ class font_patcher:
glyphSetLength = len(symbolFontSelection)

if not self.args.quiet:
sys.stdout.write("Adding " + str(max(1, glyphSetLength)) + " Glyphs from " + setName + " Set \n")
sys.stdout.write("Adding {} Glyphs from {} Set\n".format(glyphSetLength, setName))

currentSourceFontGlyph = -1 # initialize for the exactEncoding case
width_warning = False

for index, sym_glyph in enumerate(symbolFontSelection):
index = max(1, index)

sym_attr = attributes.get(sym_glyph.unicode)
if sym_attr is None:
sym_attr = attributes['default']
Expand Down

0 comments on commit 0590b68

Please sign in to comment.