lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
 
NOTO_DIR := $(call my-dir)
 
include $(call all-makefiles-under,$(NOTO_DIR))
 
# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES,
# to copy over the NOTICE file.
#############################################################################
# $(1): The source file name in LOCAL_PATH.
#       It also serves as the module name and the dest file name.
#############################################################################
define build-one-font-module
$(eval include $(CLEAR_VARS))\
$(eval LOCAL_MODULE := $(1))\
$(eval LOCAL_SRC_FILES := $(1))\
$(eval LOCAL_MODULE_CLASS := ETC)\
$(eval LOCAL_MODULE_TAGS := optional)\
$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\
$(eval include $(BUILD_PREBUILT))
endef
 
 
#############################################################################
# First "build" the Noto CJK fonts, which have a different directory and
# copyright holder. These are not included in MINIMAL_FONT_FOOTPRINT builds.
#############################################################################
ifneq ($(MINIMAL_FONT_FOOTPRINT),true)
LOCAL_PATH := $(NOTO_DIR)/cjk
 
font_src_files := \
    NotoSansCJK-Regular.ttc
 
$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
font_src_files :=
 
endif # !MINIMAL_FONT_FOOTPRINT
 
#############################################################################
# Similary "build" the Noto CJK fonts for serif family.
# These are not included in SMALLER_FONT_FOOTPRINT builds.
#############################################################################
ifeq ($(filter true,$(EXCLUDE_SERIF_FONTS) $(SMALLER_FONT_FOOTPRINT)),)
LOCAL_PATH := $(NOTO_DIR)/cjk
 
font_src_files := \
    NotoSerifCJK-Regular.ttc
 
$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
font_src_files :=
 
endif # !EXCLUDE_SERIF_FONTS && !SMALLER_FONT_FOOTPRINT
 
#############################################################################
# Now "build" the Noto Color Emoji font, which is in its own directory. It is
# not included in the MINIMAL_FONT_FOOTPRINT builds.
#############################################################################
ifneq ($(MINIMAL_FONT_FOOTPRINT),true)
LOCAL_PATH := $(NOTO_DIR)/emoji
 
font_src_files := \
    NotoColorEmoji.ttf
 
$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
font_src_files :=
 
endif # !MINIMAL_FONT_FOOTPRINT
 
#############################################################################
# Now "build" the rest of the fonts, which live in a separate subdirectory.
#############################################################################
LOCAL_PATH := $(NOTO_DIR)/other
 
#############################################################################
# The following fonts are included in all builds.
#############################################################################
font_src_files := \
    NotoSerif-Regular.ttf \
    NotoSerif-Bold.ttf \
    NotoSerif-Italic.ttf \
    NotoSerif-BoldItalic.ttf
 
