1 # Copyright (C) 2013 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 # to copy over the NOTICE file. 17 18 LOCAL_PATH := $(call my-dir) 19 font_src_files := 20 21 ############################################################################# 22 # The following fonts are included in all builds 23 ############################################################################# 24 font_src_files += \ 25 NotoSerif-Regular.ttf \ 26 NotoSerif-Bold.ttf \ 27 NotoSerif-Italic.ttf \ 28 NotoSerif-BoldItalic.ttf 29 30 ############################################################################# 31 # The following fonts are only included in EXTENDED_FONT_FOOTPRINT builds 32 ############################################################################# 33 ifeq ($(EXTENDED_FONT_FOOTPRINT),true) 34 font_src_files += \ 35 NotoSansBalinese-Regular.ttf \ 36 NotoSansBatak-Regular.ttf \ 37 NotoSansBuginese-Regular.ttf \ 38 NotoSansBuhid-Regular.ttf \ 39 NotoSansCanadianAboriginal-Regular.ttf \ 40 NotoSansCham-Regular.ttf \ 41 NotoSansCham-Bold.ttf \ 42 NotoSansCherokee-Regular.ttf \ 43 NotoSansCoptic-Regular.ttf \ 44 NotoSansGlagolitic-Regular.ttf \ 45 NotoSansGujarati-Regular.ttf \ 46 NotoSansGujarati-Bold.ttf \ 47 NotoSansGujaratiUI-Regular.ttf \ 48 NotoSansGujaratiUI-Bold.ttf \ 49 NotoSansGurmukhi-Regular.ttf \ 50 NotoSansGurmukhi-Bold.ttf \ 51 NotoSansGurmukhiUI-Regular.ttf \ 52 NotoSansGurmukhiUI-Bold.ttf \ 53 NotoSansHans-Regular.otf \ 54 NotoSansHant-Regular.otf \ 55 NotoSansHanunoo-Regular.ttf \ 56 NotoSansJavanese-Regular.ttf \ 57 NotoSansKayahLi-Regular.ttf \ 58 NotoSansKR-Regular.otf \ 59 NotoSansLepcha-Regular.ttf \ 60 NotoSansLimbu-Regular.ttf \ 61 NotoSansMeeteiMayek-Regular.ttf \ 62 NotoSansOlChiki-Regular.ttf \ 63 NotoSansRejang-Regular.ttf \ 64 NotoSansSaurashtra-Regular.ttf \ 65 NotoSansSundanese-Regular.ttf \ 66 NotoSansSinhala-Regular.ttf \ 67 NotoSansSinhala-Bold.ttf \ 68 NotoSansSylotiNagri-Regular.ttf \ 69 NotoSansTagbanwa-Regular.ttf \ 70 NotoSansTaiLe-Regular.ttf \ 71 NotoSansTaiTham-Regular.ttf \ 72 NotoSansTaiViet-Regular.ttf \ 73 NotoSansThaana-Regular.ttf \ 74 NotoSansThaana-Bold.ttf \ 75 NotoSansTifinagh-Regular.ttf \ 76 NotoSansYi-Regular.ttf 77 endif # EXTENDED_FONT_FOOTPRINT 78 79 80 81 ############################################################################# 82 # The following fonts are excluded from SMALLER_FONT_FOOTPRINT builds 83 ############################################################################# 84 ifneq ($(SMALLER_FONT_FOOTPRINT),true) 85 font_src_files += \ 86 NotoSansBengali-Regular.ttf \ 87 NotoSansBengali-Bold.ttf \ 88 NotoSansBengaliUI-Regular.ttf \ 89 NotoSansBengaliUI-Bold.ttf \ 90 NotoSansDevanagari-Regular.ttf \ 91 NotoSansDevanagari-Bold.ttf \ 92 NotoSansDevanagariUI-Regular.ttf \ 93 NotoSansDevanagariUI-Bold.ttf \ 94 NotoSansEthiopic-Regular.ttf \ 95 NotoSansEthiopic-Bold.ttf \ 96 NotoSansKannada-Regular.ttf \ 97 NotoSansKannada-Bold.ttf \ 98 NotoSansKannadaUI-Regular.ttf \ 99 NotoSansKannadaUI-Bold.ttf \ 100 NotoSansKhmer-Regular.ttf \ 101 NotoSansKhmer-Bold.ttf \ 102 NotoSansKhmerUI-Regular.ttf \ 103 NotoSansKhmerUI-Bold.ttf \ 104 NotoSansLao-Regular.ttf \ 105 NotoSansLao-Bold.ttf \ 106 NotoSansLaoUI-Regular.ttf \ 107 NotoSansLaoUI-Bold.ttf \ 108 NotoSansMalayalam-Regular.ttf \ 109 NotoSansMalayalam-Bold.ttf \ 110 NotoSansMalayalamUI-Regular.ttf \ 111 NotoSansMalayalamUI-Bold.ttf \ 112 NotoSansMyanmar-Regular.ttf \ 113 NotoSansMyanmar-Bold.ttf \ 114 NotoSansMyanmarUI-Regular.ttf \ 115 NotoSansMyanmarUI-Bold.ttf \ 116 NotoSansTamil-Regular.ttf \ 117 NotoSansTamil-Bold.ttf \ 118 NotoSansTamilUI-Regular.ttf \ 119 NotoSansTamilUI-Bold.ttf \ 120 NotoSansTelugu-Regular.ttf \ 121 NotoSansTelugu-Bold.ttf \ 122 NotoSansTeluguUI-Regular.ttf \ 123 NotoSansTeluguUI-Bold.ttf \ 124 NotoSansThai-Regular.ttf \ 125 NotoSansThai-Bold.ttf \ 126 NotoSansThaiUI-Regular.ttf \ 127 NotoSansThaiUI-Bold.ttf 128 endif # !SMALLER_FONT_FOOTPRINT 129 130 ############################################################################# 131 # The following fonts are excluded from MINIMAL_FONT_FOOTPRINT builds 132 ############################################################################# 133 ifneq ($(MINIMAL_FONT_FOOTPRINT),true) 134 font_src_files += \ 135 NotoNaskh-Regular.ttf \ 136 NotoNaskh-Bold.ttf \ 137 NotoNaskhUI-Regular.ttf \ 138 NotoNaskhUI-Bold.ttf \ 139 NotoSansArmenian-Regular.ttf \ 140 NotoSansArmenian-Bold.ttf \ 141 NotoSansGeorgian-Regular.ttf \ 142 NotoSansGeorgian-Bold.ttf \ 143 NotoSansHebrew-Regular.ttf \ 144 NotoSansHebrew-Bold.ttf 145 endif # !MINIMAL_FONT_FOOTPRINT 146 147 ############################################################################# 148 # $(1): The source file name in LOCAL_PATH. 149 # It also serves as the module name and the dest file name. 150 ############################################################################# 151 define build-one-font-module 152 $(eval include $(CLEAR_VARS))\ 153 $(eval LOCAL_MODULE := $(1))\ 154 $(eval LOCAL_SRC_FILES := $(1))\ 155 $(eval LOCAL_MODULE_CLASS := ETC)\ 156 $(eval LOCAL_MODULE_TAGS := optional)\ 157 $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ 158 $(eval include $(BUILD_PREBUILT)) 159 endef 160 161 $(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) 162 build-one-font-module := 163 font_src_files := 164 165 ############################################################################# 166 # Use a larger subset of Noto Sans Symbols on EXTENDED_FONT_FOOTPRINT 167 # builds, but a smaller subset on other devices. 168 ############################################################################# 169 170 ifeq ($(EXTENDED_FONT_FOOTPRINT),true) 171 noto_symbols_src := NotoSansSymbols-Regular-Subsetted-Extended.ttf 172 else # !EXTENDED_FONT_FOOTPRINT 173 noto_symbols_src := NotoSansSymbols-Regular-Subsetted.ttf 174 endif # EXTENDED_FONT_FOOTPRINT 175 176 include $(CLEAR_VARS) 177 LOCAL_MODULE := NotoSansSymbols-Regular-Subsetted.ttf 178 LOCAL_SRC_FILES := $(noto_symbols_src) 179 LOCAL_MODULE_CLASS := ETC 180 LOCAL_MODULE_TAGS := optional 181 LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 182 include $(BUILD_PREBUILT) 183 184 noto_symbols_src := 185 186 ############################################################################# 187 # Use Noto Color Emoji with all the flags on EXTENDED_FONT_FOOTPRINT builds, 188 # but without it on other builds. On SMALLER_FONT_FOOTPRINT devices, no 189 # color emoji font is included. 190 ############################################################################# 191 192 ifneq ($(SMALLER_FONT_FOOTPRINT),true) 193 194 ifeq ($(EXTENDED_FONT_FOOTPRINT),true) 195 color_emoji_src := NotoColorEmoji.ttf 196 else # !EXTENDED_FONT_FOOTPRINT 197 color_emoji_src := NotoColorEmoji-Subsetted.ttf 198 endif # EXTENDED_FONT_FOOTPRINT 199 200 include $(CLEAR_VARS) 201 LOCAL_MODULE := NotoColorEmoji.ttf 202 LOCAL_SRC_FILES := $(color_emoji_src) 203 LOCAL_MODULE_CLASS := ETC 204 LOCAL_MODULE_TAGS := optional 205 LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 206 include $(BUILD_PREBUILT) 207 208 color_emoji_src := 209 210 endif # !SMALLER_FONT_FOOTPRINT 211 212 ############################################################################# 213 # Include a subset of NotoSansJP in EXTENDED_FONT_FOOTPRINT builds. 214 ############################################################################# 215 216 ifeq ($(EXTENDED_FONT_FOOTPRINT),true) 217 218 noto_sans_jp_src := NotoSansJP-Regular-Subsetted.otf 219 220 include $(CLEAR_VARS) 221 LOCAL_MODULE := NotoSansJP-Regular.otf 222 LOCAL_SRC_FILES := $(noto_sans_jp_src) 223 LOCAL_MODULE_CLASS := ETC 224 LOCAL_MODULE_TAGS := optional 225 LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 226 include $(BUILD_PREBUILT) 227 228 noto_sans_jp_src := 229 230 endif # EXTENDED_FONT_FOOTPRINT 231