Skip to content

Commit 141b76e

Browse files
committed
feat: apply braille patch to nerd-font-patcher
Based on ryanoasis/nerd-fonts#837
1 parent ad359a3 commit 141b76e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkgs/nerd-font-patcher/3.1.1/font-patcher

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ class font_patcher:
545545
if self.args.weather:
546546
additionalFontNameSuffix += " WEA"
547547
verboseAdditionalFontNameSuffix += " Plus Weather Icons"
548+
if self.args.braille:
549+
additionalFontNameSuffix += " B"
550+
verboseAdditionalFontNameSuffix += " Plus Braille Icons"
548551

549552
# add mono signifier to beginning of name suffix
550553
if self.args.single:
@@ -917,6 +920,10 @@ class font_patcher:
917920
0xf0dd: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}},
918921
0xf0de: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}}
919922
}
923+
SYM_ATTR_BRAILLE = {
924+
# 'pa' == preserve aspect ratio
925+
'default': {'align': 'c', 'valign': 'c', 'stretch': 'pa', 'params': {'overlap': -0.05}}
926+
}
920927
SYM_ATTR_HEAVYBRACKETS = {
921928
'default': {'align': 'c', 'valign': 'c', 'stretch': 'pa1!', 'params': {'ypadding': 0.3, 'careful': True}}
922929
}
@@ -1047,6 +1054,9 @@ class font_patcher:
10471054
# box of this range:
10481055
range(0xf000, 0xf0cb + 1), # lots of clouds and other (Please read note above!)
10491056
]}
1057+
BRAILLE_SCALE_LIST = {'ScaleGroups': [
1058+
range(0x2800, 0x28ff + 1), # all Braille glyphs
1059+
]}
10501060
MDI_SCALE_LIST = None # Maybe later add some selected ScaleGroups
10511061

10521062

@@ -1078,6 +1088,7 @@ class font_patcher:
10781088
{'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
10791089
{'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},
10801090
{'Enabled': self.args.codicons, 'Name': "Codicons", 'Filename': "codicons/codicon.ttf", 'Exact': True, 'SymStart': 0xEA60, 'SymEnd': 0xEBEB, 'SrcStart': None, 'ScaleRules': CODI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
1091+
{'Enabled': self.args.braille, 'Name': "Braille", 'Filename': "UBraille.ttf", 'Exact': True, 'SymStart': 0x2800, 'SymEnd': 0x28FF, 'SrcStart': None, 'ScaleRules': BRAILLE_SCALE_LIST, 'Attributes': SYM_ATTR_BRAILLE},
10811092
{'Enabled': self.args.custom, 'Name': "Custom", 'Filename': self.args.custom, 'Exact': True, 'SymStart': 0x0000, 'SymEnd': 0x0000, 'SrcStart': None, 'ScaleRules': None, 'Attributes': CUSTOM_ATTR}
10821093
]
10831094

@@ -1890,6 +1901,7 @@ def setup_arguments():
18901901
sym_font_group.add_argument('--powerline', dest='powerline', default=False, action='store_true', help='Add Powerline Glyphs')
18911902
sym_font_group.add_argument('--powerlineextra', dest='powerlineextra', default=False, action='store_true', help='Add Powerline Extra Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)')
18921903
sym_font_group.add_argument('--weather', dest='weather', default=False, action='store_true', help='Add Weather Icons (https://github.com/erikflowers/weather-icons)')
1904+
sym_font_group.add_argument('--braille', dest='braille', default=False, action='store_true', help='Add Braille Glyphs (https://yudit.org/download/fonts/UBraille/)')
18931905

18941906
expert_group = parser.add_argument_group('Expert Options')
18951907
expert_group.add_argument('--boxdrawing', dest='forcebox', default=False, action='store_true', help='Force patching in (over existing) box drawing glyphs')
@@ -1936,6 +1948,7 @@ def setup_arguments():
19361948
args.powerlineextra = True
19371949
args.material = True
19381950
args.weather = True
1951+
args.braille = True
19391952

19401953
if not args.complete:
19411954
sym_font_args = []
151 KB
Binary file not shown.

0 commit comments

Comments
 (0)