#############################################################################
# The following fonts are excluded from SMALLER_FONT_FOOTPRINT builds.
#############################################################################
ifneq ($(SMALLER_FONT_FOOTPRINT),true)
font_src_files += \
    NotoSansAdlam-Regular.ttf \
    NotoSansAhom-Regular.otf \
    NotoSansAnatolianHieroglyphs-Regular.otf \
    NotoSansAvestan-Regular.ttf \
    NotoSansBalinese-Regular.ttf \
    NotoSansBamum-Regular.ttf \
    NotoSansBassaVah-Regular.otf \
    NotoSansBatak-Regular.ttf \
    NotoSansBengali-Bold.otf \
    NotoSansBengali-Medium.otf \
    NotoSansBengali-Regular.otf \
    NotoSansBengaliUI-Bold.otf \
    NotoSansBengaliUI-Medium.otf \
    NotoSansBengaliUI-Regular.otf \
    NotoSansBengaliUI-Bold.ttf \
    NotoSansBengaliUI-Regular.ttf \
    NotoSansBhaiksuki-Regular.otf \
    NotoSansBrahmi-Regular.ttf \
    NotoSansBuginese-Regular.ttf \
    NotoSansBuhid-Regular.ttf \
    NotoSansCanadianAboriginal-Regular.ttf \
    NotoSansCarian-Regular.ttf \
    NotoSansChakma-Regular.otf \
    NotoSansCham-Bold.ttf \
    NotoSansCham-Regular.ttf \
    NotoSansCherokee-Regular.ttf \
    NotoSansCoptic-Regular.ttf \
    NotoSansCuneiform-Regular.ttf \
    NotoSansCypriot-Regular.ttf \
    NotoSansDeseret-Regular.ttf \
    NotoSansEgyptianHieroglyphs-Regular.ttf \
    NotoSansElbasan-Regular.otf \
    NotoSansEthiopic-Bold.ttf \
    NotoSansEthiopic-Regular.ttf \
    NotoSansGlagolitic-Regular.ttf \
    NotoSansGothic-Regular.ttf \
    NotoSansGujarati-Bold.ttf \
    NotoSansGujarati-Regular.ttf \
    NotoSansGujaratiUI-Bold.ttf \
    NotoSansGujaratiUI-Regular.ttf \
    NotoSansGurmukhi-Bold.ttf \
    NotoSansGurmukhi-Regular.ttf \
    NotoSansGurmukhiUI-Bold.ttf \
    NotoSansGurmukhiUI-Regular.ttf \
    NotoSansHanunoo-Regular.ttf \
    NotoSansHatran-Regular.otf \
    NotoSansImperialAramaic-Regular.ttf \
    NotoSansInscriptionalPahlavi-Regular.ttf \
    NotoSansInscriptionalParthian-Regular.ttf \
    NotoSansJavanese-Regular.ttf \
    NotoSansKaithi-Regular.ttf \
    NotoSansKannada-Bold.ttf \
    NotoSansKannada-Regular.ttf \
    NotoSansKannadaUI-Bold.ttf \
    NotoSansKannadaUI-Regular.ttf \
    NotoSansKayahLi-Regular.ttf \
    NotoSansKharoshthi-Regular.ttf \
    NotoSansKhmerUI-Bold.ttf \
    NotoSansKhmerUI-Regular.ttf \
    NotoSansLao-Bold.ttf \
    NotoSansLao-Regular.ttf \
    NotoSansLaoUI-Bold.ttf \
    NotoSansLaoUI-Regular.ttf \
    NotoSansLepcha-Regular.ttf \
    NotoSansLimbu-Regular.ttf \
    NotoSansLinearA-Regular.otf \
    NotoSansLinearB-Regular.ttf \
    NotoSansLisu-Regular.ttf \
    NotoSansLycian-Regular.ttf \
    NotoSansLydian-Regular.ttf \
    NotoSansMalayalam-Bold.otf \
    NotoSansMalayalam-Medium.otf \
    NotoSansMalayalam-Regular.otf \
    NotoSansMalayalamUI-Bold.otf \
    NotoSansMalayalamUI-Bold.ttf \
    NotoSansMalayalamUI-Medium.otf \
    NotoSansMalayalamUI-Regular.otf \
    NotoSansMalayalamUI-Regular.ttf \
    NotoSansMandaic-Regular.ttf \
    NotoSansManichaean-Regular.otf \
    NotoSansMarchen-Regular.otf \
    NotoSansMeeteiMayek-Regular.ttf \
    NotoSansMeroitic-Regular.otf \
    NotoSansMiao-Regular.otf \
    NotoSansMongolian-Regular.ttf \
    NotoSansMro-Regular.otf \
    NotoSansMultani-Regular.otf \
    NotoSansMyanmar-Bold-ZawDecode.ttf \
    NotoSansMyanmar-Regular-ZawDecode.ttf \
    NotoSansMyanmarUI-Bold-ZawDecode.ttf \
    NotoSansMyanmarUI-Regular-ZawDecode.ttf \
    NotoSansMyanmarUI-Regular.ttf \
    NotoSansMyanmarUI-Bold.ttf \
    NotoSansNabataean-Regular.otf \
    NotoSansNewa-Regular.otf \
    NotoSansNewTaiLue-Regular.ttf \
    NotoSansNKo-Regular.ttf \
    NotoSansOgham-Regular.ttf \
    NotoSansOlChiki-Regular.ttf \
    NotoSansOldItalic-Regular.ttf \
    NotoSansOldNorthArabian-Regular.otf \
    NotoSansOldPermic-Regular.otf \
    NotoSansOldPersian-Regular.ttf \
    NotoSansOldSouthArabian-Regular.ttf \
    NotoSansOldTurkic-Regular.ttf \
    NotoSansOriya-Bold.ttf \
    NotoSansOriya-Regular.ttf \
    NotoSansOriyaUI-Bold.ttf \
    NotoSansOriyaUI-Regular.ttf \
    NotoSansOsage-Regular.ttf \
    NotoSansOsmanya-Regular.ttf \
    NotoSansPahawhHmong-Regular.otf \
    NotoSansPalmyrene-Regular.otf \
    NotoSansPauCinHau-Regular.otf \
    NotoSansPhagsPa-Regular.ttf \
    NotoSansPhoenician-Regular.ttf \
    NotoSansRejang-Regular.ttf \
    NotoSansRunic-Regular.ttf \
    NotoSansSamaritan-Regular.ttf \
    NotoSansSaurashtra-Regular.ttf \
    NotoSansSharada-Regular.otf \
    NotoSansShavian-Regular.ttf \
    NotoSansSinhala-Bold.otf \
    NotoSansSinhala-Bold.ttf \
    NotoSansSinhala-Medium.otf \
    NotoSansSinhala-Regular.otf \
    NotoSansSinhala-Regular.ttf \
    NotoSansSinhalaUI-Bold.otf \
    NotoSansSinhalaUI-Medium.otf \
    NotoSansSinhalaUI-Regular.otf \
    NotoSansSoraSompeng-Regular.otf \
    NotoSansSundanese-Regular.ttf \
    NotoSansSylotiNagri-Regular.ttf \
    NotoSansSyriacEastern-Regular.ttf \
    NotoSansSyriacEstrangela-Regular.ttf \
    NotoSansSyriacWestern-Regular.ttf \
    NotoSansTagalog-Regular.ttf \
    NotoSansTagbanwa-Regular.ttf \
    NotoSansTaiLe-Regular.ttf \
    NotoSansTaiTham-Regular.ttf \
    NotoSansTaiViet-Regular.ttf \
    NotoSansTamil-Bold.otf \
    NotoSansTamil-Medium.otf \
    NotoSansTamil-Regular.otf \
    NotoSansTamilUI-Bold.otf \
    NotoSansTamilUI-Bold.ttf \
    NotoSansTamilUI-Medium.otf \
    NotoSansTamilUI-Regular.otf \
    NotoSansTamilUI-Regular.ttf \
    NotoSansTelugu-Bold.ttf \
    NotoSansTelugu-Regular.ttf \
    NotoSansTeluguUI-Bold.ttf \
    NotoSansTeluguUI-Regular.ttf \
    NotoSansThaana-Bold.ttf \
    NotoSansThaana-Regular.ttf \
    NotoSansTibetan-Bold.ttf \
    NotoSansTibetan-Regular.ttf \
    NotoSansTifinagh-Regular.ttf \
    NotoSansUgaritic-Regular.ttf \
    NotoSansVai-Regular.ttf \
    NotoSansYi-Regular.ttf
