Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SVG table to enable color-coded text on macOS Big Sur #125

Merged
merged 2 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ RomanMasters/colors_2
ItalicMasters/colors_0
ItalicMasters/colors_1
ItalicMasters/colors_2

afdko_env/
15 changes: 0 additions & 15 deletions GlyphOrderAndAliasDB
Original file line number Diff line number Diff line change
Expand Up @@ -1561,21 +1561,6 @@ uniFE0E text
uniFE0F emoji
u1F3B5 notemusical
u1F3B6 notesmusical
u1F3B5_uniFE0F notemusical.e
u1F3B6_uniFE0F notesmusical.e
uni2611_uniFE0F checkedbox.e
uni2713_uniFE0F check.e
uni2665_uniFE0F heart.e
uni2663_uniFE0F club.e
uni2666_uniFE0F diamond.e
uni2660_uniFE0F spade.e
uni263A_uniFE0F smileface.e
uni263B_uniFE0F invsmileface.e
uni2764_uniFE0F heartblackheavy.e
uni2615_uniFE0F coffee.e
u1F4A9_uniFE0F poop.e
u1F916_uniFE0F robot.e
u1F512_uniFE0F lock.e
f_i fi uniFB01
f_l fl uniFB02
uniE0A0 uniE0A0
Expand Down
3 changes: 3 additions & 0 deletions ItalicMasters/SourceCodePro-It.designspace
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<designspace format="3">
<axes>
<axis default="0.0" maximum="1000.0" minimum="0.0" name="weight" tag="wght" />
</axes>
<sources>
<source filename="SourceCodePro-Italic_0.ufo" name="master_0">
<lib copy="1"/>
Expand Down
3 changes: 3 additions & 0 deletions RomanMasters/SourceCodePro.designspace
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<designspace format="3">
<axes>
<axis default="0.0" maximum="1000.0" minimum="0.0" name="weight" tag="wght" />
</axes>
<sources>
<source filename="SourceCodePro_0.ufo" name="master_0">
<lib copy="1" />
Expand Down
4 changes: 2 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ call makeotf -f "%~dp0\%1\%2\font.ufo" -r -o "%TARGET_OTF_PATH%\%FAMILY%-%2.otf"
call makeotf -f "%~dp0\%1\%2\font.ttf" -r -o "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf"
:: remove default options file from the source tree after building
del "%~dp0\%1\%2\current.fpr"
"%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_OTF_PATH%\%FAMILY%-%2.otf" "%~dp0\svg"
"%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf" "%~dp0\svg"
:: "%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_OTF_PATH%\%FAMILY%-%2.otf" "%~dp0\svg"
:: "%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf" "%~dp0\svg"
goto :eof

:error_makeotf_not_found
Expand Down
50 changes: 32 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
#!/bin/sh
#!/usr/bin/env sh

family=Hasklig
romanWeights='Black Bold ExtraLight Light Medium Regular Semibold'
italicWeights='BlackIt BoldIt ExtraLightIt LightIt MediumIt It SemiboldIt'
set -e

# path to Python script that adds the SVG table
addSVG=$(cd $(dirname "$0") && pwd -P)/addSVGtable.py
roman_weights=(Black Bold ExtraLight Light Medium Regular Semibold)
italic_weights=(BlackIt BoldIt ExtraLightIt LightIt MediumIt It SemiboldIt)

# path to UVS file
UVS=$(cd $(dirname "$0") && pwd -P)/uvs.txt
# get absolute path to bash script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# clean existing build artifacts
rm -rf target/
otfDir="target/"
mkdir -p $otfDir
rm -rf $DIR/target/
otf_dir="$DIR/target/OTF"
mkdir -p $otf_dir

for w in $romanWeights
function build_font {
# $1 is Roman or Italic
# $2 is weight name
font_dir=$DIR/$1/$2
font_ufo=$font_dir/font.ufo
ps_name=$family-$2
echo $ps_name
echo "Building OTF ..."
# -r is for "release mode"
# (subroutinization + applied glyph order)
makeotf -f $font_ufo -r -omitMacNames

# move font files to target directory
mv $font_dir/$ps_name.otf $otf_dir
echo "Done with $ps_name"
echo ""
echo ""
}

for w in ${roman_weights[@]}
do
makeotf -f Roman/$w/font.ufo -r -ci "$UVS" -o $otfDir/$family-$w.otf
rm Roman/$w/current.fpr # remove default options file from the source tree after building
"$addSVG" $otfDir/$family-$w.otf svg
build_font Roman $w
done

for w in $italicWeights
for w in ${italic_weights[@]}
do
makeotf -f Italic/$w/font.ufo -r -ci "$UVS" -o $otfDir/$family-$w.otf
rm Italic/$w/current.fpr # remove default options file from the source tree after building
"$addSVG" $otfDir/$family-$w.otf svg
build_font Italic $w
done
3 changes: 0 additions & 3 deletions svg/u1F3B5_uniFE0F.svg

This file was deleted.

3 changes: 0 additions & 3 deletions svg/u1F3B6_uniFE0F.svg

This file was deleted.

7 changes: 0 additions & 7 deletions svg/u1F4A9_uniFE0F.svg

This file was deleted.

4 changes: 0 additions & 4 deletions svg/u1F512_uniFE0F.svg

This file was deleted.

13 changes: 0 additions & 13 deletions svg/u1F916_uniFE0F.svg

This file was deleted.

5 changes: 0 additions & 5 deletions svg/uni2611_uniFE0F.svg

This file was deleted.

8 changes: 0 additions & 8 deletions svg/uni2615_uniFE0F.svg

This file was deleted.

14 changes: 0 additions & 14 deletions svg/uni263A_uniFE0F.svg

This file was deleted.

14 changes: 0 additions & 14 deletions svg/uni263B_uniFE0F.svg

This file was deleted.

3 changes: 0 additions & 3 deletions svg/uni2665_uniFE0F.svg

This file was deleted.

3 changes: 0 additions & 3 deletions svg/uni2666_uniFE0F.svg

This file was deleted.

3 changes: 0 additions & 3 deletions svg/uni2713_uniFE0F.svg

This file was deleted.

3 changes: 0 additions & 3 deletions svg/uni2764_uniFE0F.svg

This file was deleted.