1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-03-03 14:36:18 +02:00

Merge pull request #1089 from ryanoasis/bugfix/protect-stylistic-sets

Do not destroy ligs or SS
This commit is contained in:
Fini 2023-01-28 15:43:50 +01:00 committed by GitHub
commit f28295b2ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -940,9 +940,17 @@ class font_patcher:
# Find out which other glyphs are also needed to keep the basic # Find out which other glyphs are also needed to keep the basic
# glyphs intact. # glyphs intact.
# 0x00-0x17f is the Latin Extended-A range # 0x00-0x17f is the Latin Extended-A range
for glyph in range(0x21, 0x17f): basic_glyphs = set()
# Collect substitution destinations
for glyph in range(0x21, 0x17f + 1):
if not glyph in self.sourceFont: if not glyph in self.sourceFont:
continue continue
basic_glyphs.add(glyph)
for possub in self.sourceFont[glyph].getPosSub('*'):
if possub[1] == 'Substitution' or possub[1] == 'Ligature':
basic_glyphs.add(self.sourceFont[possub[2]].unicode)
basic_glyphs.discard(-1) # the .notdef glyph
for glyph in basic_glyphs:
self.add_glyphrefs_to_essential(glyph) self.add_glyphrefs_to_essential(glyph)
def get_sourcefont_dimensions(self): def get_sourcefont_dimensions(self):
@ -1297,7 +1305,7 @@ class font_patcher:
# end for # end for
if not self.args.quiet or self.args.progressbars: if not self.args.quiet:
sys.stdout.write("\n") sys.stdout.write("\n")