diff options
20 files changed, 58 insertions, 0 deletions
diff --git a/out/RobotoCondensedTTF/RobotoCondensed-Bold.ttf b/out/RobotoCondensedTTF/RobotoCondensed-Bold.ttf Binary files differindex bfb565c..901c708 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-Bold.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-Bold.ttf diff --git a/out/RobotoCondensedTTF/RobotoCondensed-BoldItalic.ttf b/out/RobotoCondensedTTF/RobotoCondensed-BoldItalic.ttf Binary files differindex d08d2b3..3ecb90b 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-BoldItalic.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-BoldItalic.ttf diff --git a/out/RobotoCondensedTTF/RobotoCondensed-Italic.ttf b/out/RobotoCondensedTTF/RobotoCondensed-Italic.ttf Binary files differindex 46b767a..986f81c 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-Italic.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-Italic.ttf diff --git a/out/RobotoCondensedTTF/RobotoCondensed-Light.ttf b/out/RobotoCondensedTTF/RobotoCondensed-Light.ttf Binary files differindex 5aa6bfc..6e4e2ea 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-Light.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-Light.ttf diff --git a/out/RobotoCondensedTTF/RobotoCondensed-LightItalic.ttf b/out/RobotoCondensedTTF/RobotoCondensed-LightItalic.ttf Binary files differindex a15705c..29ae84b 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-LightItalic.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-LightItalic.ttf diff --git a/out/RobotoCondensedTTF/RobotoCondensed-Regular.ttf b/out/RobotoCondensedTTF/RobotoCondensed-Regular.ttf Binary files differindex e69a167..4298dea 100644 --- a/out/RobotoCondensedTTF/RobotoCondensed-Regular.ttf +++ b/out/RobotoCondensedTTF/RobotoCondensed-Regular.ttf diff --git a/out/RobotoTTF/Roboto-Black.ttf b/out/RobotoTTF/Roboto-Black.ttf Binary files differindex 5de056c..1d15caa 100644 --- a/out/RobotoTTF/Roboto-Black.ttf +++ b/out/RobotoTTF/Roboto-Black.ttf diff --git a/out/RobotoTTF/Roboto-BlackItalic.ttf b/out/RobotoTTF/Roboto-BlackItalic.ttf Binary files differindex 8df9343..ea35b0b 100644 --- a/out/RobotoTTF/Roboto-BlackItalic.ttf +++ b/out/RobotoTTF/Roboto-BlackItalic.ttf diff --git a/out/RobotoTTF/Roboto-Bold.ttf b/out/RobotoTTF/Roboto-Bold.ttf Binary files differindex 1158b8a..de790fd 100644 --- a/out/RobotoTTF/Roboto-Bold.ttf +++ b/out/RobotoTTF/Roboto-Bold.ttf diff --git a/out/RobotoTTF/Roboto-BoldItalic.ttf b/out/RobotoTTF/Roboto-BoldItalic.ttf Binary files differindex 0fdbea9..49a41d6 100644 --- a/out/RobotoTTF/Roboto-BoldItalic.ttf +++ b/out/RobotoTTF/Roboto-BoldItalic.ttf diff --git a/out/RobotoTTF/Roboto-Italic.ttf b/out/RobotoTTF/Roboto-Italic.ttf Binary files differindex 6ed2d7d..345febe 100644 --- a/out/RobotoTTF/Roboto-Italic.ttf +++ b/out/RobotoTTF/Roboto-Italic.ttf diff --git a/out/RobotoTTF/Roboto-Light.ttf b/out/RobotoTTF/Roboto-Light.ttf Binary files differindex bb75063..559eaef 100644 --- a/out/RobotoTTF/Roboto-Light.ttf +++ b/out/RobotoTTF/Roboto-Light.ttf diff --git a/out/RobotoTTF/Roboto-LightItalic.ttf b/out/RobotoTTF/Roboto-LightItalic.ttf Binary files differindex 9e335c2..00ed18d 100644 --- a/out/RobotoTTF/Roboto-LightItalic.ttf +++ b/out/RobotoTTF/Roboto-LightItalic.ttf diff --git a/out/RobotoTTF/Roboto-Medium.ttf b/out/RobotoTTF/Roboto-Medium.ttf Binary files differindex 1f5e9a7..7787a51 100644 --- a/out/RobotoTTF/Roboto-Medium.ttf +++ b/out/RobotoTTF/Roboto-Medium.ttf diff --git a/out/RobotoTTF/Roboto-MediumItalic.ttf b/out/RobotoTTF/Roboto-MediumItalic.ttf Binary files differindex ca12c0e..de787a7 100644 --- a/out/RobotoTTF/Roboto-MediumItalic.ttf +++ b/out/RobotoTTF/Roboto-MediumItalic.ttf diff --git a/out/RobotoTTF/Roboto-Regular.ttf b/out/RobotoTTF/Roboto-Regular.ttf Binary files differindex 79401ea..d435eca 100644 --- a/out/RobotoTTF/Roboto-Regular.ttf +++ b/out/RobotoTTF/Roboto-Regular.ttf diff --git a/out/RobotoTTF/Roboto-Thin.ttf b/out/RobotoTTF/Roboto-Thin.ttf Binary files differindex 18f40ff..164b33d 100644 --- a/out/RobotoTTF/Roboto-Thin.ttf +++ b/out/RobotoTTF/Roboto-Thin.ttf diff --git a/out/RobotoTTF/Roboto-ThinItalic.ttf b/out/RobotoTTF/Roboto-ThinItalic.ttf Binary files differindex 5ff83cb..7e00da0 100644 --- a/out/RobotoTTF/Roboto-ThinItalic.ttf +++ b/out/RobotoTTF/Roboto-ThinItalic.ttf diff --git a/scripts/final_touchup.py b/scripts/final_touchup.py index 5e02070..d6dfbb0 100755 --- a/scripts/final_touchup.py +++ b/scripts/final_touchup.py @@ -5,6 +5,45 @@ from os import path import sys from fontTools import ttLib +from nototools import font_data + + +def drop_lookup(table, lookup_number): + """Drop a lookup from an OpenType table by number. + + Actually remove pointers from features to the lookup, which should be less + intrusive. + """ + for feature in table.table.FeatureList.FeatureRecord: + if lookup_number in feature.Feature.LookupListIndex: + feature.Feature.LookupListIndex.remove(lookup_number) + feature.Feature.LookupCount -= 1 + + +def apply_temporary_fixes(font): + """Apply some temporary fixes needed for Android.""" + # Remove tab, combining keycap, and the arrows from the cmap table + font_data.delete_from_cmap(font, [0x0009, 0x20E3, 0x2191, 0x2193]) + + # Drop the lookup forming the ff ligature + drop_lookup(font['GSUB'], 5) + + # Drop tables not useful on Android + for table in ['LTSH', 'hdmx', 'VDMX', 'gasp']: + if table in font: + del font[table] + + # Fix version to 2.000981 + version_record = 'Version 2.000981; 2014' + for record in font['name'].names: + if record.nameID == 5: + if record.platformID == 1 and record.platEncID == 0: # MacRoman + record.string = version_record + elif record.platformID == 3 and record.platEncID == 1: + # Windows UCS-2 + record.string = version_record.encode('UTF-16BE') + else: + assert False def correct_font(source_font_name, target_font_name): @@ -25,6 +64,12 @@ def correct_font(source_font_name, target_font_name): italic = 'Italic' in basename head.macStyle = (italic << 1) | bold + os2 = font['OS/2'] + os2.fsType = 0 + os2.achVendID = 'GOOG' + + apply_temporary_fixes(font) + font.save(target_font_name) diff --git a/scripts/render.sh b/scripts/render.sh new file mode 100755 index 0000000..703c21f --- /dev/null +++ b/scripts/render.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +HARFBUZZ=$HOME/harfbuzz + +function render { + echo weT͟Hər | $HARFBUZZ/util/hb-view --font-file=$1 --output-format=png --output-file=$2.png +} + +render ../out/RobotoTTF/Roboto-Regular.ttf original +render Roboto-Regular.ttf modified + +eog *.png + |