endif # !SMALLER_FONT_FOOTPRINT
 
#############################################################################
# The following fonts are excluded from MINIMAL_FONT_FOOTPRINT builds.
#############################################################################
ifneq ($(MINIMAL_FONT_FOOTPRINT),true)
font_src_files += \
    NotoNaskhArabic-Regular.ttf \
    NotoNaskhArabic-Bold.ttf \
    NotoNaskhArabicUI-Regular.ttf \
    NotoNaskhArabicUI-Bold.ttf \
    NotoSansArmenian-Regular.otf \
    NotoSansArmenian-Regular.ttf \
    NotoSansArmenian-Bold.otf \
    NotoSansArmenian-Bold.ttf \
    NotoSansArmenian-Medium.otf \
    NotoSansDevanagari-Regular.otf \
    NotoSansDevanagari-Bold.otf \
    NotoSansDevanagari-Medium.otf \
    NotoSansDevanagariUI-Regular.otf \
    NotoSansDevanagariUI-Regular.ttf \
    NotoSansDevanagariUI-Bold.otf \
    NotoSansDevanagariUI-Bold.ttf \
    NotoSansDevanagariUI-Medium.otf \
    NotoSansGeorgian-Regular.otf \
    NotoSansGeorgian-Regular.ttf \
    NotoSansGeorgian-Bold.otf \
    NotoSansGeorgian-Bold.ttf \
    NotoSansGeorgian-Medium.otf \
    NotoSansHebrew-Regular.ttf \
    NotoSansHebrew-Bold.ttf \
    NotoSansSymbols-Regular-Subsetted.ttf \
    NotoSansSymbols-Regular-Subsetted2.ttf \
    NotoSansThai-Regular.ttf \
    NotoSansThai-Bold.ttf \
    NotoSansThaiUI-Regular.ttf \
    NotoSansThaiUI-Bold.ttf
