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 NOTO_DIR := $(call my-dir) 16 17 # We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES, 18 # to copy over the NOTICE file. 19 ############################################################################# 20 # $(1): The source file name in LOCAL_PATH. 21 # It also serves as the module name and the dest file name. 22 ############################################################################# 23 define build-one-font-module 24 $(eval include $(CLEAR_VARS))\ 25 $(eval LOCAL_MODULE := $(1))\ 26 $(eval LOCAL_SRC_FILES := $(1))\ 27 $(eval LOCAL_MODULE_CLASS := ETC)\ 28 $(eval LOCAL_MODULE_TAGS := optional)\ 29 $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ 30 $(eval include $(BUILD_PREBUILT)) 31 endef 32 33 34 ############################################################################# 35 # First "build" the Noto CJK fonts, which have their own directory and 36 # license. These are not included in SMALLER_FONT_FOOTPRINT builds. 37 ############################################################################# 38 ifneq ($(SMALLER_FONT_FOOTPRINT),true) 39 LOCAL_PATH := $(NOTO_DIR)/cjk 40 41 font_src_files := \ 42 NotoSansCJK-Regular.ttc 43 44 $(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) 45 font_src_files := 46 47 endif # !SMALLER_FONT_FOOTPRINT 48 49 50 ############################################################################# 51 # Now "build" the rest of the fonts, which live in a separate subdirectory. 52 ############################################################################# 53 LOCAL_PATH := $(NOTO_DIR)/other 54 NOTO_DIR := 55 56 ############################################################################# 57 # The following fonts are included in all builds. 58 ############################################################################# 59 font_src_files := \ 60 NotoSerif-Regular.ttf \ 61 NotoSerif-Bold.ttf \ 62 NotoSerif-Italic.ttf \ 63 NotoSerif-BoldItalic.ttf 64 65 ############################################################################# 66 # The following fonts are excluded from SMALLER_FONT_FOOTPRINT builds. 67 ############################################################################# 68 ifneq ($(SMALLER_FONT_FOOTPRINT),true) 69 font_src_files += \ 70 NotoColorEmoji.ttf \ 71 NotoSansBalinese-Regular.ttf \ 72 NotoSansBamum-Regular.ttf \ 73 NotoSansBatak-Regular.ttf \ 74 NotoSansBengali-Regular.ttf \ 75 NotoSansBengali-Bold.ttf \ 76 NotoSansBengaliUI-Regular.ttf \ 77 NotoSansBengaliUI-Bold.ttf \ 78 NotoSansBuginese-Regular.ttf \ 79 NotoSansBuhid-Regular.ttf \ 80 NotoSansCanadianAboriginal-Regular.ttf \ 81 NotoSansCham-Regular.ttf \ 82 NotoSansCham-Bold.ttf \ 83 NotoSansCherokee-Regular.ttf \ 84 NotoSansCoptic-Regular.ttf \ 85 NotoSansDevanagari-Regular.ttf \ 86 NotoSansDevanagari-Bold.ttf \ 87 NotoSansDevanagariUI-Regular.ttf \ 88 NotoSansDevanagariUI-Bold.ttf \ 89 NotoSansEthiopic-Regular.ttf \ 90 NotoSansEthiopic-Bold.ttf \ 91 NotoSansGlagolitic-Regular.ttf \ 92 NotoSansGujarati-Regular.ttf \ 93 NotoSansGujarati-Bold.ttf \ 94 NotoSansGujaratiUI-Regular.ttf \ 95 NotoSansGujaratiUI-Bold.ttf \ 96 NotoSansGurmukhi-Regular.ttf \ 97 NotoSansGurmukhi-Bold.ttf \ 98 NotoSansGurmukhiUI-Regular.ttf \ 99 NotoSansGurmukhiUI-Bold.ttf \ 100 NotoSansHanunoo-Regular.ttf \ 101 NotoSansJavanese-Regular.ttf \ 102 NotoSansKannada-Regular.ttf \ 103 NotoSansKannada-Bold.ttf \ 104 NotoSansKannadaUI-Regular.ttf \ 105 NotoSansKannadaUI-Bold.ttf \ 106 NotoSansKayahLi-Regular.ttf \ 107 NotoSansKhmer-Regular.ttf \ 108 NotoSansKhmer-Bold.ttf \ 109 NotoSansKhmerUI-Regular.ttf \ 110 NotoSansKhmerUI-Bold.ttf \ 111 NotoSansLao-Regular.ttf \ 112 NotoSansLao-Bold.ttf \ 113 NotoSansLaoUI-Regular.ttf \ 114 NotoSansLaoUI-Bold.ttf \ 115 NotoSansLepcha-Regular.ttf \ 116 NotoSansLimbu-Regular.ttf \ 117 NotoSansLisu-Regular.ttf \ 118 NotoSansMalayalam-Regular.ttf \ 119 NotoSansMalayalam-Bold.ttf \ 120 NotoSansMalayalamUI-Regular.ttf \ 121 NotoSansMalayalamUI-Bold.ttf \ 122 NotoSansMandaic-Regular.ttf \ 123 NotoSansMeeteiMayek-Regular.ttf \ 124 NotoSansMongolian-Regular.ttf \ 125 NotoSansMyanmar-Regular.ttf \ 126 NotoSansMyanmar-Bold.ttf \ 127 NotoSansMyanmarUI-Regular.ttf \ 128 NotoSansMyanmarUI-Bold.ttf \ 129 NotoSansNewTaiLue-Regular.ttf \ 130 NotoSansNKo-Regular.ttf \ 131 NotoSansOlChiki-Regular.ttf \ 132 NotoSansOriya-Regular.ttf \ 133 NotoSansOriya-Bold.ttf \ 134 NotoSansOriyaUI-Regular.ttf \ 135 NotoSansOriyaUI-Bold.ttf \ 136 NotoSansRejang-Regular.ttf \ 137 NotoSansSaurashtra-Regular.ttf \ 138 NotoSansSinhala-Regular.ttf \ 139 NotoSansSinhala-Bold.ttf \ 140 NotoSansSundanese-Regular.ttf \ 141 NotoSansSylotiNagri-Regular.ttf \ 142 NotoSansSyriacEstrangela-Regular.ttf \ 143 NotoSansTagbanwa-Regular.ttf \ 144 NotoSansTaiLe-Regular.ttf \ 145 NotoSansTaiTham-Regular.ttf \ 146 NotoSansTaiViet-Regular.ttf \ 147 NotoSansTamil-Regular.ttf \ 148 NotoSansTamil-Bold.ttf \ 149 NotoSansTamilUI-Regular.ttf \ 150 NotoSansTamilUI-Bold.ttf \ 151 NotoSansTelugu-Regular.ttf \ 152 NotoSansTelugu-Bold.ttf \ 153 NotoSansTeluguUI-Regular.ttf \ 154 NotoSansTeluguUI-Bold.ttf \ 155 NotoSansThaana-Regular.ttf \ 156 NotoSansThaana-Bold.ttf \ 157 NotoSansThai-Regular.ttf \ 158 NotoSansThai-Bold.ttf \ 159 NotoSansThaiUI-Regular.ttf \ 160 NotoSansThaiUI-Bold.ttf \ 161 NotoSansTibetan-Regular.ttf \ 162 NotoSansTibetan-Bold.ttf \ 163 NotoSansTifinagh-Regular.ttf \ 164 NotoSansVai-Regular.ttf \ 165 NotoSansYi-Regular.ttf 166 endif # !SMALLER_FONT_FOOTPRINT 167 168 ############################################################################# 169 # The following fonts are excluded from MINIMAL_FONT_FOOTPRINT builds. 170 ############################################################################# 171 ifneq ($(MINIMAL_FONT_FOOTPRINT),true) 172 font_src_files += \ 173 NotoNaskhArabic-Regular.ttf \ 174 NotoNaskhArabic-Bold.ttf \ 175 NotoNaskhArabicUI-Regular.ttf \ 176 NotoNaskhArabicUI-Bold.ttf \ 177 NotoSansArmenian-Regular.ttf \ 178 NotoSansArmenian-Bold.ttf \ 179 NotoSansGeorgian-Regular.ttf \ 180 NotoSansGeorgian-Bold.ttf \ 181 NotoSansHebrew-Regular.ttf \ 182 NotoSansHebrew-Bold.ttf \ 183 NotoSansSymbols-Regular-Subsetted.ttf \ 184 NotoSansSymbols-Regular-Subsetted2.ttf 185 endif # !MINIMAL_FONT_FOOTPRINT 186 187 $(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) 188 build-one-font-module := 189 font_src_files := 190