mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-25 03:32:02 +02:00
Updates patcher and readme with the new options and glyph sets
This commit is contained in:
parent
30d306216b
commit
53756eb842
24
font-patcher
24
font-patcher
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python2
|
||||
# coding=utf8
|
||||
# version: 0.8.0
|
||||
# version: 0.9.0
|
||||
|
||||
version = "0.8.0"
|
||||
version = "0.9.0"
|
||||
projectName = "Nerd Fonts"
|
||||
projectNameAbbreviation = "NF"
|
||||
projectNameSingular = projectName[:-1]
|
||||
@ -38,8 +38,10 @@ parser.add_argument('-q', '--quiet', '--shutup', dest='quiet', action='store_tru
|
||||
parser.add_argument('-w', '--windows', '--limit-font-name-length', dest='windows', action='store_true', help='Limit the internal font name to 31 characters (for Windows compatibility)', default=False)
|
||||
parser.add_argument('-c', '--complete', dest='complete', action='store_true', help='Add all available Glyphs', default=False)
|
||||
parser.add_argument('--fontawesome', dest='fontawesome', action='store_true', help='Add Font Awesome Glyphs (http://fortawesome.github.io/Font-Awesome)', default=False)
|
||||
parser.add_argument('--fontawesomeextension', dest='fontawesomeextension', action='store_true', help='Add Font Awesome Extension Glyphs (http://andrelgava.github.io/font-awesome-extension)', default=False)
|
||||
parser.add_argument('--fontlinux', dest='fontlinux', action='store_true', help='Add Font Linux Glyphs (https://github.com/Lukas-W/font-linux)', default=False)
|
||||
parser.add_argument('--octicons', dest='octicons', action='store_true', help='Add Octicons Glyphs (https://octicons.github.com)', default=False)
|
||||
parser.add_argument('--powersymbols', dest='powersymbols', action='store_true', help='Add IEC Power Symbols (http://unicodepowersymbol.com)', default=False)
|
||||
parser.add_argument('--pomicons', dest='pomicons', action='store_true', help='Add Pomicon Glyphs (https://github.com/gabrielelana/pomicons)', default=False)
|
||||
parser.add_argument('--powerline', dest='powerline', action='store_true', help='Add Powerline Glyphs', default=False)
|
||||
parser.add_argument('--powerlineextra', dest='powerlineextra', action='store_true', help='Add Powerline Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)', default=False)
|
||||
@ -64,8 +66,10 @@ verboseAdditionalFontNameSuffix = " " + projectNameSingular
|
||||
|
||||
if args.complete:
|
||||
args.fontawesome = True
|
||||
args.fontawesomeextension = True
|
||||
args.fontlinux = True
|
||||
args.octicons = True
|
||||
args.powersymbols = True
|
||||
args.pomicons = True
|
||||
args.powerline = True
|
||||
args.powerlineextra = True
|
||||
@ -80,10 +84,18 @@ if args.fontawesome:
|
||||
additionalFontNameSuffix += " A"
|
||||
verboseAdditionalFontNameSuffix += " Plus Font Awesome"
|
||||
|
||||
if args.fontawesomeextension:
|
||||
additionalFontNameSuffix += " AE"
|
||||
verboseAdditionalFontNameSuffix += " Plus Font Awesome Extension"
|
||||
|
||||
if args.octicons:
|
||||
additionalFontNameSuffix += " O"
|
||||
verboseAdditionalFontNameSuffix += " Plus Octicons"
|
||||
|
||||
if args.powersymbols:
|
||||
additionalFontNameSuffix += " PS"
|
||||
verboseAdditionalFontNameSuffix += " Plus Power Symbols"
|
||||
|
||||
if args.pomicons:
|
||||
additionalFontNameSuffix += " P"
|
||||
verboseAdditionalFontNameSuffix += " Plus Pomicons"
|
||||
@ -93,7 +105,7 @@ if args.fontlinux:
|
||||
verboseAdditionalFontNameSuffix += " Plus Font Linux"
|
||||
|
||||
# if all source glyphs included simplify the name
|
||||
if args.fontawesome and args.octicons and args.pomicons and args.powerlineextra and args.fontlinux:
|
||||
if args.fontawesome and args.fontawesomeextra and args.octicons and args.powersymbols and args.pomicons and args.powerlineextra and args.fontlinux:
|
||||
additionalFontNameSuffix = " " + projectNameSingular + " C"
|
||||
verboseAdditionalFontNameSuffix = " " + projectNameSingular + " Complete"
|
||||
|
||||
@ -288,8 +300,14 @@ PATCH_SET = [
|
||||
{ 'Enabled': args.powerlineextra, 'Filename': "PowerlineExtraSymbols.otf",'Exact': True, 'SymStart': 0xE0CC, 'SymEnd': 0xE0D4, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_POWERLINE },
|
||||
{ 'Enabled': args.pomicons, 'Filename': "Pomicons.otf", 'Exact': True, 'SymStart': 0xE000, 'SymEnd': 0xE00A, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT },
|
||||
{ 'Enabled': args.fontawesome, 'Filename': "FontAwesome.otf", 'Exact': True, 'SymStart': 0xF000, 'SymEnd': 0xF295, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': 0xF17A,'Attributes': SYM_ATTR_DEFAULT }, # Windows logo
|
||||
{ 'Enabled': args.fontawesomeextension, 'Filename': "font-awesome-extension.ttf", 'Exact': False, 'SymStart': 0xE000, 'SymEnd': 0xE0A9, 'SrcStart': 0xE200, 'SrcEnd': 0xE2A9, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT },
|
||||
{ 'Enabled': args.fontlinux, 'Filename': "font-linux.ttf", 'Exact': fontlinuxExactEncodingPosition, 'SymStart': 0xF100, 'SymEnd': 0xF115, 'SrcStart': 0xF300, 'SrcEnd': 0xF315, 'ScaleGlyph': 0xF10E, 'Attributes': SYM_ATTR_DEFAULT }, # Ubuntu logo
|
||||
{ 'Enabled': args.pomicons, 'Filename': "Unicode_IEC_symbol_font.otf", 'Exact': True, 'SymStart': 0x23FB, 'SymEnd': 0x23FE, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT }, # Power, Power On/Off, Power On, Sleep
|
||||
{ 'Enabled': args.pomicons, 'Filename': "Unicode_IEC_symbol_font.otf", 'Exact': True, 'SymStart': 0x2B58, 'SymEnd': 0x2B58, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT }, # Heavy Circle (aka Power Off)
|
||||
{ 'Enabled': args.octicons, 'Filename': "octicons.ttf", 'Exact': octiconsExactEncodingPosition, 'SymStart': 0xF000, 'SymEnd': 0xF0DB, 'SrcStart': 0xF400, 'SrcEnd': 0xF4DB, 'ScaleGlyph': 0xF02E, 'Attributes': SYM_ATTR_DEFAULT }, # Magnifying glass
|
||||
{ 'Enabled': args.octicons, 'Filename': "octicons.ttf", 'Exact': True, 'SymStart': 0x2665, 'SymEnd': 0x2665, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT }, # Heart
|
||||
{ 'Enabled': args.octicons, 'Filename': "octicons.ttf", 'Exact': True, 'SymStart': 0X26A1, 'SymEnd': 0X26A1, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT }, # Zap
|
||||
{ 'Enabled': args.octicons, 'Filename': "octicons.ttf", 'Exact': True, 'SymStart': 0xF27C, 'SymEnd': 0xF27C, 'SrcStart': None, 'SrcEnd': None, 'ScaleGlyph': None, 'Attributes': SYM_ATTR_DEFAULT }, # Desktop
|
||||
]
|
||||
|
||||
# win_ascent and win_descent are used to set the line height for windows fonts.
|
||||
|
35
readme.md
35
readme.md
@ -240,17 +240,18 @@ Patching the font of your own choosing for use with the [vim-devicons](https://g
|
||||
|
||||
|
||||
```
|
||||
usage: font-patcher [-h] [-v] [-s] [-q] [-w] [--fontawesome] [--fontlinux]
|
||||
[--octicons] [--pomicons] [--powerline] [--powerlineextra]
|
||||
[--careful] [-out [OUTPUTDIR]]
|
||||
usage: font-patcher [-h] [-v] [-s] [-q] [-w] [-c] [--fontawesome]
|
||||
[--fontawesomeextension] [--fontlinux] [--octicons]
|
||||
[--powersymbols] [--pomicons] [--powerline]
|
||||
[--powerlineextra] [--careful] [-ext [EXTENSION]]
|
||||
[-out [OUTPUTDIR]]
|
||||
font
|
||||
|
||||
Patches a given font with programming and web development related glyphs
|
||||
(mainly for https://github.com/ryanoasis/vim-devicons)
|
||||
|
||||
positional arguments:
|
||||
font The path to the font to be patched (e.g.
|
||||
Inconsolata.otf)
|
||||
font The path to the font to patch (e.g., Inconsolata.otf)
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
@ -261,19 +262,26 @@ optional arguments:
|
||||
-q, --quiet, --shutup
|
||||
Do not generate verbose output
|
||||
-w, --windows, --limit-font-name-length
|
||||
Limit the internal font name to a maximum of 31
|
||||
characters (for safe Windows compatiblity)
|
||||
Limit the internal font name to 31 characters (for
|
||||
Windows compatibility)
|
||||
-c, --complete Add all available Glyphs
|
||||
--fontawesome Add Font Awesome Glyphs (http://fortawesome.github.io
|
||||
/Font-Awesome)
|
||||
--fontawesomeextension
|
||||
Add Font Awesome Extension Glyphs
|
||||
(http://andrelgava.github.io/font-awesome-extension)
|
||||
--fontlinux Add Font Linux Glyphs (https://github.com/Lukas-W
|
||||
/font-linux)
|
||||
--octicons Add Octicons Glyphs (https://octicons.github.com)
|
||||
--powersymbols Add IEC Power Symbols (http://unicodepowersymbol.com)
|
||||
--pomicons Add Pomicon Glyphs
|
||||
(https://github.com/gabrielelana/pomicons)
|
||||
--powerline Add Powerline Glyphs
|
||||
--powerlineextra Add Powerline Glyphs (https://github.com/ryanoasis
|
||||
/powerline-extra-symbols)
|
||||
--careful Do not overwrite existing glyphs if detected
|
||||
-ext [EXTENSION], --extension [EXTENSION]
|
||||
Change font file type to create (e.g., ttf, otf)
|
||||
-out [OUTPUTDIR], --outputdir [OUTPUTDIR]
|
||||
The directory to output the patched font file to
|
||||
```
|
||||
@ -313,14 +321,15 @@ optional arguments:
|
||||
| Please make sure to reference via the **release** branch and _not_ the ~~**master**~~ branch because paths are subject change for each release |
|
||||
| For example (paths shorted for demonstation purposes): |
|
||||
| Instead of: ~~https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DroidSansMono/< font_path >.otf~~ |
|
||||
| Please use: https://github.com/ryanoasis/nerd-fonts/blob/0.8.0/patched-fonts/DroidSansMono/< font_path >.otf |
|
||||
| Please use: https://github.com/ryanoasis/nerd-fonts/blob/0.9.0/patched-fonts/DroidSansMono/< font_path >.otf |
|
||||
|
||||
## Other Good Fonts to Patch
|
||||
|
||||
* a list of additional good fonts to patch that I cannot provide or share due to the license:
|
||||
* [Input Mono](http://input.fontbureau.com/)
|
||||
* Coming soon with external hosting :)
|
||||
* [PragmataPro](http://www.fsd.it/fonts/pragmatapro.htm)
|
||||
* [Input Mono][input-mono] (license restriction)
|
||||
* Possibly coming with external hosting :)
|
||||
* [PragmataPro][pragmatapro] (not free)
|
||||
* [Consolas][consolas] (proprietary)
|
||||
|
||||
## Project History
|
||||
|
||||
@ -367,6 +376,10 @@ Link References
|
||||
[img-gitter-badge]:https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat
|
||||
[img-visual-toc-vim-devicons]:https://raw.githubusercontent.com/wiki/ryanoasis/vim-devicons/screenshots/v1.0.0/branding-logo-sm.png
|
||||
|
||||
[consolas]:https://www.microsoft.com/typography/fonts/family.aspx?FID=300
|
||||
[input-mono]:http://input.fontbureau.com/download/
|
||||
[pragmatapro]:http://www.fsd.it/shop/fonts/pragmatapro/
|
||||
|
||||
<!--
|
||||
Font repos
|
||||
-->
|
||||
|
Loading…
x
Reference in New Issue
Block a user