summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2015-05-16 13:45:08 -0700
committerRoozbeh Pournader <roozbeh@google.com>2015-05-16 13:48:47 -0700
commit1d2bd3316c3dbc66632057c7052925228f4a983c (patch)
tree3854795323c71f1ee58c9455da2c1062eb910755
parent40de23b7170ef01d2521881d7c8ff307c64fbdc6 (diff)
Add make target to build Android fonts from hinted fonts.
The change is temporary, while we confirm the quality of our new build toolchain. The target should go away once we switch completely to the new toolchain. This also removes the code that removed tab and unassigned characters from the Android target, since the tab now has the same width as space and the unassigned characters are no longer in the fonts.
-rw-r--r--Makefile16
-rwxr-xr-xscripts/touchup_for_android.py10
2 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index e485e34..66343db 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,22 @@ android:
rm $$touched $$subsetted; \
done
+# TODO: remove this build target once we are comfortable with the quality of
+# the new toolchain
+android-from-hinted:
+ mkdir -p out/android
+ for source in hinted/*.ttf; do \
+ unhinted=$$(mktemp); \
+ touched=$$(mktemp); \
+ subsetted=$$(mktemp); \
+ final=out/android/$$(basename $$source); \
+ python $$HOME/noto/nototools/drop_hints.py $$source $$unhinted && \
+ python scripts/touchup_for_android.py $$unhinted $$touched && \
+ python $$HOME/noto/nototools/subset.py $$touched $$subsetted && \
+ python scripts/force_yminmax.py $$subsetted $$final && \
+ rm $$touched $$subsetted; \
+ done
+
web:
mkdir -p out/web
for source in hinted/*.ttf; do \
diff --git a/scripts/touchup_for_android.py b/scripts/touchup_for_android.py
index bd21fc5..80b8e70 100755
--- a/scripts/touchup_for_android.py
+++ b/scripts/touchup_for_android.py
@@ -175,13 +175,13 @@ def apply_android_specific_fixes(font):
hhea.descent = -500
hhea.lineGap = 0
- # Remove tab, combining keycap, the arrows, and unassigned characters
- # from the cmap table
- # https://code.google.com/a/google.com/p/roboto/issues/detail?id=51
+ # Remove combining keycap and the arrows from the cmap table:
# https://code.google.com/a/google.com/p/roboto/issues/detail?id=52
- # https://code.google.com/a/google.com/p/roboto/issues/detail?id=53
font_data.delete_from_cmap(font, [
- 0x0009, 0x20E3, 0x2072, 0x2073, 0x208F, 0x2191, 0x2193])
+ 0x20E3, # COMBINING ENCLOSING KEYCAP
+ 0x2191, # UPWARDS ARROW
+ 0x2193, # DOWNWARDS ARROW
+ ])
# Drop tables not useful on Android
for table in ['LTSH', 'hdmx', 'VDMX', 'gasp']: