Skip to content

Commit 54acb57

Browse files
committed
font-patcher: Add ScaleGlyph for Material Design Icons
[why] Scaling the glyphs individually breaks a lot of glyph pairs or groups, for example F0718-F071E. [how] Use one ScaleGlyph for the complete set. The set itself is already very well scaled, i.e. all glyphs are maximized in a given design space and that they look good next to pairing glyphs. There is no need to use ScaleRules which is quite costly for such a big range of glyphs (they all are copied twice in the process). Signed-off-by: Fini Jastrow <[email protected]>
1 parent cd39545 commit 54acb57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

font-patcher

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from __future__ import absolute_import, print_function, unicode_literals
77

88
# Change the script version when you edit this script:
9-
script_version = "3.4.2"
9+
script_version = "3.4.3"
1010

1111
version = "2.3.0-RC"
1212
projectName = "Nerd Fonts"
@@ -850,6 +850,10 @@ class font_patcher:
850850
[0xf06e, 0xf070 ], # solar eclipse
851851
[0xf042, 0xf045 ], # degree sign
852852
]}
853+
MDI_SCALE_LIST = {'ScaleGlyph': 0xf068d, # 'solid' fills complete design space
854+
'GlyphsToScale+': [
855+
(0xf0000, 0xfffff) # all because they are very well scaled already
856+
]}
853857

854858
# Define the character ranges
855859
# Symbol font ranges
@@ -868,7 +872,7 @@ class font_patcher:
868872
{'Enabled': self.args.powersymbols, 'Name': "Power Symbols", 'Filename': "Unicode_IEC_symbol_font.otf", 'Exact': True, 'SymStart': 0x23FB, 'SymEnd': 0x23FE, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT}, # Power, Power On/Off, Power On, Sleep
869873
{'Enabled': self.args.powersymbols, 'Name': "Power Symbols", 'Filename': "Unicode_IEC_symbol_font.otf", 'Exact': True, 'SymStart': 0x2B58, 'SymEnd': 0x2B58, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT}, # Heavy Circle (aka Power Off)
870874
{'Enabled': self.args.material, 'Name': "Material legacy", 'Filename': "materialdesignicons-webfont.ttf", 'Exact': False, 'SymStart': 0xF001, 'SymEnd': 0xF847, 'SrcStart': 0xF500, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
871-
{'Enabled': self.args.material, 'Name': "Material", 'Filename': "materialdesign/MaterialDesignIconsDesktop.ttf", 'Exact': True, 'SymStart': 0xF0001,'SymEnd': 0xF1AF0,'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
875+
{'Enabled': self.args.material, 'Name': "Material", 'Filename': "materialdesign/MaterialDesignIconsDesktop.ttf", 'Exact': True, 'SymStart': 0xF0001,'SymEnd': 0xF1AF0,'SrcStart': None, 'ScaleRules': MDI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
872876
{'Enabled': self.args.weather, 'Name': "Weather Icons", 'Filename': "weather-icons/weathericons-regular-webfont.ttf", 'Exact': False, 'SymStart': 0xF000, 'SymEnd': 0xF0EB, 'SrcStart': 0xE300, 'ScaleRules': WEATH_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
873877
{'Enabled': self.args.fontlogos, 'Name': "Font Logos", 'Filename': "font-logos.ttf", 'Exact': True, 'SymStart': 0xF300, 'SymEnd': 0xF32F, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
874878
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons.ttf", 'Exact': False, 'SymStart': 0xF000, 'SymEnd': 0xF105, 'SrcStart': 0xF400, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Magnifying glass

0 commit comments

Comments
 (0)