Skip to content

Commit

Permalink
Remove SVG table to enable color-coded text on macOS Big Sur
Browse files Browse the repository at this point in the history
Remove the (experimental) SVG table to enable color-coded text on macOS Big Sur (Issue i-tu#123), following the approach implemented in upstream Source Code Pro (adobe-fonts/source-code-pro#255). See upstream issue (adobe-fonts/source-code-pro#250) for additional details.

Refactor build.sh to be more robust, consistent with revisions to upstream code
  • Loading branch information
pkq committed Dec 17, 2020
1 parent 06a0695 commit f7cbdb1
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 118 deletions.
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
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.

0 comments on commit f7cbdb1

Please sign in to comment.