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