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