1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-13 17:18:37 +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
# glyphs intact.
# 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:
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)
def get_sourcefont_dimensions(self):
@ -1297,7 +1305,7 @@ class font_patcher:
# end for
if not self.args.quiet or self.args.progressbars:
if not self.args.quiet:
sys.stdout.write("\n")