1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-25 20:18:01 +02:00
Alexander Mankuta 2015-09-02 23:21:13 +03:00
parent bb4064dc36
commit 9d3e60ac66
135 changed files with 163 additions and 17 deletions

View File

@ -26,6 +26,7 @@ parser.add_argument('-w', '--windows', '--limit-font-name-length', dest='windows
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('--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 (https://github.com/ryanoasis/powerline-extra-symbols)', default=False)
args = parser.parse_args()
#print "using fontforge package version: " + str(fontforge.__version__) + " " + str(fontforge.version())
@ -140,8 +141,9 @@ if args.pomicons:
# Define the character ranges
symbolsOriginalRangeStart = 0xE4FE
symbolsOriginalRangeEnd = 0xE52A
# Symbol font ranges
symbolsPomiconsRangeStart = 0xE000
symbolsPomiconsRangeEnd = 0xE00A
symbolsPowerlineRange1Start = 0xE0A0
symbolsPowerlineRange1End = 0xE0A2
@ -149,6 +151,9 @@ symbolsPowerlineRange1End = 0xE0A2
symbolsPowerlineRange2Start = 0xE0B0
symbolsPowerlineRange2End = 0xE0B3
symbolsOriginalRangeStart = 0xE4FE
symbolsOriginalRangeEnd = 0xE52A
symbolsDeviconsRangeStart = 0xE600
symbolsDeviconsRangeEnd = 0xE6C5
@ -158,8 +163,15 @@ symbolsFontAwesomeRangeEnd = 0xF23A
symbolsOcticonsRangeStart = 0xF000
symbolsOcticonsRangeEnd = 0xF0DB
symbolsPomiconsRangeStart = 0xE000
symbolsPomiconsRangeEnd = 0xE00A
# Destination font ranges
sourceFontPomiconsStart = 0xE000
sourceFontPomiconsEnd = 0xE00A
#symbolsPowerlineRange1Start = 0xE0A0
#symbolsPowerlineRange1End = 0xE0A2
#symbolsPowerlineRange2Start = 0xE0B0
#symbolsPowerlineRange2End = 0xE0B3
sourceFontOriginalStart = 0xE5FE
sourceFontOriginalEnd = 0xE62A
@ -173,9 +185,6 @@ sourceFontFontAwesomeEnd = 0xF23A
sourceFontOcticonsStart = 0xF400
sourceFontOcticonsEnd = 0xF4DB
sourceFontPomiconsStart = 0xE000
sourceFontPomiconsEnd = 0xE00A
SYM_ATTR = {
# Right/left-aligned glyphs will have their advance width reduced in order to overlap the next glyph slightly
@ -345,10 +354,13 @@ def copy_glyphs(sourceFont, sourceFontStart, sourceFontEnd, symbolFont, symbolFo
copy_glyphs(sourceFont, sourceFontOriginalStart, sourceFontOriginalEnd, symbols, symbolsOriginalRangeStart, symbolsOriginalRangeEnd)
copy_glyphs(sourceFont, symbolsPowerlineRange1Start, symbolsPowerlineRange1End, powerlineSymbols, symbolsPowerlineRange1Start, symbolsPowerlineRange1End)
copy_glyphs(sourceFont, symbolsPowerlineRange2Start, symbolsPowerlineRange2End, powerlineSymbols, symbolsPowerlineRange2Start, symbolsPowerlineRange2End)
copy_glyphs(sourceFont, sourceFontDeviconsStart, sourceFontDeviconsEnd, symbolsDevicons, symbolsDeviconsRangeStart, symbolsDeviconsRangeEnd)
if args.powerline:
copy_glyphs(sourceFont, symbolsPowerlineRange1Start, symbolsPowerlineRange1End, sourceFont, symbolsPowerlineRange1Start, symbolsPowerlineRange1End)
copy_glyphs(sourceFont, symbolsPowerlineRange2Start, symbolsPowerlineRange2End, sourceFont, symbolsPowerlineRange2Start, symbolsPowerlineRange2End)
if args.fontawesome:
copy_glyphs(sourceFont, sourceFontFontAwesomeStart, sourceFontFontAwesomeEnd, fontawesome, symbolsFontAwesomeRangeStart, symbolsFontAwesomeRangeEnd)

View File

@ -1,5 +1,6 @@
#!/bin/bash
# version: 0.4.0
set -x
# Check for Fontforge
type fontforge >/dev/null 2>&1 || {
@ -54,28 +55,36 @@ function patch_font_batch {
# $f stores current value
for f in "${source_fonts[@]}"
do
patch_font_batch "$f"
echo "$f"
if [[ "$f" =~ Hack ]]
then
powerline=""
else
powerline="--powerline"
fi
patch_font_batch "$f" $powerline
# font awesome variations
patch_font_batch "$f" --fontawesome
patch_font_batch "$f" $powerline --fontawesome
# octicons variations:
patch_font_batch "$f" --octicons
patch_font_batch "$f" $powerline --octicons
# pomicon variations:
patch_font_batch "$f" --pomicons
patch_font_batch "$f" $powerline --pomicons
# fontawesome + octicons variations:
patch_font_batch "$f" --fontawesome --octicons
patch_font_batch "$f" $powerline --fontawesome --octicons
# fontawesome + pomicons variations:
patch_font_batch "$f" --fontawesome --pomicons
patch_font_batch "$f" $powerline --fontawesome --pomicons
# octicons + pomicons variations:
patch_font_batch "$f" --octicons --pomicons
patch_font_batch "$f" $powerline --octicons --pomicons
# fontawesome + octicons + pomicons variations:
patch_font_batch "$f" --fontawesome --octicons --pomicons
patch_font_batch "$f" $powerline --fontawesome --octicons --pomicons
# un-comment to test this script (patch 1 font)
#break

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More