summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2011-10-06 11:14:13 -0700
committerYing Wang <wangying@google.com>2011-10-06 16:00:58 -0700
commit8e359817da14f6a4ffcf3bf4f7a59bc4fef8c211 (patch)
tree20579ef86aa311879c2fde554c076b4f41a967f4
parentad9c5718daa556fb6907c3f600ea505c1ec3aca0 (diff)
downloadframeworks_base-8e359817da14f6a4ffcf3bf4f7a59bc4fef8c211.zip
frameworks_base-8e359817da14f6a4ffcf3bf4f7a59bc4fef8c211.tar.gz
frameworks_base-8e359817da14f6a4ffcf3bf4f7a59bc4fef8c211.tar.bz2
Make symlinks for DroidSans.ttf and DroidSans-Bold.ttf
Bug: 5420351 Make the following symlinks: /system/fonts/DroidSans.ttf -> Roboto-Regular.ttf /system/fonts/DroidSans-Bold.ttf -> Roboto-Bold.ttf Change-Id: If9a74ef4ac2386cdb46d125fed8ce5771e872310
-rw-r--r--CleanSpec.mk1
-rw-r--r--data/fonts/Android.mk76
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 :=