diff --git a/bin/scripts/README.md b/bin/scripts/README.md index 1dd1a4ecf..6d015b6e6 100644 --- a/bin/scripts/README.md +++ b/bin/scripts/README.md @@ -11,6 +11,7 @@ Note: Usually you need to call the scripts in this directory while actually bein * `fpfix.py`: Can be used to set isFixedPitch property in a font [x] * `generate-casks.sh`: Generates cask files for fonts from data in `archives/` [6] * `generate-css.sh`: Generates the Nerd Fonts CCS, which can be used to access the glyphs on a web page, and the Cheat Sheet [1] +* `generate-extraglyphs.py:` Generates `extraglyphs.sfd` from Hack Regular [4] * `generate-fontconfig.sh`: Generates font configuration to enable use of unpatched fonts with Symbols Only Nerd Font [1] * `generate-font-image-previews.sh`: Generates the preview images for `nerdfonts.com` (i.e. gh-pages) [3] * `generate-glyph-info-from-set.py`: Generate the `i_xxx.sh` file from a glyph source (font) file, if the glyphs are named correctly [4] diff --git a/bin/scripts/generate-extraglyphs.py b/bin/scripts/generate-extraglyphs.py new file mode 100755 index 000000000..2dcf3cc39 --- /dev/null +++ b/bin/scripts/generate-extraglyphs.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# Nerd Fonts Version: 2.3.3 +# Script Version: 1.0.0 +# Generates extrasymbols.sfd from Hack + +import os +import fontforge + +srcdir = '../../src' +srcfont = 'unpatched-fonts/Hack/Regular/Hack-Regular.ttf' +outfont = 'glyphs/extraglyphs.sfd' + +print('Opening {}'.format(outfont)) +font = fontforge.open(os.path.join(srcdir, srcfont)) + +font.selection.select( + 0x276C, # medium left-pointing angle bracket + 0x276D, # medium right-pointing angle bracket + 0x276E, # heavy left-pointing angle quotation mark + 0x276F, # heavy right-pointing angle quotation mark + 0x2770, # heavy left-pointing angle bracket + 0x2771, # heavy right-pointing angle bracket +) + +num_icons = len(list(font.selection)) + +font.selection.invert() +font.clear() + +print('Generating {} with {} glyphs'.format(outfont, num_icons)) +font.generate(os.path.join(srcdir, outfont), flags=("no-FFTM-table",)) +font.close() diff --git a/font-patcher b/font-patcher index 8d6d49e0c..534ddcb75 100755 --- a/font-patcher +++ b/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.5.3" +script_version = "3.5.4" version = "2.3.3" projectName = "Nerd Fonts" @@ -796,6 +796,9 @@ class font_patcher: 0xf0dd: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}}, 0xf0de: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}} } + SYM_ATTR_HEAVYBRACKETS = { + 'default': {'align': 'c', 'valign': 'c', 'stretch': 'pa', 'params': {'careful': True}} + } CUSTOM_ATTR = { # 'pa' == preserve aspect ratio @@ -895,6 +898,7 @@ class font_patcher: # Symbol font ranges self.patch_set = [ {'Enabled': True, 'Name': "Seti-UI + Custom", 'Filename': "original-source.otf", 'Exact': False, 'SymStart': 0xE4FA, 'SymEnd': 0xE5AA, 'SrcStart': 0xE5FA, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT}, + {'Enabled': True, 'Name': "Heavy Angle Brackets", 'Filename': "extraglyphs.sfd", 'Exact': True, 'SymStart': 0x0000, 'SymEnd': 0x0000, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_HEAVYBRACKETS}, {'Enabled': True, 'Name': "Devicons", 'Filename': "devicons.ttf", 'Exact': False, 'SymStart': 0xE600, 'SymEnd': 0xE6C5, 'SrcStart': 0xE700, 'ScaleRules': 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, 'ScaleRules': 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, 'ScaleRules': None, 'Attributes': SYM_ATTR_POWERLINE}, diff --git a/src/glyphs/extraglyphs.sfd b/src/glyphs/extraglyphs.sfd new file mode 100644 index 000000000..45f63aa61 Binary files /dev/null and b/src/glyphs/extraglyphs.sfd differ