Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 1 | # Copyright (C) 2011 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FIES, |
| 16 | # because SMALLER_FONT_FOOTPRINT is only available in Android.mks. |
| 17 | |
| 18 | LOCAL_PATH := $(call my-dir) |
| 19 | |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 20 | ########################################## |
| 21 | # We may only afford small font footprint. |
| 22 | ########################################## |
| 23 | # Use only symlinks. |
| 24 | # Symlink: DroidSans.ttf -> Roboto-Regular.ttf |
| 25 | LOCAL_MODULE := DroidSans.ttf |
| 26 | font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Regular.ttf |
| 27 | font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE) |
| 28 | $(font_symlink) : $(font_symlink_src) |
| 29 | @echo "Symlink: $@ -> $<" |
| 30 | @mkdir -p $(dir $@) |
| 31 | @rm -rf $@ |
| 32 | $(hide) ln -sf $(notdir $<) $@ |
| 33 | |
| 34 | # this magic makes LOCAL_REQUIRED_MODULES work |
| 35 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ |
| 36 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink) |
| 37 | |
| 38 | ################################ |
| 39 | # Symlink: DroidSans-Bold.ttf -> Roboto-Bold.ttf |
| 40 | LOCAL_MODULE := DroidSans-Bold.ttf |
| 41 | font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Bold.ttf |
| 42 | font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE) |
| 43 | $(font_symlink) : $(font_symlink_src) |
| 44 | @echo "Symlink: $@ -> $<" |
| 45 | @mkdir -p $(dir $@) |
| 46 | @rm -rf $@ |
| 47 | $(hide) ln -sf $(notdir $<) $@ |
| 48 | |
| 49 | # this magic makes LOCAL_REQUIRED_MODULES work |
| 50 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ |
| 51 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink) |
| 52 | |
| 53 | ################################ |
| 54 | include $(CLEAR_VARS) |
| 55 | LOCAL_MODULE := DroidSansEthiopic-Regular.ttf |
| 56 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 57 | LOCAL_MODULE_CLASS := ETC |
| 58 | LOCAL_MODULE_TAGS := optional |
| 59 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 60 | include $(BUILD_PREBUILT) |
| 61 | |
| 62 | ################################ |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 63 | ifeq ($(SMALLER_FONT_FOOTPRINT),true) |
| 64 | droidsans_fallback_src := DroidSansFallback.ttf |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 65 | extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 66 | else |
| 67 | droidsans_fallback_src := DroidSansFallbackFull.ttf |
| 68 | extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf DroidSansEthiopic-Regular.ttf |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 69 | endif # SMALLER_FONT_FOOTPRINT |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 70 | |
| 71 | include $(CLEAR_VARS) |
| 72 | LOCAL_MODULE := DroidSansFallback.ttf |
| 73 | LOCAL_SRC_FILES := $(droidsans_fallback_src) |
| 74 | LOCAL_MODULE_CLASS := ETC |
| 75 | LOCAL_MODULE_TAGS := optional |
| 76 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 77 | LOCAL_REQUIRED_MODULES := $(extra_droidsans_fonts) |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 78 | include $(BUILD_PREBUILT) |
| 79 | |
| 80 | font_symlink_src := |
| 81 | font_symlink := |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 82 | droidsans_fallback_src := |
| 83 | extra_droidsans_fonts := |