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 | ########################################## |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 21 | # create symlink for given font |
| 22 | # $(1): new font $(2): link target |
| 23 | # should be used with eval: $(eval $(call ...)) |
| 24 | define create-font-symlink |
| 25 | $(PRODUCT_OUT)/system/fonts/$(1) : $(PRODUCT_OUT)/system/fonts/$(2) |
| 26 | @echo "Symlink: $$@ -> $$<" |
| 27 | @mkdir -p $$(dir $$@) |
| 28 | @rm -rf $$@ |
| 29 | $(hide) ln -sf $$(notdir $$<) $$@ |
| 30 | # this magic makes LOCAL_REQUIRED_MODULES work |
| 31 | ALL_MODULES.$(1).INSTALLED := \ |
| 32 | $(ALL_MODULES.$(1).INSTALLED) $(PRODUCT_OUT)/system/fonts/$(1) |
| 33 | endef |
| 34 | |
| 35 | ########################################## |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 36 | # We may only afford small font footprint. |
| 37 | ########################################## |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 38 | $(eval $(call create-font-symlink,DroidSans.ttf,Roboto-Regular.ttf)) |
| 39 | $(eval $(call create-font-symlink,DroidSans-Bold.ttf,Roboto-Bold.ttf)) |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 40 | |
| 41 | ################################ |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 42 | # On space-constrained devices, we include a subset of fonts: |
| 43 | ifeq ($(SMALLER_FONT_FOOTPRINT),true) |
| 44 | droidsans_fallback_src := DroidSansFallback.ttf |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 45 | extra_font_files := DroidSans.ttf DroidSans-Bold.ttf |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 46 | else |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 47 | include $(CLEAR_VARS) |
| 48 | LOCAL_MODULE := DroidSansEthiopic-Regular.ttf |
| 49 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 50 | LOCAL_MODULE_CLASS := ETC |
| 51 | LOCAL_MODULE_TAGS := optional |
| 52 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 53 | include $(BUILD_PREBUILT) |
| 54 | |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 55 | include $(CLEAR_VARS) |
Victoria Lease | bd1844d | 2012-04-26 11:18:40 -0700 | [diff] [blame] | 56 | LOCAL_MODULE := DroidSansTamil-Regular.ttf |
| 57 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 58 | LOCAL_MODULE_CLASS := ETC |
| 59 | LOCAL_MODULE_TAGS := optional |
| 60 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 61 | include $(BUILD_PREBUILT) |
| 62 | |
| 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_MODULE := DroidSansTamil-Bold.ttf |
| 65 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 66 | LOCAL_MODULE_CLASS := ETC |
| 67 | LOCAL_MODULE_TAGS := optional |
| 68 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 69 | include $(BUILD_PREBUILT) |
| 70 | |
| 71 | include $(CLEAR_VARS) |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 72 | LOCAL_MODULE := MTLmr3m.ttf |
| 73 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 74 | LOCAL_MODULE_CLASS := ETC |
| 75 | LOCAL_MODULE_TAGS := optional |
| 76 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 77 | include $(BUILD_PREBUILT) |
| 78 | |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 79 | droidsans_fallback_src := DroidSansFallbackFull.ttf |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 80 | extra_font_files := \ |
| 81 | DroidSans.ttf \ |
| 82 | DroidSans-Bold.ttf \ |
| 83 | DroidSansEthiopic-Regular.ttf \ |
Victoria Lease | bd1844d | 2012-04-26 11:18:40 -0700 | [diff] [blame] | 84 | DroidSansTamil-Regular.ttf \ |
| 85 | DroidSansTamil-Bold.ttf \ |
Billy Hewlett | ac1cbaf | 2012-07-18 09:51:45 -0700 | [diff] [blame] | 86 | MTLmr3m.ttf |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 87 | endif # SMALLER_FONT_FOOTPRINT |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 88 | |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 89 | ################################ |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 90 | include $(CLEAR_VARS) |
| 91 | LOCAL_MODULE := DroidSansFallback.ttf |
| 92 | LOCAL_SRC_FILES := $(droidsans_fallback_src) |
| 93 | LOCAL_MODULE_CLASS := ETC |
| 94 | LOCAL_MODULE_TAGS := optional |
| 95 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 96 | LOCAL_REQUIRED_MODULES := $(extra_font_files) |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 97 | include $(BUILD_PREBUILT) |
| 98 | |
| 99 | font_symlink_src := |
| 100 | font_symlink := |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 101 | droidsans_fallback_src := |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 102 | extra_font_files := |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 103 | ################################ |
| 104 | # Build the rest font files as prebuilt. |
| 105 | |
| 106 | # $(1): The source file name in LOCAL_PATH. |
| 107 | # It also serves as the module name and the dest file name. |
| 108 | define build-one-font-module |
| 109 | $(eval include $(CLEAR_VARS))\ |
| 110 | $(eval LOCAL_MODULE := $(1))\ |
| 111 | $(eval LOCAL_SRC_FILES := $(1))\ |
| 112 | $(eval LOCAL_MODULE_CLASS := ETC)\ |
| 113 | $(eval LOCAL_MODULE_TAGS := optional)\ |
| 114 | $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ |
| 115 | $(eval include $(BUILD_PREBUILT)) |
| 116 | endef |
| 117 | |
| 118 | font_src_files := \ |
| 119 | Roboto-Regular.ttf \ |
| 120 | Roboto-Bold.ttf \ |
| 121 | Roboto-Italic.ttf \ |
| 122 | Roboto-BoldItalic.ttf \ |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 123 | DroidSerif-Regular.ttf \ |
| 124 | DroidSerif-Bold.ttf \ |
| 125 | DroidSerif-Italic.ttf \ |
| 126 | DroidSerif-BoldItalic.ttf \ |
| 127 | DroidSansMono.ttf \ |
| 128 | Clockopia.ttf \ |
| 129 | AndroidClock.ttf \ |
| 130 | AndroidClock_Highlight.ttf \ |
| 131 | AndroidClock_Solid.ttf |
| 132 | |
| 133 | ifeq ($(MINIMAL_FONT_FOOTPRINT),true) |
| 134 | |
| 135 | $(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf)) |
| 136 | $(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf)) |
Raph Levien | be456f2 | 2012-09-18 15:30:02 -0700 | [diff] [blame] | 137 | $(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf)) |
| 138 | $(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf)) |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 139 | $(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf)) |
| 140 | $(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf)) |
| 141 | $(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf)) |
| 142 | $(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf)) |
| 143 | |
| 144 | else # !MINIMAL_FONT |
| 145 | font_src_files += \ |
Raph Levien | 289c09a | 2012-05-09 09:49:21 -0700 | [diff] [blame] | 146 | Roboto-Light.ttf \ |
| 147 | Roboto-LightItalic.ttf \ |
Raph Levien | be456f2 | 2012-09-18 15:30:02 -0700 | [diff] [blame] | 148 | Roboto-Thin.ttf \ |
| 149 | Roboto-ThinItalic.ttf \ |
Raph Levien | 467ea51 | 2012-05-10 17:28:20 -0700 | [diff] [blame] | 150 | RobotoCondensed-Regular.ttf \ |
| 151 | RobotoCondensed-Bold.ttf \ |
| 152 | RobotoCondensed-Italic.ttf \ |
| 153 | RobotoCondensed-BoldItalic.ttf \ |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 154 | DroidNaskh-Regular.ttf \ |
Raph Levien | 15b8c18 | 2013-03-29 16:13:36 -0700 | [diff] [blame] | 155 | DroidNaskhUI-Regular.ttf \ |
Victoria Lease | bd1844d | 2012-04-26 11:18:40 -0700 | [diff] [blame] | 156 | DroidSansDevanagari-Regular.ttf \ |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 157 | DroidSansHebrew-Regular.ttf \ |
| 158 | DroidSansHebrew-Bold.ttf \ |
| 159 | DroidSansThai.ttf \ |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 160 | DroidSansArmenian.ttf \ |
| 161 | DroidSansGeorgian.ttf \ |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 162 | AndroidEmoji.ttf |
| 163 | |
| 164 | endif # !MINIMAL_FONT |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 165 | |
| 166 | $(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) |
| 167 | |
| 168 | build-one-font-module := |
| 169 | font_src_files := |