From f7cbdb1870d235e39ece84cced61f727612340f1 Mon Sep 17 00:00:00 2001 From: Patrick Kennedy Date: Thu, 17 Dec 2020 11:35:04 -0800 Subject: [PATCH] Remove SVG table to enable color-coded text on macOS Big Sur Remove the (experimental) SVG table to enable color-coded text on macOS Big Sur (Issue #123), following the approach implemented in upstream Source Code Pro (https://github.com/adobe-fonts/source-code-pro/pull/255). See upstream issue (https://github.com/adobe-fonts/source-code-pro/issues/250) for additional details. Refactor build.sh to be more robust, consistent with revisions to upstream code --- .gitignore | 2 ++ GlyphOrderAndAliasDB | 15 ------------- build.cmd | 4 ++-- build.sh | 50 ++++++++++++++++++++++++++--------------- svg/u1F3B5_uniFE0F.svg | 3 --- svg/u1F3B6_uniFE0F.svg | 3 --- svg/u1F4A9_uniFE0F.svg | 7 ------ svg/u1F512_uniFE0F.svg | 4 ---- svg/u1F916_uniFE0F.svg | 13 ----------- svg/uni2611_uniFE0F.svg | 5 ----- svg/uni2615_uniFE0F.svg | 8 ------- svg/uni263A_uniFE0F.svg | 14 ------------ svg/uni263B_uniFE0F.svg | 14 ------------ svg/uni2665_uniFE0F.svg | 3 --- svg/uni2666_uniFE0F.svg | 3 --- svg/uni2713_uniFE0F.svg | 3 --- svg/uni2764_uniFE0F.svg | 3 --- 17 files changed, 36 insertions(+), 118 deletions(-) delete mode 100644 svg/u1F3B5_uniFE0F.svg delete mode 100644 svg/u1F3B6_uniFE0F.svg delete mode 100644 svg/u1F4A9_uniFE0F.svg delete mode 100644 svg/u1F512_uniFE0F.svg delete mode 100644 svg/u1F916_uniFE0F.svg delete mode 100644 svg/uni2611_uniFE0F.svg delete mode 100644 svg/uni2615_uniFE0F.svg delete mode 100644 svg/uni263A_uniFE0F.svg delete mode 100644 svg/uni263B_uniFE0F.svg delete mode 100644 svg/uni2665_uniFE0F.svg delete mode 100644 svg/uni2666_uniFE0F.svg delete mode 100644 svg/uni2713_uniFE0F.svg delete mode 100644 svg/uni2764_uniFE0F.svg diff --git a/.gitignore b/.gitignore index 77cc781b74..71b96e1f74 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ RomanMasters/colors_2 ItalicMasters/colors_0 ItalicMasters/colors_1 ItalicMasters/colors_2 + +afdko_env/ diff --git a/GlyphOrderAndAliasDB b/GlyphOrderAndAliasDB index ac0e422d32..005a3cb18f 100644 --- a/GlyphOrderAndAliasDB +++ b/GlyphOrderAndAliasDB @@ -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 diff --git a/build.cmd b/build.cmd index d5cc7fe8c3..b8cf1f8df3 100644 --- a/build.cmd +++ b/build.cmd @@ -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 diff --git a/build.sh b/build.sh index de5b60c9e5..aedb0722b4 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/svg/u1F3B5_uniFE0F.svg b/svg/u1F3B5_uniFE0F.svg deleted file mode 100644 index be00901da7..0000000000 --- a/svg/u1F3B5_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/svg/u1F3B6_uniFE0F.svg b/svg/u1F3B6_uniFE0F.svg deleted file mode 100644 index 72398189c2..0000000000 --- a/svg/u1F3B6_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/svg/u1F4A9_uniFE0F.svg b/svg/u1F4A9_uniFE0F.svg deleted file mode 100644 index 227f6e6592..0000000000 --- a/svg/u1F4A9_uniFE0F.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/svg/u1F512_uniFE0F.svg b/svg/u1F512_uniFE0F.svg deleted file mode 100644 index 9164676a37..0000000000 --- a/svg/u1F512_uniFE0F.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/svg/u1F916_uniFE0F.svg b/svg/u1F916_uniFE0F.svg deleted file mode 100644 index 83f08cbf18..0000000000 --- a/svg/u1F916_uniFE0F.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/svg/uni2611_uniFE0F.svg b/svg/uni2611_uniFE0F.svg deleted file mode 100644 index 4d121fd7d4..0000000000 --- a/svg/uni2611_uniFE0F.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/svg/uni2615_uniFE0F.svg b/svg/uni2615_uniFE0F.svg deleted file mode 100644 index 8c825a93b5..0000000000 --- a/svg/uni2615_uniFE0F.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/svg/uni263A_uniFE0F.svg b/svg/uni263A_uniFE0F.svg deleted file mode 100644 index e53a380456..0000000000 --- a/svg/uni263A_uniFE0F.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/svg/uni263B_uniFE0F.svg b/svg/uni263B_uniFE0F.svg deleted file mode 100644 index 9da86d480a..0000000000 --- a/svg/uni263B_uniFE0F.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/svg/uni2665_uniFE0F.svg b/svg/uni2665_uniFE0F.svg deleted file mode 100644 index 7ec3daedd0..0000000000 --- a/svg/uni2665_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/svg/uni2666_uniFE0F.svg b/svg/uni2666_uniFE0F.svg deleted file mode 100644 index feeba36b65..0000000000 --- a/svg/uni2666_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/svg/uni2713_uniFE0F.svg b/svg/uni2713_uniFE0F.svg deleted file mode 100644 index abe60a36a9..0000000000 --- a/svg/uni2713_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/svg/uni2764_uniFE0F.svg b/svg/uni2764_uniFE0F.svg deleted file mode 100644 index 484ffb016d..0000000000 --- a/svg/uni2764_uniFE0F.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -