Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Braille support #837

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ class font_patcher:
if self.args.weather:
additionalFontNameSuffix += " WEA"
verboseAdditionalFontNameSuffix += " Plus Weather Icons"
if self.args.braille:
additionalFontNameSuffix += " B"
verboseAdditionalFontNameSuffix += " Plus Braille Icons"

# add mono signifier to beginning of name suffix
if self.args.single:
Expand Down Expand Up @@ -943,6 +946,9 @@ class font_patcher:
0xf0dd: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}},
0xf0de: {'align': 'c', 'valign': '', 'stretch': 'pa', 'params': {}}
}
SYM_ATTR_BRAILLE = {
'default': {'align': 'c', 'valign': 'c', 'stretch': 'pa', 'params': {'overlap': -0.05}}
}
SYM_ATTR_HEAVYBRACKETS = {
'default': {'align': 'c', 'valign': 'c', 'stretch': '^pa1!', 'params': {'ypadding': 0.3, 'careful': True}}
}
Expand Down Expand Up @@ -1080,6 +1086,9 @@ class font_patcher:
# box of this range:
range(0xf000, 0xf0cb + 1), # lots of clouds and other (Please read note above!)
]}
BRAILLE_SCALE_LIST = {'ScaleGroups': [
range(0x2800, 0x28ff + 1), # all Braille glyphs
]}
MDI_SCALE_LIST = None # Maybe later add some selected ScaleGroups


Expand Down Expand Up @@ -1111,6 +1120,7 @@ class font_patcher:
{'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': False, 'SymStart': 0xF27C, 'SymEnd': 0xF306, 'SrcStart': 0xF4A9, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
{'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},
{'Enabled': self.args.braille, 'Name': "Braille", 'Filename': "braille-cc0-font/BrailleCc0-DOeDd.ttf", 'Exact': True, 'SymStart': 0x2800, 'SymEnd': 0x28FF, 'SrcStart': None, 'ScaleRules': BRAILLE_SCALE_LIST, 'Attributes': SYM_ATTR_BRAILLE},
{'Enabled': self.args.custom, 'Name': "Custom", 'Filename': self.args.custom, 'Exact': True, 'SymStart': 0x0000, 'SymEnd': 0x0000, 'SrcStart': None, 'ScaleRules': None, 'Attributes': CUSTOM_ATTR}
]

Expand Down Expand Up @@ -1941,6 +1951,7 @@ def setup_arguments():

sym_font_group = parser.add_argument_group('Symbol Fonts')
sym_font_group.add_argument('-c', '--complete', dest='complete', default=False, action='store_true', help='Add all available Glyphs')
sym_font_group.add_argument('--braille', dest='braille', default=False, action='store_true', help='Add Braille Glyphs')
sym_font_group.add_argument('--codicons', dest='codicons', default=False, action='store_true', help='Add Codicons Glyphs (https://github.com/microsoft/vscode-codicons)')
sym_font_group.add_argument('--fontawesome', dest='fontawesome', default=False, action='store_true', help='Add Font Awesome Glyphs (http://fontawesome.io/)')
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/)')
Expand Down Expand Up @@ -2015,6 +2026,7 @@ def setup_arguments():
args.powerlineextra = True
args.material = True
args.weather = True
args.braille = True

if not args.complete:
sym_font_args = []
Expand Down
1 change: 1 addition & 0 deletions license-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All files created such as `font-patcher` and any `ph` or `sh` script/source file

| Project | License |
| ------------------------------------------------ | ----------------|
| Braille | CC0 1.0 |
| Codicons | CC BY 4.0 |
| Devicons | MIT |
| Font Awesome | CC BY 4.0 |
Expand Down
Binary file added src/glyphs/braille-cc0-font/BrailleCc0-DOeDd.ttf
Binary file not shown.
2 changes: 2 additions & 0 deletions src/glyphs/braille-cc0-font/info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license: Public Domain
link: https://www.fontspace.com/braille-cc0-font-f96789
Loading