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 | ########################################## |
Victoria Lease | a08f0f8 | 2014-05-12 16:05:52 -0700 | [diff] [blame] | 36 | # The following fonts are distributed as symlink only. |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 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)) |
Victoria Lease | a08f0f8 | 2014-05-12 16:05:52 -0700 | [diff] [blame] | 40 | $(eval $(call create-font-symlink,DroidSerif-Regular.ttf,NotoSerif-Regular.ttf)) |
| 41 | $(eval $(call create-font-symlink,DroidSerif-Bold.ttf,NotoSerif-Bold.ttf)) |
| 42 | $(eval $(call create-font-symlink,DroidSerif-Italic.ttf,NotoSerif-Italic.ttf)) |
| 43 | $(eval $(call create-font-symlink,DroidSerif-BoldItalic.ttf,NotoSerif-BoldItalic.ttf)) |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 44 | |
Victoria Lease | f99c12c | 2014-06-13 07:56:58 -0700 | [diff] [blame] | 45 | extra_font_files := \ |
| 46 | DroidSans.ttf \ |
| 47 | DroidSans-Bold.ttf |
| 48 | |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 49 | ################################ |
Roozbeh Pournader | 32a65c7 | 2014-07-24 14:36:04 -0700 | [diff] [blame] | 50 | # Do not include Motoya on space-constrained devices |
| 51 | ifneq ($(SMALLER_FONT_FOOTPRINT),true) |
Victoria Lease | f99c12c | 2014-06-13 07:56:58 -0700 | [diff] [blame] | 52 | |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 53 | include $(CLEAR_VARS) |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 54 | LOCAL_MODULE := MTLmr3m.ttf |
| 55 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 56 | LOCAL_MODULE_CLASS := ETC |
| 57 | LOCAL_MODULE_TAGS := optional |
| 58 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 59 | include $(BUILD_PREBUILT) |
Victoria Lease | f99c12c | 2014-06-13 07:56:58 -0700 | [diff] [blame] | 60 | extra_font_files += MTLmr3m.ttf |
Russell Brenner | 1c097a9 | 2012-03-28 09:45:27 -0700 | [diff] [blame] | 61 | |
Roozbeh Pournader | 32a65c7 | 2014-07-24 14:36:04 -0700 | [diff] [blame] | 62 | endif # !SMALLER_FONT_FOOTPRINT |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 63 | |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 64 | ################################ |
Roozbeh Pournader | 32a65c7 | 2014-07-24 14:36:04 -0700 | [diff] [blame] | 65 | # Use DroidSansMono to hang extra_font_files on |
| 66 | include $(CLEAR_VARS) |
| 67 | LOCAL_MODULE := DroidSansMono.ttf |
| 68 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 69 | LOCAL_MODULE_CLASS := ETC |
| 70 | LOCAL_MODULE_TAGS := optional |
| 71 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
| 72 | LOCAL_REQUIRED_MODULES := $(extra_font_files) |
| 73 | include $(BUILD_PREBUILT) |
| 74 | extra_font_files := |
| 75 | |
| 76 | ################################ |
| 77 | # Include DroidSansFallback only on non-EXTENDED_FONT_FOOTPRINT builds |
| 78 | ifneq ($(EXTENDED_FONT_FOOTPRINT),true) |
| 79 | |
| 80 | # Include a subset of DroidSansFallback on SMALLER_FONT_FOOTPRINT build |
| 81 | ifeq ($(SMALLER_FONT_FOOTPRINT),true) |
| 82 | droidsans_fallback_src := DroidSansFallback.ttf |
| 83 | else # !SMALLER_FONT_FOOTPRINT |
| 84 | droidsans_fallback_src := DroidSansFallbackFull.ttf |
| 85 | endif # SMALLER_FONT_FOOTPRINT |
| 86 | |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := DroidSansFallback.ttf |
| 89 | LOCAL_SRC_FILES := $(droidsans_fallback_src) |
| 90 | LOCAL_MODULE_CLASS := ETC |
| 91 | LOCAL_MODULE_TAGS := optional |
| 92 | LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts |
Ying Wang | 8e35981 | 2011-10-06 11:14:13 -0700 | [diff] [blame] | 93 | include $(BUILD_PREBUILT) |
Ying Wang | 46b20e7 | 2011-09-29 18:07:41 -0700 | [diff] [blame] | 94 | droidsans_fallback_src := |
Roozbeh Pournader | 32a65c7 | 2014-07-24 14:36:04 -0700 | [diff] [blame] | 95 | |
| 96 | endif # !EXTENDED_FONT_FOOTPRINT |
| 97 | |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 98 | ################################ |
Roozbeh Pournader | 32a65c7 | 2014-07-24 14:36:04 -0700 | [diff] [blame] | 99 | # Build the rest of font files as prebuilt. |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 100 | |
| 101 | # $(1): The source file name in LOCAL_PATH. |
| 102 | # It also serves as the module name and the dest file name. |
| 103 | define build-one-font-module |
| 104 | $(eval include $(CLEAR_VARS))\ |
| 105 | $(eval LOCAL_MODULE := $(1))\ |
| 106 | $(eval LOCAL_SRC_FILES := $(1))\ |
| 107 | $(eval LOCAL_MODULE_CLASS := ETC)\ |
| 108 | $(eval LOCAL_MODULE_TAGS := optional)\ |
| 109 | $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ |
| 110 | $(eval include $(BUILD_PREBUILT)) |
| 111 | endef |
| 112 | |
| 113 | font_src_files := \ |
| 114 | Roboto-Regular.ttf \ |
| 115 | Roboto-Bold.ttf \ |
| 116 | Roboto-Italic.ttf \ |
| 117 | Roboto-BoldItalic.ttf \ |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 118 | Clockopia.ttf \ |
| 119 | AndroidClock.ttf \ |
| 120 | AndroidClock_Highlight.ttf \ |
| 121 | AndroidClock_Solid.ttf |
| 122 | |
| 123 | ifeq ($(MINIMAL_FONT_FOOTPRINT),true) |
| 124 | |
Victoria Lease | d0769f6 | 2014-05-20 07:53:26 -0700 | [diff] [blame] | 125 | $(eval $(call create-font-symlink,Roboto-Black.ttf,Roboto-Bold.ttf)) |
Roozbeh Pournader | e210ded | 2014-06-11 15:35:03 -0700 | [diff] [blame] | 126 | $(eval $(call create-font-symlink,Roboto-BlackItalic.ttf,Roboto-BoldItalic.ttf)) |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 127 | $(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf)) |
| 128 | $(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf)) |
Victoria Lease | d0769f6 | 2014-05-20 07:53:26 -0700 | [diff] [blame] | 129 | $(eval $(call create-font-symlink,Roboto-Medium.ttf,Roboto-Regular.ttf)) |
| 130 | $(eval $(call create-font-symlink,Roboto-MediumItalic.ttf,Roboto-Italic.ttf)) |
Raph Levien | be456f2 | 2012-09-18 15:30:02 -0700 | [diff] [blame] | 131 | $(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf)) |
| 132 | $(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf)) |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 133 | $(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf)) |
| 134 | $(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf)) |
| 135 | $(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf)) |
| 136 | $(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf)) |
| 137 | |
| 138 | else # !MINIMAL_FONT |
| 139 | font_src_files += \ |
Victoria Lease | d0769f6 | 2014-05-20 07:53:26 -0700 | [diff] [blame] | 140 | Roboto-Black.ttf \ |
Roozbeh Pournader | e210ded | 2014-06-11 15:35:03 -0700 | [diff] [blame] | 141 | Roboto-BlackItalic.ttf \ |
Raph Levien | 289c09a | 2012-05-09 09:49:21 -0700 | [diff] [blame] | 142 | Roboto-Light.ttf \ |
| 143 | Roboto-LightItalic.ttf \ |
Victoria Lease | d0769f6 | 2014-05-20 07:53:26 -0700 | [diff] [blame] | 144 | Roboto-Medium.ttf \ |
| 145 | Roboto-MediumItalic.ttf \ |
Raph Levien | be456f2 | 2012-09-18 15:30:02 -0700 | [diff] [blame] | 146 | Roboto-Thin.ttf \ |
| 147 | Roboto-ThinItalic.ttf \ |
Raph Levien | 467ea51 | 2012-05-10 17:28:20 -0700 | [diff] [blame] | 148 | RobotoCondensed-Regular.ttf \ |
| 149 | RobotoCondensed-Bold.ttf \ |
| 150 | RobotoCondensed-Italic.ttf \ |
| 151 | RobotoCondensed-BoldItalic.ttf \ |
Justin Koh | f159606 | 2014-03-25 13:05:41 -0700 | [diff] [blame] | 152 | RobotoCondensed-Light.ttf \ |
Roozbeh Pournader | cbd09892 | 2014-07-09 09:33:04 -0700 | [diff] [blame] | 153 | RobotoCondensed-LightItalic.ttf |
Keun young Park | 0876101 | 2012-06-05 15:20:17 -0700 | [diff] [blame] | 154 | |
| 155 | endif # !MINIMAL_FONT |
Ying Wang | 193ec66 | 2012-02-13 18:55:41 -0800 | [diff] [blame] | 156 | |
| 157 | $(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) |
| 158 | |
| 159 | build-one-font-module := |
| 160 | font_src_files := |