Skip to content

Commit de5eacf

Browse files
flexiondotorgFinii
authored andcommitted
feat: apply braille patch to nerd-font-patcher
Based on #837
1 parent 95870b8 commit de5eacf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

font-patcher

+12
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ class font_patcher:
546546
if self.args.weather:
547547
additionalFontNameSuffix += " WEA"
548548
verboseAdditionalFontNameSuffix += " Plus Weather Icons"
549+
if self.args.braille:
550+
additionalFontNameSuffix += " B"
551+
verboseAdditionalFontNameSuffix += " Plus Braille Icons"
549552

550553
# add mono signifier to beginning of name suffix
551554
if self.args.single:
@@ -943,6 +946,9 @@ class font_patcher:
943946
0xf0dd: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}},
944947
0xf0de: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}}
945948
}
949+
SYM_ATTR_BRAILLE = {
950+
'default': {'align': 'c', 'valign': 'c', 'stretch': 'pa', 'params': {'overlap': -0.05}}
951+
}
946952
SYM_ATTR_HEAVYBRACKETS = {
947953
'default': {'align': 'c', 'valign': 'c', 'stretch': '^pa1!', 'params': {'ypadding': 0.3, 'careful': True}}
948954
}
@@ -1080,6 +1086,9 @@ class font_patcher:
10801086
# box of this range:
10811087
range(0xf000, 0xf0cb + 1), # lots of clouds and other (Please read note above!)
10821088
]}
1089+
BRAILLE_SCALE_LIST = {'ScaleGroups': [
1090+
range(0x2800, 0x28ff + 1), # all Braille glyphs
1091+
]}
10831092
MDI_SCALE_LIST = None # Maybe later add some selected ScaleGroups
10841093

10851094

@@ -1111,6 +1120,7 @@ class font_patcher:
11111120
{'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
11121121
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': False, 'SymStart': 0xF27C, 'SymEnd': 0xF306, 'SrcStart': 0xF4A9, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
11131122
{'Enabled': self.args.codicons, 'Name': "Codicons", 'Filename': "codicons/codicon.ttf", 'Exact': True, 'SymStart': 0xEA60, 'SymEnd': 0xEC1E, 'SrcStart': None, 'ScaleRules': CODI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
1123+
{'Enabled': self.args.braille, 'Name': "Braille", 'Filename': "UBraille.sfd", 'Exact': True, 'SymStart': 0x2800, 'SymEnd': 0x28FF, 'SrcStart': None, 'ScaleRules': BRAILLE_SCALE_LIST, 'Attributes': SYM_ATTR_BRAILLE},
11141124
{'Enabled': self.args.custom, 'Name': "Custom", 'Filename': self.args.custom, 'Exact': True, 'SymStart': 0x0000, 'SymEnd': 0x0000, 'SrcStart': None, 'ScaleRules': None, 'Attributes': CUSTOM_ATTR}
11151125
]
11161126

@@ -1941,6 +1951,7 @@ def setup_arguments():
19411951

19421952
sym_font_group = parser.add_argument_group('Symbol Fonts')
19431953
sym_font_group.add_argument('-c', '--complete', dest='complete', default=False, action='store_true', help='Add all available Glyphs')
1954+
sym_font_group.add_argument('--braille', dest='braille', default=False, action='store_true', help='Add Braille Glyphs (https://yudit.org/download/fonts/UBraille/)')
19441955
sym_font_group.add_argument('--codicons', dest='codicons', default=False, action='store_true', help='Add Codicons Glyphs (https://github.com/microsoft/vscode-codicons)')
19451956
sym_font_group.add_argument('--fontawesome', dest='fontawesome', default=False, action='store_true', help='Add Font Awesome Glyphs (http://fontawesome.io/)')
19461957
sym_font_group.add_argument('--fontawesomeext', dest='fontawesomeextension', default=False, action='store_true', help='Add Font Awesome Extension Glyphs (https://andrelzgava.github.io/font-awesome-extension/)')
@@ -2015,6 +2026,7 @@ def setup_arguments():
20152026
args.powerlineextra = True
20162027
args.material = True
20172028
args.weather = True
2029+
args.braille = True
20182030

20192031
if not args.complete:
20202032
sym_font_args = []

0 commit comments

Comments
 (0)