diff --git a/bin/font-patcher b/bin/font-patcher index c245d3b..e8f08ce 100755 --- a/bin/font-patcher +++ b/bin/font-patcher @@ -6,7 +6,7 @@ from __future__ import absolute_import, print_function, unicode_literals # Change the script version when you edit this script: -script_version = "3.1.1" +script_version = "3.2.1" version = "2.3.0-RC" projectName = "Nerd Fonts" @@ -573,7 +573,7 @@ class font_patcher: "* Website: https://www.nerdfonts.com\n" "* Version: " + version + "\n" "* Development Website: https://github.com/ryanoasis/nerd-fonts\n" - "* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/master/changelog.md" + "* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/-/changelog.md" ) familyname = replace_font_name(familyname, reservedFontNameReplacements) @@ -620,6 +620,7 @@ class font_patcher: def remove_ligatures(self): # let's deal with ligatures (mostly for monospaced fonts) + # the tables have been removed from the repo with >this< commit if self.args.configfile and self.config.read(self.args.configfile): if self.args.removeligatures: print("Removing ligatures from configfile `Subtables` section") @@ -773,7 +774,7 @@ class font_patcher: # Define the character ranges # Symbol font ranges self.patch_set = [ - {'Enabled': True, 'Name': "Seti-UI + Custom", 'Filename': "original-source.otf", 'Exact': False, 'SymStart': 0xE4FA, 'SymEnd': 0xE534, 'SrcStart': 0xE5FA, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT}, + {'Enabled': True, 'Name': "Seti-UI + Custom", 'Filename': "original-source.otf", 'Exact': False, 'SymStart': 0xE4FA, 'SymEnd': 0xE5AA, 'SrcStart': 0xE5FA, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT}, {'Enabled': True, 'Name': "Devicons", 'Filename': "devicons.ttf", 'Exact': False, 'SymStart': 0xE600, 'SymEnd': 0xE6C5, 'SrcStart': 0xE700, 'ScaleGlyph': DEVI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, {'Enabled': self.args.powerline, 'Name': "Powerline Symbols", 'Filename': "powerline-symbols/PowerlineSymbols.otf", 'Exact': True, 'SymStart': 0xE0A0, 'SymEnd': 0xE0A2, 'SrcStart': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_POWERLINE}, {'Enabled': self.args.powerline, 'Name': "Powerline Symbols", 'Filename': "powerline-symbols/PowerlineSymbols.otf", 'Exact': True, 'SymStart': 0xE0B0, 'SymEnd': 0xE0B3, 'SrcStart': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_POWERLINE}, @@ -924,8 +925,8 @@ class font_patcher: else: symbolFont.selection.select((str("ranges"), str("unicode")), symbolFontStart, symbolFontEnd) - # Get number of selected non-empty glyphs - symbolFontSelection = list(symbolFont.selection.byGlyphs) + # Get number of selected non-empty glyphs with codes >=0 (i.e. not -1 == notdef) + symbolFontSelection = [ x for x in symbolFont.selection.byGlyphs if x.unicode >= 0 ] glyphSetLength = len(symbolFontSelection) if self.args.quiet is False: @@ -952,6 +953,9 @@ class font_patcher: possible_codes += [ sym_glyph.unicode ] if sym_glyph.altuni: possible_codes += [ v for v, s, r in sym_glyph.altuni if v > currentSourceFontGlyph ] + if len(possible_codes) == 0: + print(" Can not determine codepoint of {:X}. Skipping...".format(sym_glyph.unicode)) + continue currentSourceFontGlyph = min(possible_codes) else: # use source font defined hex values based on passed in start (fills gaps; symbols are packed) @@ -1279,7 +1283,7 @@ def setup_arguments(): '* Website: https://www.nerdfonts.com\n' '* Version: ' + version + '\n' '* Development Website: https://github.com/ryanoasis/nerd-fonts\n' - '* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/master/changelog.md'), + '* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/-/changelog.md'), formatter_class=RawTextHelpFormatter ) diff --git a/src/glyphs/original-source.otf b/src/glyphs/original-source.otf index ab9f5df..26d50a2 100644 Binary files a/src/glyphs/original-source.otf and b/src/glyphs/original-source.otf differ