diff --git a/font-patcher b/font-patcher index 75869c5ab..92f2be77c 100755 --- a/font-patcher +++ b/font-patcher @@ -17,16 +17,21 @@ except ImportError: # argparse stuff -parser = argparse.ArgumentParser(description='Patches a given font with programming and web development related glyphs (mainly for vim-webdevicons)') +parser = argparse.ArgumentParser(description='Patches a given font with programming and web development related glyphs (mainly for https://github.com/ryanoasis/vim-devicons)') parser.add_argument('font', help='The path to the font to be patched (e.g. Inconsolata.otf)') 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('-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('--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) args = parser.parse_args() #print "using fontforge package version: " + str(fontforge.__version__) + " " + str(fontforge.version()) #print type(fontforge.version()) #print int(fontforge.version()) +version = "0.4.0" minimumVersion = 20141231 actualVersion = int(fontforge.version()) #actualVersion = 20120731 # for testing invalid version @@ -36,40 +41,116 @@ if actualVersion < minimumVersion: print "Please use at least version: " + str(minimumVersion) sys.exit(1) -additionalFontNameSuffix = " Plus Nerd File Types" + +verboseAdditionalFontNameSuffix = " Plus Nerd File Types" + +if args.windows: + # attempt to shorten here on the additional name BEFORE trimming later + additionalFontNameSuffix = " PNFT" +else: + additionalFontNameSuffix = verboseAdditionalFontNameSuffix if args.single: additionalFontNameSuffix += " Mono" + verboseAdditionalFontNameSuffix += " Mono" + +if args.fontawesome: + additionalFontNameSuffix += " Plus Font Awesome" + verboseAdditionalFontNameSuffix += " Plus Font Awesome" + +if args.octicons: + additionalFontNameSuffix += " Plus Octicons" + verboseAdditionalFontNameSuffix += " Plus Octicons" + +if args.pomicons: + additionalFontNameSuffix += " Plus Pomicons" + verboseAdditionalFontNameSuffix += " Plus Pomicons" + sourceFont = fontforge.open(args.font) -# rename font fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups() -sourceFont.familyname = sourceFont.familyname + additionalFontNameSuffix -sourceFont.fullname = sourceFont.fullname + additionalFontNameSuffix -sourceFont.fontname = fontname + additionalFontNameSuffix.replace(" ", "") +familyname = sourceFont.familyname + additionalFontNameSuffix +# fullname (filename) can always use long/verbose font name, even in windows +fullname = sourceFont.fullname + verboseAdditionalFontNameSuffix +fontname = fontname + additionalFontNameSuffix.replace(" ", "") + +if args.windows: + maxLength = 31 + fullname += " Windows Compatible" + # now make sure less than 32 characters name length + #if len(fullname) > maxLength: + # fullname = fullname[:maxLength] + if len(fontname) > maxLength: + fontname = fontname[:maxLength] + if len(fullname) > maxLength: + familyname = familyname[:maxLength] + +# rename font + +def replace_all(text, dic): + for i, j in dic.iteritems(): + text = text.replace(i, j) + return text + +# comply with SIL Open Font License (OFL) +reservedFontNameReplacements = {'source': 'sauce', 'Source': 'Sauce', 'hermit': 'hurmit', 'Hermit': 'Hurmit'} + +sourceFont.familyname = replace_all(familyname, reservedFontNameReplacements) +sourceFont.fullname = replace_all(fullname, reservedFontNameReplacements) +sourceFont.fontname = replace_all(fontname, reservedFontNameReplacements) sourceFont.appendSFNTName('English (US)', 'Preferred Family', sourceFont.familyname) sourceFont.appendSFNTName('English (US)', 'Compatible Full', sourceFont.fullname) +sourceFont.version = version + # glyph font sourceFont_em_original = sourceFont.em symbols = fontforge.open("glyph-source-fonts/original-source.otf") -#symbols = fontforge.open("glyph-source-fonts/icomoon.ttf") -symbols2 = fontforge.open("glyph-source-fonts/devicons.ttf") +powerlineSymbols = fontforge.open("glyph-source-fonts/PowerlineSymbols.otf") +symbolsDevicons = fontforge.open("glyph-source-fonts/devicons.ttf") +fontawesome = fontforge.open("glyph-source-fonts/FontAwesome.otf") +octicons = fontforge.open("glyph-source-fonts/octicons.ttf") +pomicons = fontforge.open("glyph-source-fonts/Pomicons.otf") -symbolsRangeStart = 0xE500 -symbolsRangeEnd = 0xE527 +symbolsOriginalRangeStart = 0xE4FE +symbolsOriginalRangeEnd = 0xE52A -symbols2RangeStart = 0xE600 -symbols2RangeEnd = 0xE6C5 +symbolsPowerlineRange1Start = 0xE0A0 +symbolsPowerlineRange1End = 0xE0A2 -sourceFontRange1Start = 0xE600 -sourceFontRange1End = 0xE627 +symbolsPowerlineRange2Start = 0xE0B0 +symbolsPowerlineRange2End = 0xE0B3 + +symbolsDeviconsRangeStart = 0xE600 +symbolsDeviconsRangeEnd = 0xE6C5 + +symbolsFontAwesomeRangeStart = 0xF000 +symbolsFontAwesomeRangeEnd = 0xF23A + +symbolsOcticonsRangeStart = 0xF000 +symbolsOcticonsRangeEnd = 0xF0DB + +symbolsPomiconsRangeStart = 0xE000 +symbolsPomiconsRangeEnd = 0xE00A + +sourceFontOriginalStart = 0xE5FE +sourceFontOriginalEnd = 0xE62A + +sourceFontDeviconsStart = 0xE700 +sourceFontDeviconsEnd = 0xE7C5 + +sourceFontFontAwesomeStart = 0xF000 +sourceFontFontAwesomeEnd = 0xF23A + +sourceFontOcticonsStart = 0xF400 +sourceFontOcticonsEnd = 0xF4DB + +sourceFontPomiconsStart = 0xE000 +sourceFontPomiconsEnd = 0xE00A -sourceFontRange2Start = 0xE700 -sourceFontRange2End = 0xE7C5 SYM_ATTR = { # Right/left-aligned glyphs will have their advance width reduced in order to overlap the next glyph slightly @@ -82,14 +163,12 @@ SYM_ATTR = { 0x2b81: { 'align': 'l', 'stretch': 'xy', 'overlap': True }, 0x2b82: { 'align': 'r', 'stretch': 'xy', 'overlap': True }, 0x2b83: { 'align': 'r', 'stretch': 'xy', 'overlap': True }, - #0xe612: { 'align': 'l', 'stretch': 'xy', 'overlap': False }, - 0xe611: { 'align': 'c', 'stretch': 'xy', 'overlap': False }, } # Force the em size to be equal symbols.em = sourceFont.em -symbols2.em = sourceFont.em +symbolsDevicons.em = sourceFont.em # Initial font dimensions font_dim = { @@ -121,9 +200,6 @@ for glyph in range(0x00, 0x17f) + range(0x2500, 0x2600): # Calculate font height font_dim['height'] = abs(font_dim['ymin']) + font_dim['ymax'] -print "font_dim height = " + str(font_dim['height']) -print "font_dim width = " + str(font_dim['width']) - # Update the font encoding to ensure that the Unicode glyphs are available sourceFont.encoding = 'ISO10646' @@ -138,6 +214,7 @@ def get_dim(glyph): 'ymin' : bbox[1], 'xmax' : bbox[2], 'ymax' : bbox[3], + 'width' : bbox[2] + (-bbox[0]), 'height': bbox[3] + (-bbox[1]), } @@ -156,13 +233,7 @@ def copy_glyphs(sourceFont, sourceFontStart, sourceFontEnd, symbolFont, symbolFo sourceFont.selection.select(("ranges","unicode"),sourceFontStart,sourceFontEnd) for sym_glyph in symbolFont.selection.byGlyphs: - sym_attr = False - if sym_glyph.unicode in SYM_ATTR: - print "found unicode in SYM_ATTR" - sym_attr = SYM_ATTR[sym_glyph.unicode] - print sym_attr - print "done found unicode" - + #sym_attr = SYM_ATTR[sym_glyph.unicode] if args.quiet == False: print "updating glyph: " + str(sym_glyph) # convince that this string really is a hex: @@ -179,82 +250,71 @@ def copy_glyphs(sourceFont, sourceFontStart, sourceFontEnd, symbolFont, symbolFo sourceFont.selection.select(currentSourceFontGlyph) sourceFont.paste() - #if args.single: + if args.single: # Now that we have copy/pasted the glyph, it's time to scale and move it - #print "sym_attr:" - #print sym_attr - #print sym_attr['stretch'] - if sym_attr: # Handle glyph stretching - if 'x' in sym_attr['stretch']: - print "Stretch x" - # Stretch the glyph horizontally - scale_ratio = font_dim['width'] / sym_dim['width'] - sourceFont.transform(psMat.scale(scale_ratio, 1)) + #if 'x' in sym_attr['stretch']: + # # Stretch the glyph horizontally + # scale_ratio = font_dim['width'] / sym_dim['width'] # sourceFont.transform(psMat.scale(scale_ratio, 1)) - if 'y' in sym_attr['stretch']: - print "Stretch y" - # Stretch the glyph vertically - scale_ratio = font_dim['height'] / sym_dim['height'] - sourceFont.transform(psMat.scale(1, scale_ratio)) + #if 'y' in sym_attr['stretch']: + # # Stretch the glyph vertically + # scale_ratio = font_dim['height'] / sym_dim['height'] - # Use the dimensions from the pasted and stretched glyph - sym_dim = get_dim(sourceFont[currentSourceFontGlyph]) + # sourceFont.transform(psMat.scale(1, scale_ratio)) - # Center-align the glyph vertically - font_ycenter = font_dim['height'] / 2 - sym_ycenter = sym_dim['height'] / 2 + # Use the dimensions from the pasted and stretched glyph + sym_dim = get_dim(sourceFont[currentSourceFontGlyph]) - # First move it to the ymax (top) - sourceFont.transform(psMat.translate(0, font_dim['ymax'] - sym_dim['ymax'])) + # Center-align the glyph vertically + font_ycenter = font_dim['height'] / 2 + sym_ycenter = sym_dim['height'] / 2 - # Then move it the y center difference - sourceFont.transform(psMat.translate(0, sym_ycenter - font_ycenter)) + # First move it to the ymax (top) + sourceFont.transform(psMat.translate(0, font_dim['ymax'] - sym_dim['ymax'])) - # Ensure that the glyph doesn't extend outside the font's bounding box - if sym_dim['width'] > font_dim['width']: - print "sym_dim width " + str(sym_dim['width']) - print "font_dim width " + str(font_dim['width']) - # The glyph is too wide, scale it down to fit - scale_matrix = psMat.scale(font_dim['width'] / sym_dim['width'], 1) + # Then move it the y center difference + sourceFont.transform(psMat.translate(0, sym_ycenter - font_ycenter)) - sourceFont.transform(scale_matrix) + # Ensure that the glyph doesn't extend outside the font's bounding box + if sym_dim['width'] > font_dim['width']: + # The glyph is too wide, scale it down to fit + scale_matrix = psMat.scale(font_dim['width'] / sym_dim['width'], 1) - # Use the dimensions from the stretched glyph - sym_dim = get_dim(sourceFont[currentSourceFontGlyph]) - print "Bbox: " + str(sym_dim) + sourceFont.transform(scale_matrix) + # Use the dimensions from the stretched glyph + sym_dim = get_dim(sourceFont[currentSourceFontGlyph]) - print "sym_dim width NOW: " + str(sym_dim['width']) - # Handle glyph alignment - #if sym_attr['align'] == 'c': - # # Center align - # align_matrix = psMat.translate(font_dim['width'] / 2 - sym_dim['width'] / 2 , 0) - align_matrix = psMat.translate(font_dim['width'] / 2 - sym_dim['width'] / 2 , 0) - #elif sym_attr['align'] == 'r': - # # Right align - # align_matrix = psMat.translate(font_dim['width'] - sym_dim['width'], 0) - #else: - # No alignment (left alignment) - #align_matrix = psMat.translate(0, 0) + # Handle glyph alignment + #if sym_attr['align'] == 'c': + # # Center align + # align_matrix = psMat.translate(font_dim['width'] / 2 - sym_dim['width'] / 2 , 0) + align_matrix = psMat.translate(font_dim['width'] / 2 - sym_dim['width'] / 2 , 0) + #elif sym_attr['align'] == 'r': + # # Right align + # align_matrix = psMat.translate(font_dim['width'] - sym_dim['width'], 0) + #else: + # No alignment (left alignment) + #align_matrix = psMat.translate(0, 0) - sourceFont.transform(align_matrix) + sourceFont.transform(align_matrix) - #if sym_attr['overlap'] is True: - # overlap_width = sourceFont.em / 48 + #if sym_attr['overlap'] is True: + # overlap_width = sourceFont.em / 48 - # # Stretch the glyph slightly horizontally if it should overlap - # sourceFont.transform(psMat.scale((sym_dim['width'] + overlap_width) / sym_dim['width'], 1)) + # # Stretch the glyph slightly horizontally if it should overlap + # sourceFont.transform(psMat.scale((sym_dim['width'] + overlap_width) / sym_dim['width'], 1)) - # if sym_attr['align'] == 'l': - # # The glyph should be left-aligned, so it must be moved overlap_width to the left - # # This only applies to left-aligned glyphs because the glyph is scaled to the right - # sourceFont.transform(psMat.translate(-overlap_width, 0)) + # if sym_attr['align'] == 'l': + # # The glyph should be left-aligned, so it must be moved overlap_width to the left + # # This only applies to left-aligned glyphs because the glyph is scaled to the right + # sourceFont.transform(psMat.translate(-overlap_width, 0)) - # Ensure the font is considered monospaced on Windows - #sourceFont[currentSourceFontGlyph].width = font_dim['width'] + # Ensure the font is considered monospaced on Windows + sourceFont[currentSourceFontGlyph].width = font_dim['width'] sourceFontCounter += 1 # reset selection so iteration works propertly @todo fix? rookie misunderstanding? @@ -263,8 +323,19 @@ def copy_glyphs(sourceFont, sourceFontStart, sourceFontEnd, symbolFont, symbolFo return -copy_glyphs(sourceFont, sourceFontRange1Start, sourceFontRange1End, symbols, symbolsRangeStart, symbolsRangeEnd) -copy_glyphs(sourceFont, sourceFontRange2Start, sourceFontRange2End, symbols2, symbols2RangeStart, symbols2RangeEnd) +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.fontawesome: + copy_glyphs(sourceFont, sourceFontFontAwesomeStart, sourceFontFontAwesomeEnd, fontawesome, symbolsFontAwesomeRangeStart, symbolsFontAwesomeRangeEnd) + +if args.octicons: + copy_glyphs(sourceFont, sourceFontOcticonsStart, sourceFontOcticonsEnd, octicons, symbolsOcticonsRangeStart, symbolsOcticonsRangeEnd) + +if args.pomicons: + copy_glyphs(sourceFont, sourceFontPomiconsStart, sourceFontPomiconsEnd, pomicons, symbolsPomiconsRangeStart, symbolsPomiconsRangeEnd) extension = os.path.splitext(sourceFont.path)[1] diff --git a/gotta-patch-em-all-font-patcher!.sh b/gotta-patch-em-all-font-patcher!.sh new file mode 100755 index 000000000..9e17b5831 --- /dev/null +++ b/gotta-patch-em-all-font-patcher!.sh @@ -0,0 +1,325 @@ +#!/bin/bash +# version: 0.4.0 + +# Set source and target directories +source_fonts_dir="${PWD}/unpatched-sample-fonts" +patched_fonts_dir="${PWD}/patched-fonts" +like_pattern='' + +if [ $# -eq 1 ] + then + like_pattern=$1 + echo "Parameter given, limiting search and patch to pattern '$like_pattern' given" +fi + +#find_command="`find \"$source_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0`" +#find_command="find $source_fonts_dir -name '*.[o,t]tf' -type f -print0" + + +# Execute patcher on each unpatched font +## -0 to handle space in file name +#eval "$find_command" | xargs -0 -I % echo "%" "$patched_fonts_dir/%" +# Copy generated font to it's patched subdirectory + +#IFS=$'\n' +#source_fonts=( $("`find $source_fonts_dir -name '*.[o,t]tf' -type f -print0`") ) +#source_fonts=( $(find $source_fonts_dir -name '*.[o,t]tf' -type f -print0) ) +#source_fonts=( $($find_command) ) + +# correct way to output find results into an array (when files have space chars, etc) +# source: http://stackoverflow.com/questions/8213328/bash-script-find-output-to-array +source_fonts=() + while IFS= read -d $'\0' -r file ; do + source_fonts=("${source_fonts[@]}" "$file") + done < <(find $source_fonts_dir -name "$like_pattern*.[o,t]tf" -type f -print0) + #done < <( eval($find_command) ) + + #echo "${source_fonts[@]}" + +# print total number of source fonts found +echo "Total source fonts found: ${#source_fonts[*]}" +#printf "\n" +#printf "---------------- \n" + +#exit + +#find_new_generated_font="find . -maxdepth 1 -name '*.[o,t]tf' -type f -print0" + +# Use for loop iterate through source fonts +# $f stores current value +for f in "${source_fonts[@]}" +do + #echo -n "$f " + #echo -n "./font-patcher $f " + ./font-patcher -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + #echo "Moved newly created font to: $patched_font_dir" + + ./font-patcher -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # font awesome variations + ./font-patcher --fontawesome -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # octicons variations: + ./font-patcher --octicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # pomicon variations: + ./font-patcher --pomicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --pomicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --pomicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --pomicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # fontawesome + octicons variations: + ./font-patcher --fontawesome --octicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # fontawesome + pomicons variations: + ./font-patcher --fontawesome --pomicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --pomicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --pomicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --pomicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # octicons + pomicons variations: + ./font-patcher --octicons --pomicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons --pomicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons --pomicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --octicons --pomicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + # fontawesome + octicons + pomicons variations: + ./font-patcher --fontawesome --octicons --pomicons -q "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons --pomicons -q -s "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons --pomicons -q -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + ./font-patcher --fontawesome --octicons --pomicons -q -s -w "$f" + printf "\n---------------\n" + newly_created_font=$(find -maxdepth 1 -name '*.[o,t]tf') + echo "newly_created_font = $newly_created_font" + patched_font_dir="${f%/*}/" + patched_font_dir="${patched_font_dir/unpatched-sample-fonts/patched-fonts}" + mv "$newly_created_font" $patched_font_dir + + + + # un-comment to test this script (patch 1 font) + #break +done + + +echo "All unpatched fonts re-patched to their respective sub-directories in $patched_fonts_dir" diff --git a/readme.md b/readme.md index 1a8646ecc..b808513d6 100644 --- a/readme.md +++ b/readme.md @@ -1,22 +1,65 @@ -nerd-filetype-glyphs-fonts-patcher v0.2.0 -========================================= +