endif # !MINIMAL_FONT_FOOTPRINT
 
ifeq ($(filter true,$(EXCLUDE_SERIF_FONTS) $(SMALLER_FONT_FOOTPRINT)),)
font_src_files += \
    NotoSerifArmenian-Bold.otf \
    NotoSerifArmenian-Regular.otf \
    NotoSerifBengali-Bold.ttf \
    NotoSerifBengali-Regular.ttf \
    NotoSerifDevanagari-Bold.ttf \
    NotoSerifDevanagari-Regular.ttf \
    NotoSerifEthiopic-Bold.otf \
    NotoSerifEthiopic-Regular.otf \
    NotoSerifGeorgian-Bold.otf \
    NotoSerifGeorgian-Regular.otf \
    NotoSerifGujarati-Bold.ttf \
    NotoSerifGujarati-Regular.ttf \
    NotoSerifGurmukhi-Bold.otf \
    NotoSerifGurmukhi-Regular.otf \
    NotoSerifHebrew-Bold.ttf \
    NotoSerifHebrew-Regular.ttf \
    NotoSerifKannada-Bold.ttf \
    NotoSerifKannada-Regular.ttf \
    NotoSerifKhmer-Bold.otf \
    NotoSerifKhmer-Regular.otf \
    NotoSerifLao-Bold.ttf \
    NotoSerifLao-Regular.ttf \
    NotoSerifMalayalam-Bold.ttf \
    NotoSerifMalayalam-Regular.ttf \
    NotoSerifMyanmar-Bold.otf \
    NotoSerifMyanmar-Regular.otf \
    NotoSerifSinhala-Bold.otf \
    NotoSerifSinhala-Regular.otf \
    NotoSerifTamil-Bold.otf \
    NotoSerifTamil-Regular.otf \
    NotoSerifTelugu-Bold.ttf \
    NotoSerifTelugu-Regular.ttf \
    NotoSerifThai-Bold.ttf \
    NotoSerifThai-Regular.ttf
endif # !EXCLUDE_SERIF_FONTS && !SMALLER_FONT_FOOTPRINT
 
$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
 
#############################################################################
# Now "build" the variable fonts, which live in a separate subdirectory.
# The only variable fonts are for Khmer Sans, which is excluded in
# SMALLER_FONT_FOOTPRINT build.
#############################################################################
 
ifneq ($(SMALLER_FONT_FOOTPRINT),true)
 
LOCAL_PATH := $(NOTO_DIR)/other-vf
 
font_src_files := \
    NotoSansKhmer-VF.ttf
 
$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
 
endif # !SMALLER_FONT_FOOTPRINT
 
NOTO_DIR :=
build-one-font-module :=
font_src_files :=