mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-12-22 06:50:44 -06:00
chore: change batteries
This commit is contained in:
parent
2982276504
commit
ae6ae25f3e
17 changed files with 4168 additions and 28 deletions
|
@ -153,7 +153,7 @@ class FontnameParser:
|
||||||
keep_regular = self.keep_regular_in_family
|
keep_regular = self.keep_regular_in_family
|
||||||
if ('Regular' in styles
|
if ('Regular' in styles
|
||||||
and (not keep_regular
|
and (not keep_regular
|
||||||
or len(self.weight_token) > 0)): # This is actually a malformed font name
|
or FontnameTools.check_contains_weight(self.weight_token))): # This is actually a malformed font name
|
||||||
styles = list(self.style_token)
|
styles = list(self.style_token)
|
||||||
styles.remove('Regular')
|
styles.remove('Regular')
|
||||||
# For naming purposes we want Oblique to be part of the styles
|
# For naming purposes we want Oblique to be part of the styles
|
||||||
|
@ -309,12 +309,12 @@ class FontnameParser:
|
||||||
os2_weight, ps_weight, name_weight,
|
os2_weight, ps_weight, name_weight,
|
||||||
font.os2_weight, font.weight, weight))
|
font.os2_weight, font.weight, weight))
|
||||||
|
|
||||||
def pfam_to_sfnt(self, name_function, entry, message):
|
def pfam_to_sfnt(self, name_function, entry, message, maxnum = 2):
|
||||||
"""Prepare SFNT entries for short and long form as two different languages"""
|
"""Prepare SFNT entries for short and long form as two different languages"""
|
||||||
languages = [ 'English (US)', 'English (British)' ]
|
languages = [ 'English (US)', 'English (British)' ]
|
||||||
names = [ name_function(False), name_function(True) ]
|
names = [ name_function(False), name_function(True) ]
|
||||||
ret = [ ]
|
ret = [ ]
|
||||||
for i in range(2):
|
for i in range(maxnum):
|
||||||
if len(names[i]):
|
if len(names[i]):
|
||||||
ret += [( languages[i], entry, self.checklen(31, message, names[i]) )]
|
ret += [( languages[i], entry, self.checklen(31, message, names[i]) )]
|
||||||
else:
|
else:
|
||||||
|
@ -374,8 +374,9 @@ class FontnameParser:
|
||||||
sfnt_list += [( 'English (US)', 'UniqueID', self.fullname() + version_tag )] # 3
|
sfnt_list += [( 'English (US)', 'UniqueID', self.fullname() + version_tag )] # 3
|
||||||
sfnt_list += [( 'English (US)', 'Fullname', self.checklen(63, 'Fullname (ID 4)', self.fullname()) )] # 4
|
sfnt_list += [( 'English (US)', 'Fullname', self.checklen(63, 'Fullname (ID 4)', self.fullname()) )] # 4
|
||||||
sfnt_list += [( 'English (US)', 'PostScriptName', self.checklen(63, 'PSN (ID 6)', self.psname()) )] # 6
|
sfnt_list += [( 'English (US)', 'PostScriptName', self.checklen(63, 'PSN (ID 6)', self.psname()) )] # 6
|
||||||
sfnt_list += self.pfam_to_sfnt(self.preferred_family, 'Preferred Family', 'PrefFamily (ID 16)') # 16
|
sfnt_plus = self.pfam_to_sfnt(self.preferred_family, 'Preferred Family', 'PrefFamily (ID 16)') # 16
|
||||||
sfnt_list += self.pfam_to_sfnt(self.preferred_styles, 'Preferred Styles', 'PrefStyles (ID 17)') # 17
|
sfnt_plus += self.pfam_to_sfnt(self.preferred_styles, 'Preferred Styles', 'PrefStyles (ID 17)', len(sfnt_plus)) # 17
|
||||||
|
sfnt_list += sfnt_plus
|
||||||
|
|
||||||
font.sfnt_names = tuple(sfnt_list)
|
font.sfnt_names = tuple(sfnt_list)
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ class FontnameTools:
|
||||||
# Noone cares that font names starting with a digit are forbidden:
|
# Noone cares that font names starting with a digit are forbidden:
|
||||||
( 'IBM 3270', r'3270'), # for historical reasons and 'IBM' is a TM or something
|
( 'IBM 3270', r'3270'), # for historical reasons and 'IBM' is a TM or something
|
||||||
# Some name parts that are too long for us
|
# Some name parts that are too long for us
|
||||||
( '(.*sans ?m)ono', r'\1'), # Various SomenameSansMono fonts
|
( '^(?!ubuntu)(.*sans ?m)ono', r'\1'), # Various SomenameSansMono fonts
|
||||||
( '(.*code ?lat)in', r'\1'), # for 'M PLUS Code Latin'
|
( '(.*code ?lat)in', r'\1'), # for 'M PLUS Code Latin'
|
||||||
( '(b)ig( ?)(b)lue( ?)(t)erminal', r'\1ig\3lue\5erm'), # Shorten BigBlueTerminal
|
( '(b)ig( ?)(b)lue( ?)(t)erminal', r'\1ig\3lue\5erm'), # Shorten BigBlueTerminal
|
||||||
( '(.*)437TT', r'\g<1>437'), # Shorten BigBlueTerminal 437 TT even further
|
( '(.*)437TT', r'\g<1>437'), # Shorten BigBlueTerminal 437 TT even further
|
||||||
|
@ -219,7 +219,7 @@ class FontnameTools:
|
||||||
( '(.*r)adon', r'\1n'), # Monaspace shorten face name
|
( '(.*r)adon', r'\1n'), # Monaspace shorten face name
|
||||||
( '(im ?writing ?q)uattro', r'\1uat'), # Rename iM Writing Quattro to Quat
|
( '(im ?writing ?q)uattro', r'\1uat'), # Rename iM Writing Quattro to Quat
|
||||||
( '(im ?writing ?(mono|duo|quat)) ?s', r'\1'), # Remove S from all iM Writing styles
|
( '(im ?writing ?(mono|duo|quat)) ?s', r'\1'), # Remove S from all iM Writing styles
|
||||||
( '(r)ec( ?)(m)ono( ?)(s)emicasual', r'\1ec\3ono\5emi'), # Shorten RecMonoSemicausal
|
( '(r)ec( ?)(m)ono( ?)(s)emicasual', r'\1ec\3ono\5mCasual'), # Shorten RecMonoSemicausal
|
||||||
]
|
]
|
||||||
|
|
||||||
# From https://adobe-type-tools.github.io/font-tech-notes/pdfs/5088.FontNames.pdf
|
# From https://adobe-type-tools.github.io/font-tech-notes/pdfs/5088.FontNames.pdf
|
||||||
|
@ -250,8 +250,8 @@ class FontnameTools:
|
||||||
'Bold': ('Bd', 'Bold'),
|
'Bold': ('Bd', 'Bold'),
|
||||||
'Heavy': ('Hv', 'Heavy'),
|
'Heavy': ('Hv', 'Heavy'),
|
||||||
'Thin': ('Th', 'Thin'),
|
'Thin': ('Th', 'Thin'),
|
||||||
|
'Thick': ('Tk', 'Thck'),
|
||||||
'Light': ('Lt', 'Light'),
|
'Light': ('Lt', 'Light'),
|
||||||
' ': (), # Just for CodeClimate :-/
|
|
||||||
}
|
}
|
||||||
known_styles = [ # Keywords that end up as style (i.e. a RIBBI set)
|
known_styles = [ # Keywords that end up as style (i.e. a RIBBI set)
|
||||||
'Bold', 'Italic', 'Regular', 'Normal'
|
'Bold', 'Italic', 'Regular', 'Normal'
|
||||||
|
@ -290,6 +290,23 @@ class FontnameTools:
|
||||||
900: ('black', 'heavy', 'poster', 'extrablack', 'ultrablack'),
|
900: ('black', 'heavy', 'poster', 'extrablack', 'ultrablack'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def weight_permutations():
|
||||||
|
""" All the weight modifiers we know """
|
||||||
|
return [ m + s
|
||||||
|
for s in list(FontnameTools.known_weights2)
|
||||||
|
for m in list(FontnameTools.known_modifiers) + [''] if m != s
|
||||||
|
] + list(FontnameTools.known_weights1)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def check_contains_weight(token):
|
||||||
|
""" Check if a token set contains a Weight specifier or just Widths or Slopes """
|
||||||
|
weights = FontnameTools.weight_permutations()
|
||||||
|
for t in token:
|
||||||
|
if t in weights:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def weight_string_to_number(w):
|
def weight_string_to_number(w):
|
||||||
""" Convert a common string approximation to a PS/2 weight value """
|
""" Convert a common string approximation to a PS/2 weight value """
|
||||||
|
@ -379,6 +396,7 @@ class FontnameTools:
|
||||||
('Medm', 'Medium'), # IBM-Plex
|
('Medm', 'Medium'), # IBM-Plex
|
||||||
('Semi-Condensed', 'SemiCondensed'), # 3270
|
('Semi-Condensed', 'SemiCondensed'), # 3270
|
||||||
('SmBld', 'SemiBold'), # IBM-Plex
|
('SmBld', 'SemiBold'), # IBM-Plex
|
||||||
|
('Bold-Italic', 'BoldItalic'), # Terminus
|
||||||
]:
|
]:
|
||||||
name = re.sub(r'\b' + special[0] + r'\b', special[1], name, 1, re.IGNORECASE)
|
name = re.sub(r'\b' + special[0] + r'\b', special[1], name, 1, re.IGNORECASE)
|
||||||
name = re.sub('[_\s]+', ' ', name)
|
name = re.sub('[_\s]+', ' ', name)
|
||||||
|
@ -393,10 +411,11 @@ class FontnameTools:
|
||||||
# Weights end up as Typographic Family parts ('after the dash')
|
# Weights end up as Typographic Family parts ('after the dash')
|
||||||
# Styles end up as Family parts (for classic grouping of four)
|
# Styles end up as Family parts (for classic grouping of four)
|
||||||
# Others also end up in Typographic Family ('before the dash')
|
# Others also end up in Typographic Family ('before the dash')
|
||||||
weights = [ m + s
|
widths = [ m + s
|
||||||
for s in list(FontnameTools.known_weights2) + list(FontnameTools.known_widths)
|
for s in list(FontnameTools.known_widths)
|
||||||
for m in list(FontnameTools.known_modifiers) + [''] if m != s
|
for m in list(FontnameTools.known_modifiers) + ['']
|
||||||
] + list(FontnameTools.known_weights1) + list(FontnameTools.known_slopes)
|
]
|
||||||
|
weights = FontnameTools.weight_permutations() + list(FontnameTools.known_slopes)
|
||||||
weights = [ w for w in weights if w not in FontnameTools.known_styles ]
|
weights = [ w for w in weights if w not in FontnameTools.known_styles ]
|
||||||
# Some font specialities:
|
# Some font specialities:
|
||||||
other = [
|
other = [
|
||||||
|
@ -408,9 +427,11 @@ class FontnameTools:
|
||||||
r'(?:uni-)?1[14]', # GohuFont uni
|
r'(?:uni-)?1[14]', # GohuFont uni
|
||||||
]
|
]
|
||||||
|
|
||||||
|
( style, width_token ) = FontnameTools.get_name_token(style, widths)
|
||||||
( style, weight_token ) = FontnameTools.get_name_token(style, weights)
|
( style, weight_token ) = FontnameTools.get_name_token(style, weights)
|
||||||
( style, style_token ) = FontnameTools.get_name_token(style, FontnameTools.known_styles)
|
( style, style_token ) = FontnameTools.get_name_token(style, FontnameTools.known_styles)
|
||||||
( style, other_token ) = FontnameTools.get_name_token(style, other)
|
( style, other_token ) = FontnameTools.get_name_token(style, other)
|
||||||
|
weight_token = width_token + weight_token
|
||||||
while 'Regular' in style_token and len(style_token) > 1:
|
while 'Regular' in style_token and len(style_token) > 1:
|
||||||
# Correct situation where "Regular" and something else is given
|
# Correct situation where "Regular" and something else is given
|
||||||
style_token.remove('Regular')
|
style_token.remove('Regular')
|
||||||
|
|
22
font-patcher
22
font-patcher
|
@ -1,14 +1,14 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# coding=utf8
|
# coding=utf8
|
||||||
# Nerd Fonts Version: 3.1.1
|
# Nerd Fonts Version: 3.2.1
|
||||||
# Script version is further down
|
# Script version is further down
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Change the script version when you edit this script:
|
# Change the script version when you edit this script:
|
||||||
script_version = "4.12.0"
|
script_version = "4.13.1"
|
||||||
|
|
||||||
version = "3.1.1"
|
version = "3.2.1"
|
||||||
projectName = "Nerd Fonts"
|
projectName = "Nerd Fonts"
|
||||||
projectNameAbbreviation = "NF"
|
projectNameAbbreviation = "NF"
|
||||||
projectNameSingular = projectName[:-1]
|
projectNameSingular = projectName[:-1]
|
||||||
|
@ -338,9 +338,9 @@ class font_patcher:
|
||||||
def patch(self, font):
|
def patch(self, font):
|
||||||
self.sourceFont = font
|
self.sourceFont = font
|
||||||
self.setup_version()
|
self.setup_version()
|
||||||
self.get_essential_references()
|
|
||||||
self.assert_monospace()
|
self.assert_monospace()
|
||||||
self.remove_ligatures()
|
self.remove_ligatures()
|
||||||
|
self.get_essential_references()
|
||||||
self.get_sourcefont_dimensions()
|
self.get_sourcefont_dimensions()
|
||||||
self.setup_patch_set()
|
self.setup_patch_set()
|
||||||
self.improve_line_dimensions()
|
self.improve_line_dimensions()
|
||||||
|
@ -1078,15 +1078,15 @@ class font_patcher:
|
||||||
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0xE0CA, 'SymEnd': 0xE0CA, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_POWERLINE},
|
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0xE0CA, 'SymEnd': 0xE0CA, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_POWERLINE},
|
||||||
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0xE0CC, 'SymEnd': 0xE0D7, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_POWERLINE},
|
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0xE0CC, 'SymEnd': 0xE0D7, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_POWERLINE},
|
||||||
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0x2630, 'SymEnd': 0x2630, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_TRIGRAPH},
|
{'Enabled': self.args.powerlineextra, 'Name': "Powerline Extra Symbols", 'Filename': "powerline-extra/PowerlineExtraSymbols.otf", 'Exact': True, 'SymStart': 0x2630, 'SymEnd': 0x2630, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_TRIGRAPH},
|
||||||
{'Enabled': self.args.pomicons, 'Name': "Pomicons", 'Filename': "Pomicons.otf", 'Exact': True, 'SymStart': 0xE000, 'SymEnd': 0xE00A, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
{'Enabled': self.args.pomicons, 'Name': "Pomicons", 'Filename': "pomicons/Pomicons.otf", 'Exact': True, 'SymStart': 0xE000, 'SymEnd': 0xE00A, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
||||||
{'Enabled': self.args.fontawesome, 'Name': "Font Awesome", 'Filename': "font-awesome/FontAwesome.otf", 'Exact': True, 'SymStart': 0xF000, 'SymEnd': 0xF2E0, 'SrcStart': None, 'ScaleRules': FONTA_SCALE_LIST, 'Attributes': SYM_ATTR_FONTA},
|
{'Enabled': self.args.fontawesome, 'Name': "Font Awesome", 'Filename': "font-awesome/FontAwesome.otf", 'Exact': True, 'SymStart': 0xED00, 'SymEnd': 0xF2FF, 'SrcStart': None, 'ScaleRules': FONTA_SCALE_LIST, 'Attributes': SYM_ATTR_FONTA},
|
||||||
{'Enabled': self.args.fontawesomeextension, 'Name': "Font Awesome Extension", 'Filename': "font-awesome-extension.ttf", 'Exact': False, 'SymStart': 0xE000, 'SymEnd': 0xE0A9, 'SrcStart': 0xE200, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT}, # Maximize
|
{'Enabled': self.args.fontawesomeextension, 'Name': "Font Awesome Extension", 'Filename': "font-awesome-extension.ttf", 'Exact': False, 'SymStart': 0xE000, 'SymEnd': 0xE0A9, 'SrcStart': 0xE200, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT}, # Maximize
|
||||||
{'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
|
{'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
|
||||||
{'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)
|
{'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)
|
||||||
{'Enabled': False , 'Name': "Material legacy", 'Filename': "materialdesignicons-webfont.ttf", 'Exact': False, 'SymStart': 0xF001, 'SymEnd': 0xF847, 'SrcStart': 0xF500, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
{'Enabled': False , 'Name': "Material legacy", 'Filename': "materialdesign/materialdesignicons-webfont.ttf", 'Exact': False, 'SymStart': 0xF001, 'SymEnd': 0xF847, 'SrcStart': 0xF500, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
||||||
{'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},
|
{'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},
|
||||||
{'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},
|
{'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},
|
||||||
{'Enabled': self.args.fontlogos, 'Name': "Font Logos", 'Filename': "font-logos.ttf", 'Exact': True, 'SymStart': 0xF300, 'SymEnd': 0xF372, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
{'Enabled': self.args.fontlogos, 'Name': "Font Logos", 'Filename': "font-logos.ttf", 'Exact': True, 'SymStart': 0xF300, 'SymEnd': 0xF375, 'SrcStart': None, 'ScaleRules': None, 'Attributes': SYM_ATTR_DEFAULT},
|
||||||
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': False, 'SymStart': 0xF000, 'SymEnd': 0xF105, 'SrcStart': 0xF400, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Magnifying glass
|
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': False, 'SymStart': 0xF000, 'SymEnd': 0xF105, 'SrcStart': 0xF400, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Magnifying glass
|
||||||
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0x2665, 'SymEnd': 0x2665, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Heart
|
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0x2665, 'SymEnd': 0x2665, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Heart
|
||||||
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0X26A1, 'SymEnd': 0X26A1, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Zap
|
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0X26A1, 'SymEnd': 0X26A1, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Zap
|
||||||
|
@ -1135,14 +1135,14 @@ class font_patcher:
|
||||||
# glyphs intact.
|
# glyphs intact.
|
||||||
# 0x0000-0x017f is the Latin Extended-A range
|
# 0x0000-0x017f is the Latin Extended-A range
|
||||||
# 0xfb00-0xfb06 are 'fi' and other ligatures
|
# 0xfb00-0xfb06 are 'fi' and other ligatures
|
||||||
basic_glyphs = set()
|
basic_glyphs = { c for c in range(0x21, 0x17f + 1) if c in self.sourceFont }
|
||||||
# Collect substitution destinations
|
# Collect substitution destinations
|
||||||
for glyph in [*range(0x21, 0x17f + 1), *range(0xfb00, 0xfb06 + 1)]:
|
for glyph in list(basic_glyphs) + [*range(0xfb00, 0xfb06 + 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('*'):
|
for possub in self.sourceFont[glyph].getPosSub('*'):
|
||||||
if possub[1] == 'Substitution' or possub[1] == 'Ligature':
|
if possub[1] == 'Substitution' or possub[1] == 'Ligature':
|
||||||
|
basic_glyphs.add(glyph)
|
||||||
basic_glyphs.add(self.sourceFont[possub[2]].unicode)
|
basic_glyphs.add(self.sourceFont[possub[2]].unicode)
|
||||||
basic_glyphs.discard(-1) # the .notdef glyph
|
basic_glyphs.discard(-1) # the .notdef glyph
|
||||||
for glyph in basic_glyphs:
|
for glyph in basic_glyphs:
|
||||||
|
|
Binary file not shown.
|
@ -1,23 +1,151 @@
|
||||||
|
Fonticons, Inc. (https://fontawesome.com)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Font Awesome Free License
|
Font Awesome Free License
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Font Awesome Free is free, open source, and GPL friendly. You can use it for
|
Font Awesome Free is free, open source, and GPL friendly. You can use it for
|
||||||
commercial projects, open source projects, or really almost whatever you want.
|
commercial projects, open source projects, or really almost whatever you want.
|
||||||
Full Font Awesome Free license: https://fontawesome.com/license/free.
|
Full Font Awesome Free license: https://fontawesome.com/license/free.
|
||||||
|
|
||||||
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
|
--------------------------------------------------------------------------------
|
||||||
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
|
|
||||||
packaged as SVG and JS file types.
|
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
|
||||||
|
|
||||||
|
The Font Awesome Free download is licensed under a Creative Commons
|
||||||
|
Attribution 4.0 International License and applies to all icons packaged
|
||||||
|
as SVG and JS file types.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Fonts: SIL OFL 1.1 License
|
||||||
|
|
||||||
# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
|
|
||||||
In the Font Awesome Free download, the SIL OFL license applies to all icons
|
In the Font Awesome Free download, the SIL OFL license applies to all icons
|
||||||
packaged as web and desktop font files.
|
packaged as web and desktop font files.
|
||||||
|
|
||||||
|
Copyright (c) 2022 Fonticons, Inc. (https://fontawesome.com)
|
||||||
|
with Reserved Font Name: "Font Awesome".
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
SIL OPEN FONT LICENSE
|
||||||
|
Version 1.1 - 26 February 2007
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting — in part or in whole — any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Code: MIT License (https://opensource.org/licenses/MIT)
|
# Code: MIT License (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
In the Font Awesome Free download, the MIT license applies to all non-font and
|
In the Font Awesome Free download, the MIT license applies to all non-font and
|
||||||
non-icon files.
|
non-icon files.
|
||||||
|
|
||||||
|
Copyright 2022 Fonticons, Inc.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in the
|
||||||
|
Software without restriction, including without limitation the rights to use, copy,
|
||||||
|
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
and to permit persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Attribution
|
# Attribution
|
||||||
|
|
||||||
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
|
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
|
||||||
Awesome Free files already contain embedded comments with sufficient
|
Awesome Free files already contain embedded comments with sufficient
|
||||||
attribution, so you shouldn't need to do anything additional when using these
|
attribution, so you shouldn't need to do anything additional when using these
|
||||||
|
@ -27,7 +155,10 @@ We've kept attribution comments terse, so we ask that you do not actively work
|
||||||
to remove them from files, especially code. They're a great way for folks to
|
to remove them from files, especially code. They're a great way for folks to
|
||||||
learn about Font Awesome.
|
learn about Font Awesome.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Brand Icons
|
# Brand Icons
|
||||||
|
|
||||||
All brand icons are trademarks of their respective owners. The use of these
|
All brand icons are trademarks of their respective owners. The use of these
|
||||||
trademarks does not indicate endorsement of the trademark holder by Font
|
trademarks does not indicate endorsement of the trademark holder by Font
|
||||||
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
|
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
|
||||||
|
|
16
src/glyphs/font-awesome/README.md
Normal file
16
src/glyphs/font-awesome/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Font Awesome
|
||||||
|
|
||||||
|
For more information have a look at the upstream website: https://github.com/FortAwesome/Font-Awesome
|
||||||
|
|
||||||
|
## Custom created font file
|
||||||
|
|
||||||
|
The `FontAwesome.otf` here is custom created from the Font Awesome release svgs.
|
||||||
|
|
||||||
|
It does NOT contain all icons from 6.5.1!
|
||||||
|
|
||||||
|
The helper scripts need to be called in this order (note the individual prerequisites):
|
||||||
|
* `remix`
|
||||||
|
* `analyze`
|
||||||
|
* `generate`
|
||||||
|
|
||||||
|
Version: 6.5.1.custom
|
92
src/glyphs/font-awesome/analyze
Executable file
92
src/glyphs/font-awesome/analyze
Executable file
|
@ -0,0 +1,92 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# coding=utf8
|
||||||
|
|
||||||
|
# Create the final mapping file by combining the information from
|
||||||
|
# the remix_mapping (which holds already the codepoints and file names
|
||||||
|
# and that relation will not be changed) and the names of the
|
||||||
|
# current (previous) Font Awesome Nerd Font mapping (from the
|
||||||
|
# glyphnames.json file).
|
||||||
|
# In pinciple this script just adds more names to the remix_mapping.
|
||||||
|
|
||||||
|
# PREREQUISITES: Have remix_mapping file (generated with script remix)
|
||||||
|
# $ ./analyze > mapping
|
||||||
|
|
||||||
|
import re, sys
|
||||||
|
from subprocess import run
|
||||||
|
|
||||||
|
def collect_jq_names_for_one_codepoint(point, exclude, excludes):
|
||||||
|
global jq_names
|
||||||
|
ret = []
|
||||||
|
for n in jq_names:
|
||||||
|
if int(point, 16) in jq_names[n]:
|
||||||
|
ret.append(n)
|
||||||
|
if exclude in ret:
|
||||||
|
ret.remove(exclude)
|
||||||
|
for x in excludes:
|
||||||
|
if x in ret:
|
||||||
|
ret.remove(x)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
# print('Reading previous name-to-codepoint table (slow slow)')
|
||||||
|
jq_names = {}
|
||||||
|
for point in range(0xF000, 0xF300):
|
||||||
|
result = run([ 'jq', '-r',
|
||||||
|
'to_entries[] | select(.value.code == "{:04x}") | .key'.format(point),
|
||||||
|
'../../../glyphnames.json' ],
|
||||||
|
capture_output=True)
|
||||||
|
if result.returncode != 0:
|
||||||
|
sys.exit('Error fetching old names')
|
||||||
|
lines = result.stdout.decode("utf-8").split()
|
||||||
|
for n in lines:
|
||||||
|
if not n.startswith('fa-'):
|
||||||
|
print('WRONG START:', n)
|
||||||
|
sys.exit(1)
|
||||||
|
n = n[3:]
|
||||||
|
if n not in jq_names:
|
||||||
|
jq_names[n] = set([point])
|
||||||
|
else:
|
||||||
|
jq_names[n].add(point)
|
||||||
|
print('DOUBLE ENTRY:', n)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# print('Reading remix_mapping file')
|
||||||
|
remix_mapping = []
|
||||||
|
with open('remix_mapping', 'r') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
if line.startswith('#'):
|
||||||
|
continue
|
||||||
|
remix_mapping.append(tuple(re.split(' +', line.strip())))
|
||||||
|
|
||||||
|
notes = ''
|
||||||
|
unique_names = set()
|
||||||
|
clashed_names = set()
|
||||||
|
for orig_point, dest_point, filename, name in remix_mapping:
|
||||||
|
if name in jq_names:
|
||||||
|
codepointstring = '{:04X}'.format(list(jq_names[name])[0])
|
||||||
|
if codepointstring != dest_point:
|
||||||
|
for _, p, fn, nn in remix_mapping:
|
||||||
|
if codepointstring == p:
|
||||||
|
notes += '# Name clash: name: {}, old: {}, new: {} ({}), name at old pos: {}\n'.format(
|
||||||
|
name, codepointstring, dest_point, orig_point, nn)
|
||||||
|
clashed_names.add(name)
|
||||||
|
break
|
||||||
|
|
||||||
|
print('# Font Awesome mapping file')
|
||||||
|
print('#')
|
||||||
|
print('# FA-code NF-code filename name...')
|
||||||
|
print('#')
|
||||||
|
|
||||||
|
|
||||||
|
remix_mapping.sort(key=(lambda x: x[1]))
|
||||||
|
for orig_point, dest_point, filename, name in remix_mapping:
|
||||||
|
all_names = [ name ] + list(set(collect_jq_names_for_one_codepoint(dest_point, name, clashed_names)))
|
||||||
|
for n in all_names:
|
||||||
|
if n not in unique_names:
|
||||||
|
unique_names.add(n)
|
||||||
|
continue
|
||||||
|
print("ERROR name duplicate found: ", n)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print("{} {} {} {}".format(orig_point, dest_point, filename, ' '.join(all_names)))
|
||||||
|
|
||||||
|
print(notes)
|
109
src/glyphs/font-awesome/generate
Executable file
109
src/glyphs/font-awesome/generate
Executable file
|
@ -0,0 +1,109 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# coding=utf8
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import fontforge
|
||||||
|
|
||||||
|
# Double-quotes required here, for version-bump.sh:
|
||||||
|
# version-bump.sh is not working here, need to adjust manually!
|
||||||
|
version = "3.2.0"
|
||||||
|
|
||||||
|
fa_version = '6.5.1'
|
||||||
|
archive = 'fontawesome-free-{}-desktop.zip'.format(fa_version)
|
||||||
|
|
||||||
|
vectorsdir = 'svgs'
|
||||||
|
fontdir = '.'
|
||||||
|
fontfile = 'FontAwesome.otf'
|
||||||
|
glyphsetfile = 'i_fa.sh'
|
||||||
|
glyphsetsdir = '../../../bin/scripts/lib'
|
||||||
|
|
||||||
|
def addIcon(codepoint, name, filename):
|
||||||
|
""" Add one outline file and rescale/move """
|
||||||
|
filename = os.path.join(vectorsdir, filename)
|
||||||
|
glyph = font.createChar(codepoint, name)
|
||||||
|
glyph.importOutlines(filename)
|
||||||
|
xmin, ymin, xmax, ymax = glyph.boundingBox()
|
||||||
|
glyph.width = int(xmax + xmin) # make left and right bearings equal
|
||||||
|
glyph.manualHints = True
|
||||||
|
|
||||||
|
def createGlyphInfo(icon_datasets, filepathname, into):
|
||||||
|
""" Write the glyphinfo file """
|
||||||
|
with open(filepathname, 'w', encoding = 'utf8') as f:
|
||||||
|
f.write(u'#!/usr/bin/env bash\n')
|
||||||
|
f.write(intro)
|
||||||
|
f.write(u'# Script Version: (autogenerated)\n')
|
||||||
|
f.write(u'test -n "$__i_fa_loaded" && return || __i_fa_loaded=1\n')
|
||||||
|
for _, codepoint, _, *name in icon_datasets:
|
||||||
|
codepoint = int(codepoint, 16)
|
||||||
|
f.write(u"i='{}' i_fa_{}=$i\n".format(chr(codepoint), name[0]))
|
||||||
|
for more_names in name[1:]:
|
||||||
|
f.write(u" i_fa_{}=$i\n".format(more_names))
|
||||||
|
f.write(u'unset i\n')
|
||||||
|
|
||||||
|
print('\nReading mapping file')
|
||||||
|
mapping = []
|
||||||
|
with open('mapping', 'r') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
line = line.strip()
|
||||||
|
if line.startswith('#') or len(line) < 1:
|
||||||
|
continue
|
||||||
|
mapping.append(tuple(re.split(' +', line.strip())))
|
||||||
|
print('Found {} entries'.format(len(mapping)))
|
||||||
|
mapping.sort(key=(lambda x: x[1]))
|
||||||
|
|
||||||
|
print('Fetching Font Awesome archive "{}"\n'.format(archive))
|
||||||
|
if subprocess.call('curl -OL https://github.com/FortAwesome/Font-Awesome/releases/download/' + fa_version + '/' + archive, shell=True):
|
||||||
|
sys.exit('Error fetching Font Awesome archive')
|
||||||
|
print('\nUnpacking Font Awesome archive')
|
||||||
|
if subprocess.call('rm -rf svgs fontawesome-free-*-desktop && unzip -q *.zip && mv fontawesome-free-*-desktop/svgs . && rm -rf fontawesome-free-*-desktop.zip', shell=True):
|
||||||
|
sys.exit('Error unpacking archive')
|
||||||
|
|
||||||
|
svg_dirs = os.listdir(vectorsdir)
|
||||||
|
svgs = []
|
||||||
|
for d in svg_dirs:
|
||||||
|
svgs += os.listdir(vectorsdir + '/' + d)
|
||||||
|
print('Found {} svgs'.format(len(svgs)))
|
||||||
|
|
||||||
|
font = fontforge.font()
|
||||||
|
font.fontname = 'FA-NerdFont-Regular'
|
||||||
|
font.fullname = 'FA Nerd Font Regular'
|
||||||
|
font.familyname = 'FA Nerd Font'
|
||||||
|
font.ascent = 1000
|
||||||
|
font.descent = 200
|
||||||
|
font.encoding = 'UnicodeFull'
|
||||||
|
|
||||||
|
# Add valid space glyph to avoid "unknown character" box on IE11
|
||||||
|
glyph = font.createChar(32)
|
||||||
|
glyph.width = 200
|
||||||
|
|
||||||
|
font.sfntRevision = None # Auto-set (refreshed) by fontforge
|
||||||
|
font.version = version
|
||||||
|
font.copyright = 'Fonticons, Inc'
|
||||||
|
font.appendSFNTName('English (US)', 'Version', archive + '; ' + version)
|
||||||
|
font.appendSFNTName('English (US)', 'Vendor URL', 'https://github.com/ryanoasis/nerd-fonts')
|
||||||
|
font.appendSFNTName('English (US)', 'Copyright', 'Fonticons, Inc')
|
||||||
|
|
||||||
|
for _, codepoint, file, *names in mapping:
|
||||||
|
codepoint = int(codepoint, 16)
|
||||||
|
addIcon(codepoint, names[0], file)
|
||||||
|
|
||||||
|
num_icons = len(mapping)
|
||||||
|
|
||||||
|
print('Generating {} with {} glyphs'.format(fontfile, num_icons))
|
||||||
|
font.ascent = 1000
|
||||||
|
font.descent = 200
|
||||||
|
font.generate(os.path.join(fontdir, fontfile), flags=("no-FFTM-table",))
|
||||||
|
|
||||||
|
codepoints = [ int(p, 16) for _, p, *_ in mapping ]
|
||||||
|
aliases = [ len(n) - 1 for _, _, _, *n in mapping ]
|
||||||
|
intro = u'# Font Awesome (version {}, {} icons, {} aliases)\n'.format(fa_version, num_icons, sum(aliases))
|
||||||
|
intro += u'# Does not include all icons of the release\n'
|
||||||
|
intro += u'# Codepoints: {:X}-{:X} with gaps\n'.format(min(codepoints), max(codepoints))
|
||||||
|
intro += u'# Nerd Fonts Version: {}\n'.format(version)
|
||||||
|
|
||||||
|
print('Generating GlyphInfo {}'.format(glyphsetfile))
|
||||||
|
createGlyphInfo(mapping, os.path.join(glyphsetsdir, glyphsetfile), intro)
|
||||||
|
print('Finished')
|
1489
src/glyphs/font-awesome/mapping
Normal file
1489
src/glyphs/font-awesome/mapping
Normal file
File diff suppressed because it is too large
Load diff
237
src/glyphs/font-awesome/remix
Executable file
237
src/glyphs/font-awesome/remix
Executable file
|
@ -0,0 +1,237 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# coding=utf8
|
||||||
|
|
||||||
|
# Create a mapping file by combining the three free Font Awesome release
|
||||||
|
# fonts and tries to keep the codepoints for old version 4.2 icons.
|
||||||
|
# Newer icons are used to fill gaps and afterwards fill the new
|
||||||
|
# range in Nerd Fonts of ED00-EFFF.
|
||||||
|
#
|
||||||
|
# Range A is F000 - F2FF, the 'original' codepoint range of FA in Nerd Fonts
|
||||||
|
# Range B is F300 - F8FF, icons added to FA after 4.2
|
||||||
|
# Range C is E000 - EFFF, more icons added to FA after 4.2
|
||||||
|
|
||||||
|
# PREREQUISITES: Download Font Awesome release
|
||||||
|
# $ curl -OL https://github.com/FortAwesome/Font-Awesome/releases/download/6.5.1/fontawesome-free-6.5.1-desktop.zip
|
||||||
|
# $ unzip fontawesome-free-6.5.1-desktop.zip
|
||||||
|
# $ cd fontawesome-free-6.5.1-desktop/otfs
|
||||||
|
# $ fontforge ../../remix > ../../remix_mapping
|
||||||
|
#
|
||||||
|
# We do not use the font file generated by this script
|
||||||
|
|
||||||
|
import fontforge, os, sys
|
||||||
|
|
||||||
|
def find_destination(codepoint, font):
|
||||||
|
global swap_codes
|
||||||
|
for change in swap_codes:
|
||||||
|
if codepoint not in change:
|
||||||
|
continue
|
||||||
|
if codepoint == change[0]:
|
||||||
|
codepoint = change[1]
|
||||||
|
else:
|
||||||
|
codepoint = change[0]
|
||||||
|
break
|
||||||
|
|
||||||
|
if codepoint >= 0xF000 and codepoint < 0xF300:
|
||||||
|
# Keep codepoints in legacy region 'Region A'
|
||||||
|
return codepoint
|
||||||
|
if codepoint < 0xF000:
|
||||||
|
# Do not include any from 'Region C'
|
||||||
|
return None
|
||||||
|
# Fill gaps with the remaing icons (i.e. 'Region B')
|
||||||
|
# That will target first the original FA codepoint range in NF (F000-F2FF)
|
||||||
|
# and if that is full use the additional range ED00-EFFF
|
||||||
|
# The subrange 0xEE00 - 0xEE0B is reserved for Fira Code progress icons
|
||||||
|
for point in [ *range(0xF000, 0xF300), *range(0xED00, 0xEE00), *range(0xEE0C, 0xF000) ]:
|
||||||
|
if point not in font:
|
||||||
|
return point
|
||||||
|
print("No space found - abort")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
class Sources:
|
||||||
|
def __init__(self):
|
||||||
|
self.regul = fontforge.open('Font Awesome 6 Free-Regular-400.otf')
|
||||||
|
self.solid = fontforge.open('Font Awesome 6 Free-Solid-900.otf')
|
||||||
|
self.brand = fontforge.open('Font Awesome 6 Brands-Regular-400.otf')
|
||||||
|
self.regul.encoding = 'UnicodeFull'
|
||||||
|
self.solid.encoding = 'UnicodeFull'
|
||||||
|
self.brand.encoding = 'UnicodeFull'
|
||||||
|
|
||||||
|
sources = Sources()
|
||||||
|
compo = fontforge.font()
|
||||||
|
compo.encoding = 'UnicodeFull'
|
||||||
|
|
||||||
|
names = {}
|
||||||
|
|
||||||
|
count0 = 0
|
||||||
|
count1 = 0
|
||||||
|
count2 = 0
|
||||||
|
count3 = 0
|
||||||
|
count4 = 0
|
||||||
|
|
||||||
|
# To solve some new names and keep old naming intact
|
||||||
|
renames = {
|
||||||
|
0xF003: 'envelope_o',
|
||||||
|
0xF006: 'star_o',
|
||||||
|
0xF046: 'check_square_o',
|
||||||
|
0xF057: 'remove_sign',
|
||||||
|
0xF058: 'ok_sign',
|
||||||
|
0xF087: 'thumbs_o_up',
|
||||||
|
0xF088: 'thumbs_o_down',
|
||||||
|
0xF016: 'file_o',
|
||||||
|
0xF01D: 'play_circle_o',
|
||||||
|
0xF045: 'share_square_o',
|
||||||
|
0xF087: 'thumbs_o_up',
|
||||||
|
0xF088: 'thumbs_o_down',
|
||||||
|
0xF08A: 'heard_o',
|
||||||
|
0xF08C: 'linkedin_square',
|
||||||
|
0xF096: 'square_o',
|
||||||
|
0xF097: 'bookmark_o',
|
||||||
|
0xF0A2: 'bell_o',
|
||||||
|
0xF0D5: 'google_plus',
|
||||||
|
0xF0E5: 'comment_o',
|
||||||
|
0xF0E6: 'comments_o',
|
||||||
|
0xF0F6: 'file_text_o',
|
||||||
|
0xF0F7: 'building_o',
|
||||||
|
0xF10C: 'circle_o',
|
||||||
|
0xF114: 'folder_o',
|
||||||
|
0xF115: 'folder_open_o',
|
||||||
|
0xF11D: 'flag_o',
|
||||||
|
0xF123: 'star_half_o',
|
||||||
|
0xF133: 'calendar_o',
|
||||||
|
0xF147: 'minus_square_o',
|
||||||
|
0xF196: 'plus_square_o',
|
||||||
|
0xF1D9: 'paper_plane_o',
|
||||||
|
0xF1DB: 'circle_thin',
|
||||||
|
0xF1F7: 'bell_slash_o',
|
||||||
|
0xF224: 'transgender',
|
||||||
|
0xF225: 'transgender_alt',
|
||||||
|
0xF24A: 'sticky_note_o',
|
||||||
|
0xF250: 'hourglass_o',
|
||||||
|
0xF278: 'map_o',
|
||||||
|
0xF283: 'credit_card_alt',
|
||||||
|
0xF28C: 'pause_circle_o',
|
||||||
|
0xF28E: 'stop_circle_o',
|
||||||
|
0xF29C: 'question_circle_o',
|
||||||
|
0xF2B3: 'google_plus_circle',
|
||||||
|
0xF2B7: 'envelope_open_o',
|
||||||
|
0xF2BA: 'address_book_o',
|
||||||
|
0xF2BC: 'address_card_o',
|
||||||
|
0xF2BE: 'user_circle_o',
|
||||||
|
0xF2C0: 'user_o',
|
||||||
|
0xF2C3: 'id_card_o',
|
||||||
|
0xf328: 'clipboard_alt',
|
||||||
|
0xF363: 'repeat_alt',
|
||||||
|
0xF491: 'thermometer_alt',
|
||||||
|
0xF594: 'hotel_building',
|
||||||
|
}
|
||||||
|
|
||||||
|
# If Regular and Solid have a specific icon we prefer Regular, except for these:
|
||||||
|
prefer_solid = {
|
||||||
|
0xF004, 0xF007, 0xF005, 0xF024, 0xF02E,
|
||||||
|
0xF057, 0xF058, 0xF059, 0xF075, 0xF07B,
|
||||||
|
0xF07C, 0xF086, 0xF089, 0xF0C8, 0xF0EA,
|
||||||
|
0xF0FE, 0xF146, 0xF14C, 0xF1D8, 0xF1F6,
|
||||||
|
0xF249, 0xF27A, 0xF28B, 0xF28D, 0xF2B4,
|
||||||
|
0xF2B6, 0xF2B9, 0xF2BB, 0xF2BD, 0xF2C2,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Special handling of some few icons, see PR #1596
|
||||||
|
move_or_drop = { 0xF30B: False, 0xF30C: False, 0xF374: True,
|
||||||
|
0xF536: True, 0xF537: True, 0xF538: True, 0xF539: True, 0xF53A: True, 0xF53B: True, # move for progress icons
|
||||||
|
0xF53C: True, 0xF53D: True, 0xF53E: True, 0xF53F: True, 0xF540: True, 0xF542: True, # move for progress icons
|
||||||
|
0xF219: 0xF3A5, 0xF10A: 0xF3FA, 0xF10B: 0xF3CD, }
|
||||||
|
swap_codes = [ (0xF167, 0xF16A), (0xF219, 0xF3A5), (0xF10A, 0xF3FA), (0xF10B, 0xF3CD), ]
|
||||||
|
|
||||||
|
block_regular = set()
|
||||||
|
|
||||||
|
print('# Intermediate mapping file')
|
||||||
|
print('#')
|
||||||
|
print('# FA-code NF-code filename FA-name')
|
||||||
|
print('#')
|
||||||
|
|
||||||
|
# Reorder processing to accomodate for glyph shifts introduced
|
||||||
|
all_points = [ *range(0xF000, 0xF900), *range(0xE000, 0xF000) ]
|
||||||
|
for code, move in move_or_drop.items():
|
||||||
|
if not isinstance(move, bool):
|
||||||
|
i1 = all_points.index(code)
|
||||||
|
i2 = all_points.index(move)
|
||||||
|
all_points[i1] = move
|
||||||
|
all_points[i2] = code
|
||||||
|
continue
|
||||||
|
all_points.remove(code)
|
||||||
|
if move:
|
||||||
|
all_points.append(code)
|
||||||
|
|
||||||
|
for point in all_points:
|
||||||
|
source = None
|
||||||
|
subset = 'none'
|
||||||
|
if point in sources.regul and point not in block_regular and point not in prefer_solid:
|
||||||
|
source = sources.regul
|
||||||
|
subset = 'regular'
|
||||||
|
# Dont add the same icon multiple times
|
||||||
|
altuni = source[point].altuni
|
||||||
|
if altuni:
|
||||||
|
for i, _, _ in altuni:
|
||||||
|
if i != 0xf1db: # Allow circle to be used twice
|
||||||
|
block_regular.add(i)
|
||||||
|
elif point in sources.solid:
|
||||||
|
source = sources.solid
|
||||||
|
subset = 'solid'
|
||||||
|
elif point in sources.brand:
|
||||||
|
source = sources.brand
|
||||||
|
subset = 'brands'
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
|
glyphname = source[point].glyphname.replace('-', '_')
|
||||||
|
if point in renames:
|
||||||
|
old_glyphname = glyphname
|
||||||
|
glyphname = renames[point]
|
||||||
|
print('# RENAME {} to {}'.format(old_glyphname, glyphname))
|
||||||
|
|
||||||
|
if glyphname in names:
|
||||||
|
# Assume same glyphname means same icon
|
||||||
|
# print('{:04X} {} dropped, (already in {:0X})'.format(point, glyphname, names[glyphname]))
|
||||||
|
count0 += 1
|
||||||
|
continue
|
||||||
|
names[glyphname] = point
|
||||||
|
|
||||||
|
source.selection.select(point)
|
||||||
|
destpoint = find_destination(point, compo)
|
||||||
|
if destpoint is None:
|
||||||
|
destpoint = 0
|
||||||
|
count1 += 1
|
||||||
|
else:
|
||||||
|
compo.selection.select(destpoint)
|
||||||
|
source.copy()
|
||||||
|
compo.paste()
|
||||||
|
compo[destpoint].glyphname = glyphname
|
||||||
|
compo[destpoint].manualHints = True
|
||||||
|
|
||||||
|
if not os.path.exists('../svgs/' + subset + '/' + source[point].glyphname + '.svg'):
|
||||||
|
if os.path.exists('../svgs/' + 'solid' + '/' + source[point].glyphname + '.svg'):
|
||||||
|
# Some glyphs originate from Solid but are also in Regular
|
||||||
|
subset = 'solid'
|
||||||
|
else:
|
||||||
|
print('Missing SVG "{}" - abort'.format(source[point].glyphname))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print('{}{:04X} {:04X} {}/{}.svg {}'.format('' if destpoint != 0 else '# ', point, destpoint, subset, source[point].glyphname, glyphname))
|
||||||
|
if destpoint != 0:
|
||||||
|
if point < 0xF000:
|
||||||
|
count4 += 1
|
||||||
|
elif point < 0xF300:
|
||||||
|
count2 += 1
|
||||||
|
else:
|
||||||
|
count3 += 1
|
||||||
|
|
||||||
|
print('# Summary')
|
||||||
|
print('# - Duplicates {}'.format(count0))
|
||||||
|
print('# - Dropped {}'.format(count1))
|
||||||
|
print('# - From original range {} (0x{:X})'.format(count2, count2))
|
||||||
|
print('# - From extended F0 range {} (0x{:X})'.format(count3, count3))
|
||||||
|
print('# - From E0 range {} (0x{:X})'.format(count4, count4))
|
||||||
|
|
||||||
|
# print('\nGenerating...')
|
||||||
|
# compo.generate('FontAwesomeNew.otf')
|
1937
src/glyphs/font-awesome/remix_mapping
Normal file
1937
src/glyphs/font-awesome/remix_mapping
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -21,3 +21,11 @@ Open old and new definitions shell script and copy the header from the old file
|
||||||
Glyph 0xF1522 is broken in the original font. We fixed that one glyph manually.
|
Glyph 0xF1522 is broken in the original font. We fixed that one glyph manually.
|
||||||
|
|
||||||
See https://github.com/Templarian/MaterialDesign-Font/issues/9
|
See https://github.com/Templarian/MaterialDesign-Font/issues/9
|
||||||
|
|
||||||
|
## Old version
|
||||||
|
|
||||||
|
Also contained is the old (pre Nerd Fonts v3.0.0) Material Design Icons:
|
||||||
|
|
||||||
|
`materialdesignicons-webfont.ttf`
|
||||||
|
|
||||||
|
That is not used, but can be activated by users of the font-patcher by enabling the font in the sourcecode.
|
||||||
|
|
BIN
src/glyphs/materialdesign/materialdesignicons-webfont.ttf
Normal file
BIN
src/glyphs/materialdesign/materialdesignicons-webfont.ttf
Normal file
Binary file not shown.
94
src/glyphs/pomicons/LICENSE
Normal file
94
src/glyphs/pomicons/LICENSE
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
Copyright (c) 2021, Gabriele Lana gabriele.lana@gmail.com
|
||||||
|
with Reserved Font Name Pomicons.
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
src/glyphs/pomicons/Pomicons.otf
Normal file
BIN
src/glyphs/pomicons/Pomicons.otf
Normal file
Binary file not shown.
5
src/glyphs/pomicons/README.md
Normal file
5
src/glyphs/pomicons/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Pomicons
|
||||||
|
|
||||||
|
For more information have a look at the upstream website: https://github.com/gabrielelana/pomicons
|
||||||
|
|
||||||
|
Version: 1.001
|
Loading…
Reference in a new issue