Adds new glyph font source: Font Linux (fixes #75)

This commit is contained in:
ryanoasis 2016-05-08 16:58:54 -04:00
parent e6fef79110
commit f933b5a2ba
4 changed files with 75 additions and 16 deletions

View file

@ -36,8 +36,9 @@ parser.add_argument('font', help='The path to the font to be patched (e.g. Incon
parser.add_argument('-s', '--use-single-width-glyphs', dest='single', action='store_true', help='Whether to generate the glyphs as single-width not double-width (default is double-width)', default=False) parser.add_argument('-s', '--use-single-width-glyphs', dest='single', action='store_true', help='Whether to generate the glyphs as single-width not double-width (default is double-width)', default=False)
parser.add_argument('-q', '--quiet', '--shutup', dest='quiet', action='store_true', help='Do not generate verbose output', default=False) parser.add_argument('-q', '--quiet', '--shutup', dest='quiet', action='store_true', help='Do not generate verbose output', default=False)
parser.add_argument('-w', '--windows', '--limit-font-name-length', dest='windows', action='store_true', help='Limit the internal font name to a maximum of 31 characters (for safe Windows compatiblity)', default=False) parser.add_argument('-w', '--windows', '--limit-font-name-length', dest='windows', action='store_true', help='Limit the internal font name to a maximum of 31 characters (for safe Windows compatiblity)', 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('--fontawesome', dest='fontawesome', action='store_true', help='Add Font Awesome Glyphs (http://fortawesome.github.io/Font-Awesome)', default=False)
parser.add_argument('--octicons', dest='octicons', action='store_true', help='Add Octicons Glyphs (https://octicons.github.com/)', 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('--pomicons', dest='pomicons', action='store_true', help='Add Pomicon Glyphs (https://github.com/gabrielelana/pomicons)', 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('--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) parser.add_argument('--powerlineextra', dest='powerlineextra', action='store_true', help='Add Powerline Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)', default=False)
@ -79,8 +80,12 @@ if args.pomicons:
additionalFontNameSuffix += " Plus Pomicons" additionalFontNameSuffix += " Plus Pomicons"
verboseAdditionalFontNameSuffix += " Plus Pomicons" verboseAdditionalFontNameSuffix += " Plus Pomicons"
if args.fontlinux:
additionalFontNameSuffix += " Plus Font Linux"
verboseAdditionalFontNameSuffix += " Plus Font Linux"
# if all source glyphs included simplify the name # if all source glyphs included simplify the name
if args.fontawesome and args.octicons and args.pomicons and args.powerlineextra: if args.fontawesome and args.octicons and args.pomicons and args.powerlineextra and args.fontlinux:
additionalFontNameSuffix = " " + projectNameSingular + " Complete" additionalFontNameSuffix = " " + projectNameSingular + " Complete"
verboseAdditionalFontNameSuffix = " " + projectNameSingular + " Complete" verboseAdditionalFontNameSuffix = " " + projectNameSingular + " Complete"
@ -200,11 +205,19 @@ if args.pomicons:
pomicons = fontforge.open("glyph-source-fonts/Pomicons.otf") pomicons = fontforge.open("glyph-source-fonts/Pomicons.otf")
pomicons.em = sourceFont.em pomicons.em = sourceFont.em
if args.fontlinux:
fontlinux = fontforge.open("glyph-source-fonts/font-linux.ttf")
fontlinux.em = sourceFont.em
fontlinuxExactEncodingPosition = True
# Prevent glyph encoding position conflicts between glyph sets # Prevent glyph encoding position conflicts between glyph sets
if args.fontawesome and args.octicons: if args.fontawesome and args.octicons:
octiconsExactEncodingPosition = False octiconsExactEncodingPosition = False
if args.fontawesome or args.octicons:
fontlinuxExactEncodingPosition = False
# Define the character ranges # Define the character ranges
# Symbol font ranges # Symbol font ranges
@ -238,6 +251,9 @@ symbolsFontAwesomeRangeEnd = 0xF295
symbolsOcticonsRangeStart = 0xF000 symbolsOcticonsRangeStart = 0xF000
symbolsOcticonsRangeEnd = 0xF0DB symbolsOcticonsRangeEnd = 0xF0DB
symbolsFontLinuxRangeStart = 0xF100
symbolsFontLinuxRangeEnd = 0xF115
# Destination font ranges # Destination font ranges
sourceFontPomiconsStart = 0xE000 sourceFontPomiconsStart = 0xE000
sourceFontPomiconsEnd = 0xE00A sourceFontPomiconsEnd = 0xE00A
@ -254,6 +270,9 @@ sourceFontFontAwesomeEnd = 0xF295
sourceFontOcticonsStart = 0xF400 sourceFontOcticonsStart = 0xF400
sourceFontOcticonsEnd = 0xF4DB sourceFontOcticonsEnd = 0xF4DB
sourceFontFontLinuxStart = 0xF300
sourceFontFontLinuxEnd = 0xF315
SYM_ATTR = { SYM_ATTR = {
# Right/left-aligned glyphs will have their advance width reduced in order to overlap the next glyph slightly # Right/left-aligned glyphs will have their advance width reduced in order to overlap the next glyph slightly
@ -473,6 +492,9 @@ if args.octicons:
if args.pomicons: if args.pomicons:
copy_glyphs(sourceFont, sourceFontPomiconsStart, sourceFontPomiconsEnd, pomicons, symbolsPomiconsRangeStart, symbolsPomiconsRangeEnd) copy_glyphs(sourceFont, sourceFontPomiconsStart, sourceFontPomiconsEnd, pomicons, symbolsPomiconsRangeStart, symbolsPomiconsRangeEnd)
if args.fontlinux:
copy_glyphs(sourceFont, sourceFontFontLinuxStart, sourceFontFontLinuxEnd, fontlinux, symbolsFontLinuxRangeStart, symbolsFontLinuxRangeEnd, fontlinuxExactEncodingPosition)
extension = os.path.splitext(sourceFont.path)[1] extension = os.path.splitext(sourceFont.path)[1]
# the `PfEd-comments` flag is required for Fontforge to save # the `PfEd-comments` flag is required for Fontforge to save

Binary file not shown.

View file

@ -89,6 +89,10 @@ do
patch_font_batch "$f" "additional-variations/" $powerline --octicons & patch_font_batch "$f" "additional-variations/" $powerline --octicons &
patch_font_batch "$f" "additional-variations/" $powerline --octicons --powerlineextra & patch_font_batch "$f" "additional-variations/" $powerline --octicons --powerlineextra &
# font linux variations:
patch_font_batch "$f" "additional-variations/" $powerline --fontlinux &
patch_font_batch "$f" "additional-variations/" $powerline --fontlinux --powerlineextra &
# pomicon variations: # pomicon variations:
patch_font_batch "$f" "additional-variations/" $powerline --pomicons & patch_font_batch "$f" "additional-variations/" $powerline --pomicons &
patch_font_batch "$f" "additional-variations/" $powerline --pomicons --powerlineextra & patch_font_batch "$f" "additional-variations/" $powerline --pomicons --powerlineextra &
@ -101,15 +105,30 @@ do
patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --pomicons & patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --pomicons &
patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --pomicons --powerlineextra & patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --pomicons --powerlineextra &
# fontawesome + fontlinux variations:
patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --fontlinux &
patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --fontlinux --powerlineextra &
# fontlinux + pomicons variations:
patch_font_batch "$f" "additional-variations/" $powerline --fontlinux --pomicons &
patch_font_batch "$f" "additional-variations/" $powerline --fontlinux --pomicons --powerlineextra &
# octicons + pomicons variations: # octicons + pomicons variations:
patch_font_batch "$f" "additional-variations/" $powerline --octicons --pomicons & patch_font_batch "$f" "additional-variations/" $powerline --octicons --pomicons &
patch_font_batch "$f" "additional-variations/" $powerline --octicons --pomicons --powerlineextra & patch_font_batch "$f" "additional-variations/" $powerline --octicons --pomicons --powerlineextra &
# octicons + fontlinux variations:
patch_font_batch "$f" "additional-variations/" $powerline --octicons --fontlinux &
patch_font_batch "$f" "additional-variations/" $powerline --octicons --fontlinux --powerlineextra &
# fontawesome + octicons + pomicons variations: # fontawesome + octicons + pomicons variations:
patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --octicons --pomicons & patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --octicons --pomicons &
# fontawesome + octicons + pomicons + powerlineextra variations: # fontawesome + octicons + pomicons + fontlinux variations:
patch_font_batch "$f" "complete/" $powerline --fontawesome --octicons --pomicons --powerlineextra & patch_font_batch "$f" "additional-variations/" $powerline --fontawesome --octicons --pomicons --fontlinux &
# fontawesome + octicons + pomicons + powerlineextra variations (aka Complete):
patch_font_batch "$f" "complete/" $powerline --fontawesome --octicons --pomicons --powerlineextra --fontlinux &
# un-comment to test this script (patch 1 font) # un-comment to test this script (patch 1 font)

View file

@ -76,16 +76,21 @@ End notice section
![image](https://github.com/ryanoasis/nerd-filetype-glyphs-fonts-patcher/wiki/screenshots/v0.7.x/fontforge-glyph-set-octicons.png) ![image](https://github.com/ryanoasis/nerd-filetype-glyphs-fonts-patcher/wiki/screenshots/v0.7.x/fontforge-glyph-set-octicons.png)
### [Pomicons][gabrielelana-pomicons]
> 8 symbols for the ["Pomodoro Technique"®](http://pomodorotechnique.com). / ([repo][gabrielelana-pomicons])
![image](https://github.com/ryanoasis/nerd-filetype-glyphs-fonts-patcher/wiki/screenshots/v0.7.x/fontforge-glyph-set-pomicons.png)
### [Powerline Extra Symbols][ryanoasis-powerline-extra-symbols] ### [Powerline Extra Symbols][ryanoasis-powerline-extra-symbols]
> Provides additional Powerline separator glyphs and a column number glyph (CN). / ([repo][ryanoasis-powerline-extra-symbols]) > Provides additional Powerline separator glyphs and a column number glyph (CN). / ([repo][ryanoasis-powerline-extra-symbols])
![image](https://raw.githubusercontent.com/ryanoasis/powerline-extra-symbols/master/fontforge.png) ![image](https://raw.githubusercontent.com/ryanoasis/powerline-extra-symbols/master/fontforge.png)
### [Font Linux][font-linux]
> Font-linux is an icon font containing logos of popular linux distributions for inclusion in websites. / ([repo][font-linux])
![image](https://github.com/ryanoasis/nerd-filetype-glyphs-fonts-patcher/wiki/screenshots/v0.7.x/fontforge-glyph-set-font-linux.png)
### [Pomicons][gabrielelana-pomicons]
> 8 symbols for the ["Pomodoro Technique"®](http://pomodorotechnique.com). / ([repo][gabrielelana-pomicons])
![image](https://github.com/ryanoasis/nerd-filetype-glyphs-fonts-patcher/wiki/screenshots/v0.7.x/fontforge-glyph-set-pomicons.png)
## Usage ## Usage
#### Option A #### Option A
@ -139,6 +144,7 @@ See: [Font Patcher](#font-patcher) for usage
* extra glyphs that are *double* or *single* (monospaced) width * extra glyphs that are *double* or *single* (monospaced) width
* [Font Awesome][font-awesome] * [Font Awesome][font-awesome]
* [GitHub Octicons][octicons] * [GitHub Octicons][octicons]
* [Font Linux][font-linux]
* [Pomicons][gabrielelana-pomicons] * [Pomicons][gabrielelana-pomicons]
* Full Windows Compatibility (WIP) * Full Windows Compatibility (WIP)
@ -153,6 +159,7 @@ See: [Font Patcher](#font-patcher) for usage
* Windows Compatible * Windows Compatible
* [Font Awesome][font-awesome] * [Font Awesome][font-awesome]
* [GitHub Octicons][octicons] * [GitHub Octicons][octicons]
* [Font Linux][font-linux]
* [Pomicons][gabrielelana-pomicons] * [Pomicons][gabrielelana-pomicons]
@ -211,9 +218,9 @@ Patching the font of your own choosing for use with the [vim-devicons](https://g
``` ```
usage: font-patcher [-h] [-s] [-q] [-w] [--fontawesome] [--octicons] usage: font-patcher [-h] [-v] [-s] [-q] [-w] [--fontawesome] [--fontlinux]
[--pomicons] [--powerline] [--powerlineextra] [--careful] [--octicons] [--pomicons] [--powerline] [--powerlineextra]
[-out [OUTPUTDIR]] [--careful] [-out [OUTPUTDIR]]
font font
Patches a given font with programming and web development related glyphs Patches a given font with programming and web development related glyphs
@ -225,6 +232,7 @@ positional arguments:
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --use-single-width-glyphs -s, --use-single-width-glyphs
Whether to generate the glyphs as single-width not Whether to generate the glyphs as single-width not
double-width (default is double-width) double-width (default is double-width)
@ -234,8 +242,10 @@ optional arguments:
Limit the internal font name to a maximum of 31 Limit the internal font name to a maximum of 31
characters (for safe Windows compatiblity) characters (for safe Windows compatiblity)
--fontawesome Add Font Awesome Glyphs (http://fortawesome.github.io --fontawesome Add Font Awesome Glyphs (http://fortawesome.github.io
/Font-Awesome/) /Font-Awesome)
--octicons Add Octicons Glyphs (https://octicons.github.com/) --fontlinux Add Font Linux Glyphs (https://github.com/Lukas-W
/font-linux)
--octicons Add Octicons Glyphs (https://octicons.github.com)
--pomicons Add Pomicon Glyphs --pomicons Add Pomicon Glyphs
(https://github.com/gabrielelana/pomicons) (https://github.com/gabrielelana/pomicons)
--powerline Add Powerline Glyphs --powerline Add Powerline Glyphs
@ -299,16 +309,21 @@ optional arguments:
see [LICENSE](LICENSE) see [LICENSE](LICENSE)
<!--
Repo References
-->
[vim-devicons]:https://github.com/ryanoasis/vim-devicons [vim-devicons]:https://github.com/ryanoasis/vim-devicons
[vorillaz-devicons]:http://vorillaz.github.io/devicons/ [vorillaz-devicons]:http://vorillaz.github.io/devicons/
[font-awesome]:https://github.com/FortAwesome/Font-Awesome [font-awesome]:https://github.com/FortAwesome/Font-Awesome
[octicons]:https://github.com/github/octicons [octicons]:https://github.com/github/octicons
[font-linux]:https://github.com/Lukas-W/font-linux
[gabrielelana-pomicons]:https://github.com/gabrielelana/pomicons [gabrielelana-pomicons]:https://github.com/gabrielelana/pomicons
[Seti-UI]:https://atom.io/themes/seti-ui [Seti-UI]:https://atom.io/themes/seti-ui
[ryanoasis-powerline-extra-symbols]:https://github.com/ryanoasis/powerline-extra-symbols [ryanoasis-powerline-extra-symbols]:https://github.com/ryanoasis/powerline-extra-symbols
[wiki]:https://github.com/ryanoasis/nerd-fonts/wiki [wiki]:https://github.com/ryanoasis/nerd-fonts/wiki
<!--- <!--
Link References Link References
--> -->
@ -324,6 +339,7 @@ Link References
<!-- <!--
Font repos Font repos
--> -->
[f-hack]:https://github.com/chrissimpkins/Hack [f-hack]:https://github.com/chrissimpkins/Hack
[f-a-pro]:http://www.marksimonson.com/fonts/view/anonymous-pro [f-a-pro]:http://www.marksimonson.com/fonts/view/anonymous-pro
[f-source]:https://github.com/adobe-fonts/source-code-pro [f-source]:https://github.com/adobe-fonts/source-code-pro
@ -338,6 +354,7 @@ Font repos
<!-- <!--
Patched Font internal links Patched Font internal links
--> -->
[p-3270]:patched-fonts/3270 [p-3270]:patched-fonts/3270
[p-a-pro]:patched-fonts/AnonymousPro [p-a-pro]:patched-fonts/AnonymousPro
[p-aurulent]:patched-fonts/AurulentSansMono [p-aurulent]:patched-fonts/AurulentSansMono
@ -368,5 +385,6 @@ Patched Font internal links
<!-- <!--
Patched Font Statuses Patched Font Statuses
--> -->
[s-hack]:https://github.com/ryanoasis/nerd-fonts/issues/70 [s-hack]:https://github.com/ryanoasis/nerd-fonts/issues/70
[s-terminus]:https://github.com/ryanoasis/nerd-fonts/issues/16 [s-terminus]:https://github.com/ryanoasis/nerd-fonts/issues/16