diff options
-rw-r--r-- | CleanSpec.mk | 1 | ||||
-rw-r--r-- | data/fonts/Android.mk | 76 |
2 files changed, 50 insertions, 27 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk index 1c85279..9381437 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -115,6 +115,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/Lohit_Hindi.ttf) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/DroidSans*) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/DroidSans*) # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk index db27cdc..02d2f3d 100644 --- a/data/fonts/Android.mk +++ b/data/fonts/Android.mk @@ -17,45 +17,67 @@ LOCAL_PATH := $(call my-dir) -ifeq ($(SMALLER_FONT_FOOTPRINT),true) -droidsans_fallback_src := DroidSansFallback.ttf -extra_droidsans_fonts := -else -droidsans_fallback_src := DroidSansFallbackFull.ttf -extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf DroidSansEthiopic-Regular.ttf -endif +########################################## +# We may only afford small font footprint. +########################################## +# Use only symlinks. +# Symlink: DroidSans.ttf -> Roboto-Regular.ttf +LOCAL_MODULE := DroidSans.ttf +font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Regular.ttf +font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE) +$(font_symlink) : $(font_symlink_src) + @echo "Symlink: $@ -> $<" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf $(notdir $<) $@ -include $(CLEAR_VARS) -LOCAL_MODULE := DroidSansFallback.ttf -LOCAL_SRC_FILES := $(droidsans_fallback_src) -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts -LOCAL_REQUIRED_MODULES := $(extra_droidsans_fonts) -droidsans_fallback_src := -extra_droidsans_fonts := -include $(BUILD_PREBUILT) +# this magic makes LOCAL_REQUIRED_MODULES work +ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ + $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink) -include $(CLEAR_VARS) -LOCAL_MODULE := DroidSans.ttf -LOCAL_SRC_FILES := $(LOCAL_MODULE) -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts -include $(BUILD_PREBUILT) +################################ +# Symlink: DroidSans-Bold.ttf -> Roboto-Bold.ttf +LOCAL_MODULE := DroidSans-Bold.ttf +font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Bold.ttf +font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE) +$(font_symlink) : $(font_symlink_src) + @echo "Symlink: $@ -> $<" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf $(notdir $<) $@ + +# this magic makes LOCAL_REQUIRED_MODULES work +ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ + $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink) +################################ include $(CLEAR_VARS) -LOCAL_MODULE := DroidSans-Bold.ttf +LOCAL_MODULE := DroidSansEthiopic-Regular.ttf LOCAL_SRC_FILES := $(LOCAL_MODULE) LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_TAGS := optional LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts include $(BUILD_PREBUILT) +################################ +ifeq ($(SMALLER_FONT_FOOTPRINT),true) +droidsans_fallback_src := DroidSansFallback.ttf +extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf +else +droidsans_fallback_src := DroidSansFallbackFull.ttf +extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf DroidSansEthiopic-Regular.ttf +endif # SMALLER_FONT_FOOTPRINT + include $(CLEAR_VARS) -LOCAL_MODULE := DroidSansEthiopic-Regular.ttf -LOCAL_SRC_FILES := $(LOCAL_MODULE) +LOCAL_MODULE := DroidSansFallback.ttf +LOCAL_SRC_FILES := $(droidsans_fallback_src) LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_TAGS := optional LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts +LOCAL_REQUIRED_MODULES := $(extra_droidsans_fonts) include $(BUILD_PREBUILT) + +font_symlink_src := +font_symlink := +droidsans_fallback_src := +extra_droidsans_fonts := |