diff --git a/README.md b/README.md index a4d9691..d8bdcae 100755 --- a/README.md +++ b/README.md @@ -49,11 +49,17 @@ Mathieu Cannavo, Vincent Chan, Greg Gazdowicz, Jack Jennings, Seb McLauchlan, Da Thanks to the following people for their assitance and contributions: -[CrystalType](https://github.com/crystaltype), -[Dennis Grauel](https://dennisgrauel.com/), -[Denis Moyogo Jacquerye](https://github.com/moyogo), -[Desmond Wong](http://desmondwong.com/), -[Kia Tasbihgou](http://www.kiatas.me/), +[CrystalType](https://github.com/crystaltype) + +[Dennis Grauel](https://dennisgrauel.com/) + +[Denis Moyogo Jacquerye](https://github.com/moyogo) + +[Stephen Nixon](http://www.thundernixon.com/) + +[Desmond Wong](http://desmondwong.com/) + +[Kia Tasbihgou](http://www.kiatas.me/) Thanks to Simon Egli for inviting me to work together on Metapolator in the first place. diff --git a/sources/build.sh b/sources/build.sh index f79000f..fd64aea 100755 --- a/sources/build.sh +++ b/sources/build.sh @@ -1,37 +1,22 @@ -cp WorkSans-Upright.glyphs WorkSans-UprightBuild.glyphs +### WIP macOS build script for Work Sans VF, based on a build script by Mike LaGuttuta -fontmake -o variable -g WorkSans-UprightBuild.glyphs +glyphsSource="WorkSans.glyphs" +VFname="WorkSans-VF" -mv variable_ttf/WorkSans-VF.ttf WorkSans-VF.ttf +fontmake -o variable -g $glyphsSource -rm -rf WorkSans-UprightBuild.glyphs -rm -rf master_ufo -rm -rf variable_ttf +# mv variable_ttf/${VFname}.ttf ${VFname}.ttf -python ./addItalics.py WorkSans-VF.ttf +# rm -rf master_ufo +# rm -rf variable_ttf -gftools fix-nonhinting WorkSans-VF.ttf WorkSans-VF.ttf -gftools fix-dsig --autofix WorkSans-VF.ttf -gftools fix-gasp WorkSans-VF.ttf -ttfautohint WorkSans-VF.ttf WorkSans-VF-Hinted.ttf --verbose +# python tools/swapBracketTrick.py ${VFname}.ttf "Upright" -python ./gftools-fix-vf-meta.py WorkSans-VF-Hinted.ttf +# gftools fix-nonhinting ${VFname}.ttf ${VFname}.ttf +# gftools fix-dsig --autofix ${VFname}.ttf +# gftools fix-gasp ${VFname}.ttf -## move font into folder of dist/, with timestamp, then fontbake the font - python3 ./distdate-and-fontbake.py WorkSans-VF-Hinted.ttf - rm -rf variable_ttf +# python tools/gftools-fix-vf-meta.py ${VFname}.ttf -# ttx WorkSans-VF.ttf - -# rm -rf WorkSans-VF.ttf -# rm -rf WorkSans-Upright-VF-backup-fonttools-prep-gasp.ttf - -# cat WorkSans-Upright-VF.ttx | tr '\n' '\r' | sed -e "s,.*<\/STAT>,$(cat tools/patch1.xml | tr '\n' '\r')," | tr '\r' '\n' > WorkSans-Upright-VF-STAT.ttx - -# rm -rf WorkSans-Upright-VF.ttx - -# ttx WorkSans-Upright-VF-STAT.ttx - -# rm -rf WorkSans-Upright-VF-STAT.ttx - -# mv WorkSans-Upright-VF-STAT.ttf WorkSans-UprightBeta-VF.ttf \ No newline at end of file +# ## move font into folder of dist/, with timestamp, then fontbake the font +# python3 tools/distdate-and-fontbake.py ${VFname}.ttf \ No newline at end of file diff --git a/sources/Glyph Swapping.ods b/sources/tools/Bracket Trick Glyph Swapping.ods similarity index 78% rename from sources/Glyph Swapping.ods rename to sources/tools/Bracket Trick Glyph Swapping.ods index f3728ad..03ad7b3 100644 Binary files a/sources/Glyph Swapping.ods and b/sources/tools/Bracket Trick Glyph Swapping.ods differ diff --git a/sources/tools/addItalics.py b/sources/tools/addItalics.py deleted file mode 100755 index a05e49d..0000000 --- a/sources/tools/addItalics.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import sys -import fontTools -from fontTools.ttLib import TTFont -from fontTools.varLib.featureVars import addFeatureVariations -from fontTools.ttx import makeOutputFileName - - -inputTTF = sys.argv[1] - -# f = TTFont(fontPath) -f = TTFont(inputTTF) - -condSubst = [ - # A list of (Region, Substitution) tuples. - ([{"wght": (0.158, 0.564)}], {"a": "a.swsh"}), - ([{"wght": (0.868, 1.0)}], {"dollar": "dollar.201_230"}), -] - -addFeatureVariations(f, condSubst) - -# newFontPath = fontPath.split(".")[0] + "-italic.ttf" -# f.save(fontPath) -extension = os.path.splitext(inputTTF)[1] -outputTTF = makeOutputFileName(inputTTF, '', extension) -f.save(outputTTF) \ No newline at end of file diff --git a/sources/tools/distdate-and-fontbake.py b/sources/tools/distdate-and-fontbake.py new file mode 100755 index 0000000..a58dba4 --- /dev/null +++ b/sources/tools/distdate-and-fontbake.py @@ -0,0 +1,28 @@ +import sys +import os +import shutil +from datetime import datetime + +arg = sys.argv[-1] +fontFile = arg.split("/")[1] +fontName = fontFile.split(".")[0] + +# make timestamped folder in dist, like `SampleFont_2015-10-21-017_03` +currentDatetime = datetime.now().strftime('%Y-%m-%d-%H_%M') +# outputFolder = 'dist/' + GLYPHS_PATH.replace('sources/', '').replace('.glyphs', '-VF-') + currentDatetime + '/' + +outputFolder = f'dist/{fontName}-{currentDatetime}' + + +if not os.path.exists(outputFolder): + os.makedirs(outputFolder) + +defaultFontPath = arg +newFontPath = f'{outputFolder}/{fontFile}' +shutil.move(defaultFontPath, newFontPath) + +# run fontbakery check on new font +fontbakeryCommand = f'fontbakery check-googlefonts {newFontPath} --ghmarkdown {outputFolder}/fontbakery-report.md' +print("fontbakeryCommand is " + fontbakeryCommand) + +print(os.system(fontbakeryCommand)) \ No newline at end of file diff --git a/sources/tools/swapBracketTrick.py b/sources/tools/swapBracketTrick.py new file mode 100755 index 0000000..b50205b --- /dev/null +++ b/sources/tools/swapBracketTrick.py @@ -0,0 +1,46 @@ +### Based on a script by Stephen Nixon + +import os +import sys +import fontTools +from fontTools.ttLib import TTFont +from fontTools.varLib.featureVars import addFeatureVariations +from fontTools.ttx import makeOutputFileName + +inputTTF = sys.argv[1] +style = sys.argv[2] + +# f = TTFont(fontPath) +f = TTFont(inputTTF) + +condSubst = [ + # A list of (Region, Substitution) tuples. + ([{"wght": (0.158, 0.564)}], {"apple", "apple.001"}), + ([{"wght": (0.868, 1)}], {"cedi", "cedi.201_230"}), + ([{"wght": (0.868, 1)}], {"cent", "cent.201_230"}), + ([{"wght": (0.868, 1)}], {"colonsign", "colonsign.201_230"}), + ([{"wght": (0.868, 1)}], {"dollar", "dollar.201_230"}), + ([{"wght": (0.868, 1)}], {"guarani", "guarani.201_230"}), + ([{"wght": (0.868, 1)}], {"dollar.tf", "dollar.tf.201_230"}), + ([{"wght": (0.868, 1)}], {"cent.tf", "cent.tf.201_230"}), + ([{"wght": (0.71, 1)}], {"naira", "naira.169_230"}), + ([{"wght": (0.71, 1)}], {"peseta", "peseta.169_230"}), + ([{"wght": (0.71, 1)}], {"won", "won.169_230"}), + ([{"wght": (0.564, 1)}], {"peso", "peso.136_230"}), + ([{"wght": (0.424, 1)}], {"curvedStemParagraphSignOrnament", "curvedStemParagraphSignOrnament.79_230"}), + ([{"wght": (0.424, 1)}], {"paragraph", "paragraph.79_230"}) +] + +if style == "Upright": + condSubst += [ + ([{"wght": (0.564, 1)}], {"Adieresis.titl", "Adieresis.titl.136_230"}), + ([{"wght": (0.564, 1)}], {"Odieresis.titl", "Odieresis.titl.136_230"}), + ] + +addFeatureVariations(f, condSubst) + +# newFontPath = fontPath.split(".")[0] + "-italic.ttf" +# f.save(fontPath) +extension = os.path.splitext(inputTTF)[1] +outputTTF = makeOutputFileName(inputTTF, '', extension) +f.save(outputTTF) \ No newline at end of file