-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from RedHatOfficial/custom-variable-fonts
Adds a modified version of the variable font for RedHat.com
- Loading branch information
Showing
23 changed files
with
760 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
.DS_Store | ||
|
||
# Ignore virtual environment Python files for compiling the font. | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# if [ -z "$1" ] | ||
# then | ||
# echo "No version number supplied. If you wish to update the version number in UFOs & built fonts, add one as a build argument:" | ||
# echo "sources/build-vf.sh 1.000" | ||
# else | ||
# version=$1 | ||
# python mastering/scripts/edit-ufo-info/set-ufo-version.py sources/Mono $version --save | ||
# fi | ||
|
||
## ------------------------------------------------------------------ | ||
## Variable Fonts Build - Static build is at sources/build-statics.sh | ||
|
||
echo "Generating VFs modified for RedHat.com" | ||
mkdir -p fonts/mono/ | ||
mkdir -p fonts/proportional/ | ||
|
||
# Mono fonts are _not_ modified for RedHat.com. | ||
fontmake -m source/Mono/VF/RedHatMonoVF.designspace -o variable --no-production-names --output-path fonts/mono/RedHatMonoVF.ttf | ||
fontmake -m source/Mono/VF/RedHatMonoVFItalic.designspace -o variable --no-production-names --output-path fonts/mono/RedHatMonoVF-Italic.ttf | ||
#split the mono out and put it in fonts/mono/ | ||
|
||
#split the proportional out and put them in fonts/proportional | ||
fontmake -m source/Proportional/VF/Modified-RedHatTextVF.designspace -o variable --no-production-names --output-path fonts/proportional/RedHatTextVFModified.ttf | ||
fontmake -m source/Proportional/VF/Modified-RedHatTextItalicVF.designspace -o variable --no-production-names --output-path fonts/proportional/RedHatTextVF-ItalicModified.ttf | ||
fontmake -m source/Proportional/VF/Modified-RedHatDisplayVF.designspace -o variable --no-production-names --output-path fonts/proportional/RedHatDisplayVFModified.ttf | ||
fontmake -m source/Proportional/VF/Modified-RedHatDisplayItalicVF.designspace -o variable --no-production-names --output-path fonts/proportional/RedHatDisplayVF-ItalicModified.ttf | ||
|
||
|
||
|
||
mvfs=$(ls fonts/mono/*.ttf) | ||
echo mvfs | ||
echo "Post processing VFs" | ||
for vf in $mvfs | ||
do | ||
gftools fix-dsig -f $vf; | ||
#python mastering/scripts/fix_naming.py $vf; | ||
#ttfautohint-vf --stem-width-mode nnn $vf "$vf.fix"; | ||
#mv "$vf.fix" $vf; | ||
done | ||
|
||
vfs=$(ls fonts/proportional/*.ttf) | ||
echo vfs | ||
echo "Post processing VFs" | ||
for vf in $vfs | ||
do | ||
gftools fix-dsig -f $vf; | ||
done | ||
|
||
echo "Fixing mono non Hinting" | ||
for vf in $mvfs | ||
do | ||
gftools fix-nonhinting $vf "$vf.fix"; | ||
if [ -f "$vf.fix" ]; then mv "$vf.fix" $vf; fi | ||
done | ||
|
||
echo "Fixing proportional non Hinting" | ||
for vf in $vfs | ||
do | ||
gftools fix-nonhinting $vf "$vf.fix"; | ||
if [ -f "$vf.fix" ]; then mv "$vf.fix" $vf; fi | ||
done | ||
|
||
echo "Add STAT table" | ||
# Using a copy of the gen_stat.py script from texturina, to try and sort this once and for all. | ||
python mastering/gen_stat_mono.py | ||
python mastering/gen_stat_text.py | ||
python mastering/gen_stat_disp.py | ||
|
||
echo "stat add complete" | ||
|
||
|
||
rm -rf fonts/mono/*gasp* | ||
rm -rf fonts/proportional/*gasp* | ||
|
||
echo "Remove unwanted fvar instances" | ||
for vf in $mvfs | ||
do | ||
python mastering/scripts/removeUnwantedVFInstances.py $vf | ||
done | ||
|
||
echo "Dropping MVAR" | ||
for vf in $mvfs | ||
do | ||
# mv "$vf.fix" $vf; | ||
ttx -f -x "MVAR" $vf; # Drop MVAR. Table has issue in DW | ||
rtrip=$(basename -s .ttf $vf) | ||
new_file=fonts/mono/$rtrip.ttx; | ||
rm $vf; | ||
ttx $new_file | ||
rm $new_file | ||
done | ||
|
||
echo "Fix name table" | ||
for vf in $mvfs | ||
do | ||
python mastering/scripts/fixNameTable.py $vf | ||
done | ||
|
||
|
||
|
||
echo "Remove unwanted fvar instances" | ||
for vf in $vfs | ||
do | ||
python mastering/scripts/removeUnwantedVFInstances.py $vf | ||
done | ||
|
||
echo "Dropping MVAR" | ||
for vf in $vfs | ||
do | ||
# mv "$vf.fix" $vf; | ||
ttx -f -x "MVAR" $vf; # Drop MVAR. Table has issue in DW | ||
rtrip=$(basename -s .ttf $vf) | ||
new_file=fonts/proportional/$rtrip.ttx; | ||
rm $vf; | ||
ttx $new_file | ||
rm $new_file | ||
done | ||
|
||
echo "Fix name table" | ||
for vf in $vfs | ||
do | ||
python mastering/scripts/fixNameTable.py $vf | ||
done | ||
|
||
|
||
### Cleanup | ||
|
||
|
||
rm -rf ./*/instances/ | ||
rm -f fonts/*.ttx | ||
rm -f fonts/static/ttf/*.ttx | ||
rm -f fonts/*gasp.ttf | ||
rm -f fonts/static/ttf/*gasp.ttf | ||
|
||
# ## ------------------------------------------------------------- | ||
# ## Improving version string detail | ||
|
||
# echo "----------------------------------------------------------------------------------" | ||
# echo "Adding the current commit hash to variable font version strings" | ||
# font-v write --sha1 "fonts/RedHatMono[wght].ttf" | ||
# font-v write --sha1 "fonts/RedHatMono-Italic[wght].ttf" | ||
|
||
echo "Done Generating Modified Variable Fonts" | ||
|
||
# # # You should check the fonts now with fontbakery, and generate a markdown file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
source/Proportional/VF/Modified-RedHatDisplayItalicVF.designspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<designspace format="4.1"> | ||
<axes> | ||
<axis tag="wght" name="Weight" minimum="300" maximum="900" default="300"> | ||
<labelname xml:lang="en">Weight</labelname> | ||
<map input="300" output="300"/> | ||
<map input="400" output="500"/> | ||
<map input="700" output="757.700000"/> | ||
<map input="900" output="900"/> | ||
</axis> | ||
</axes> | ||
<sources> | ||
<source filename="RedHatDisplayVF-Italic.ufo" familyname="Red Hat Display VF" stylename="Light Italic"> | ||
<lib copy="1"/> | ||
<groups copy="1"/> | ||
<features copy="1"/> | ||
<info copy="1"/> | ||
<location> | ||
<dimension name="Weight" xvalue="300"/> | ||
</location> | ||
</source> | ||
<source filename="RedHatDisplayVF-BlackItalic.ufo" familyname="Red Hat Display VF" stylename="Black Italic"> | ||
<location> | ||
<dimension name="Weight" xvalue="900"/> | ||
</location> | ||
</source> | ||
</sources> | ||
<instances> | ||
<instance familyname="Red Hat Display VF" stylename="Black Italic" filename="instances/RedHatDisplayVF-BlackItalic.ufo" postscriptfontname="RedHatDisplayVF-BlackItalic"> | ||
<location> | ||
<dimension name="Weight" xvalue="900"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Display VF" stylename="Light Italic" filename="instances/RedHatDisplayVF-Italic.ufo" postscriptfontname="RedHatDisplayVF-Italic"> | ||
<location> | ||
<dimension name="Weight" xvalue="300"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Display VF" stylename="Bold Italic" filename="instances/RedHatDisplayVF-BoldItalic.ufo" postscriptfontname="RedHatDisplayVF-BoldItalic"> | ||
<location> | ||
<dimension name="Weight" xvalue="757.700000"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
</instances> | ||
<lib> | ||
<dict> | ||
<key>com.letterror.mathModelPref</key> | ||
<string>previewVarLib</string> | ||
</dict> | ||
</lib> | ||
</designspace> |
57 changes: 57 additions & 0 deletions
57
source/Proportional/VF/Modified-RedHatDisplayVF.designspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<designspace format="4.1"> | ||
<axes> | ||
<axis tag="wght" name="Weight" minimum="300" maximum="900" default="300"> | ||
<labelname xml:lang="en">Weight</labelname> | ||
<map input="300" output="300"/> | ||
<map input="400" output="500"/> | ||
<map input="700" output="757.700000"/> | ||
<map input="900" output="900"/> | ||
</axis> | ||
</axes> | ||
<sources> | ||
<source filename="RedHatDisplayVF-Regular.ufo" familyname="Red Hat Display VF" stylename="Light"> | ||
<lib copy="1"/> | ||
<groups copy="1"/> | ||
<features copy="1"/> | ||
<info copy="1"/> | ||
<location> | ||
<dimension name="Weight" xvalue="300"/> | ||
</location> | ||
</source> | ||
<source filename="RedHatDisplayVF-Black.ufo" familyname="Red Hat Display VF" stylename="Black"> | ||
<location> | ||
<dimension name="Weight" xvalue="900"/> | ||
</location> | ||
</source> | ||
</sources> | ||
<instances> | ||
<instance familyname="Red Hat Display VF" stylename="Black" filename="instances/RedHatDisplayVF-Black.ufo" postscriptfontname="RedHatDisplayVF-Black"> | ||
<location> | ||
<dimension name="Weight" xvalue="900"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Display VF" stylename="Light" filename="instances/RedHatDisplayVF-Regular.ufo" postscriptfontname="RedHatDisplayVF-Regular"> | ||
<location> | ||
<dimension name="Weight" xvalue="300"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Display VF" stylename="Bold" filename="instances/RedHatDisplayVF-Bold.ufo" postscriptfontname="RedHatDisplayVF-Bold"> | ||
<location> | ||
<dimension name="Weight" xvalue="757.700000"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
</instances> | ||
<lib> | ||
<dict> | ||
<key>com.letterror.mathModelPref</key> | ||
<string>previewVarLib</string> | ||
</dict> | ||
</lib> | ||
</designspace> |
52 changes: 52 additions & 0 deletions
52
source/Proportional/VF/Modified-RedHatTextItalicVF.designspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<designspace format="4.1"> | ||
<axes> | ||
<axis tag="wght" name="Weight" minimum="400" maximum="700" default="400"> | ||
<labelname xml:lang="en">Weight</labelname> | ||
<map input="400" output="400"/> | ||
<map input="500" output="535.800000"/> | ||
<map input="700" output="700"/> | ||
</axis> | ||
</axes> | ||
<sources> | ||
<source filename="RedHatTextVF-Italic.ufo" familyname="Red Hat Text VF" stylename="Italic"> | ||
<location> | ||
<dimension name="Weight" xvalue="400"/> | ||
</location> | ||
</source> | ||
<source filename="RedHatTextVF-BoldItalic.ufo" familyname="Red Hat Text VF" stylename="Bold Italic"> | ||
<location> | ||
<dimension name="Weight" xvalue="700"/> | ||
</location> | ||
</source> | ||
</sources> | ||
<instances> | ||
<instance familyname="Red Hat Text VF" stylename="Medium Italic" filename="instances/RedHatTextVF-MediumItalic.ufo" postscriptfontname="RedHatTextVF-MediumItalic"> | ||
<location> | ||
<dimension name="Weight" xvalue="535.800000"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Text VF" stylename="Bold Italic" filename="instances/RedHatTextVF-BoldItalic.ufo" postscriptfontname="RedHatTextVF-BoldItalic"> | ||
<location> | ||
<dimension name="Weight" xvalue="700"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
<instance familyname="Red Hat Text VF" stylename="Italic" filename="instances/RedHatTextVF-Italic.ufo" postscriptfontname="RedHatTextVF-Italic"> | ||
<location> | ||
<dimension name="Weight" xvalue="400"/> | ||
</location> | ||
<kerning/> | ||
<info/> | ||
</instance> | ||
</instances> | ||
<lib> | ||
<dict> | ||
<key>com.letterror.mathModelPref</key> | ||
<string>previewVarLib</string> | ||
</dict> | ||
</lib> | ||
</designspace> |
Oops, something went wrong.