blob: 0d9a3860ab4050dc543a698d253f1c475e238af0 [file] [log] [blame]
Ying Wang46b20e72011-09-29 18:07:41 -07001# Copyright (C) 2011 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# because SMALLER_FONT_FOOTPRINT is only available in Android.mks.
17
18LOCAL_PATH := $(call my-dir)
19
Ying Wang8e359812011-10-06 11:14:13 -070020##########################################
Keun young Park08761012012-06-05 15:20:17 -070021# create symlink for given font
22# $(1): new font $(2): link target
23# should be used with eval: $(eval $(call ...))
24define create-font-symlink
25$(PRODUCT_OUT)/system/fonts/$(1) : $(PRODUCT_OUT)/system/fonts/$(2)
26 @echo "Symlink: $$@ -> $$<"
27 @mkdir -p $$(dir $$@)
28 @rm -rf $$@
29 $(hide) ln -sf $$(notdir $$<) $$@
30# this magic makes LOCAL_REQUIRED_MODULES work
31ALL_MODULES.$(1).INSTALLED := \
32 $(ALL_MODULES.$(1).INSTALLED) $(PRODUCT_OUT)/system/fonts/$(1)
33endef
34
35##########################################
Ying Wang8e359812011-10-06 11:14:13 -070036# We may only afford small font footprint.
37##########################################
Keun young Park08761012012-06-05 15:20:17 -070038$(eval $(call create-font-symlink,DroidSans.ttf,Roboto-Regular.ttf))
39$(eval $(call create-font-symlink,DroidSans-Bold.ttf,Roboto-Bold.ttf))
Ying Wang8e359812011-10-06 11:14:13 -070040
41################################
Ying Wang193ec662012-02-13 18:55:41 -080042# On space-constrained devices, we include a subset of fonts:
43ifeq ($(SMALLER_FONT_FOOTPRINT),true)
44droidsans_fallback_src := DroidSansFallback.ttf
Russell Brenner1c097a92012-03-28 09:45:27 -070045extra_font_files := DroidSans.ttf DroidSans-Bold.ttf
Ying Wang193ec662012-02-13 18:55:41 -080046else
Ying Wang8e359812011-10-06 11:14:13 -070047include $(CLEAR_VARS)
48LOCAL_MODULE := DroidSansEthiopic-Regular.ttf
49LOCAL_SRC_FILES := $(LOCAL_MODULE)
50LOCAL_MODULE_CLASS := ETC
51LOCAL_MODULE_TAGS := optional
52LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
53include $(BUILD_PREBUILT)
54
Russell Brenner1c097a92012-03-28 09:45:27 -070055include $(CLEAR_VARS)
56LOCAL_MODULE := MTLmr3m.ttf
57LOCAL_SRC_FILES := $(LOCAL_MODULE)
58LOCAL_MODULE_CLASS := ETC
59LOCAL_MODULE_TAGS := optional
60LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
61include $(BUILD_PREBUILT)
62
Ying Wang46b20e72011-09-29 18:07:41 -070063droidsans_fallback_src := DroidSansFallbackFull.ttf
Russell Brenner1c097a92012-03-28 09:45:27 -070064extra_font_files := \
65 DroidSans.ttf \
66 DroidSans-Bold.ttf \
67 DroidSansEthiopic-Regular.ttf \
Billy Hewlettac1cbaf2012-07-18 09:51:45 -070068 MTLmr3m.ttf
Ying Wang8e359812011-10-06 11:14:13 -070069endif # SMALLER_FONT_FOOTPRINT
Ying Wang46b20e72011-09-29 18:07:41 -070070
Ying Wang193ec662012-02-13 18:55:41 -080071################################
Ying Wang46b20e72011-09-29 18:07:41 -070072include $(CLEAR_VARS)
73LOCAL_MODULE := DroidSansFallback.ttf
74LOCAL_SRC_FILES := $(droidsans_fallback_src)
75LOCAL_MODULE_CLASS := ETC
76LOCAL_MODULE_TAGS := optional
77LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
Russell Brenner1c097a92012-03-28 09:45:27 -070078LOCAL_REQUIRED_MODULES := $(extra_font_files)
Ying Wang8e359812011-10-06 11:14:13 -070079include $(BUILD_PREBUILT)
80
81font_symlink_src :=
82font_symlink :=
Ying Wang46b20e72011-09-29 18:07:41 -070083droidsans_fallback_src :=
Russell Brenner1c097a92012-03-28 09:45:27 -070084extra_font_files :=
Ying Wang193ec662012-02-13 18:55:41 -080085################################
86# Build the rest font files as prebuilt.
87
88# $(1): The source file name in LOCAL_PATH.
89# It also serves as the module name and the dest file name.
90define build-one-font-module
91$(eval include $(CLEAR_VARS))\
92$(eval LOCAL_MODULE := $(1))\
93$(eval LOCAL_SRC_FILES := $(1))\
94$(eval LOCAL_MODULE_CLASS := ETC)\
95$(eval LOCAL_MODULE_TAGS := optional)\
96$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\
97$(eval include $(BUILD_PREBUILT))
98endef
99
100font_src_files := \
101 Roboto-Regular.ttf \
102 Roboto-Bold.ttf \
103 Roboto-Italic.ttf \
104 Roboto-BoldItalic.ttf \
Keun young Park08761012012-06-05 15:20:17 -0700105 DroidSerif-Regular.ttf \
106 DroidSerif-Bold.ttf \
107 DroidSerif-Italic.ttf \
108 DroidSerif-BoldItalic.ttf \
109 DroidSansMono.ttf \
110 Clockopia.ttf \
111 AndroidClock.ttf \
112 AndroidClock_Highlight.ttf \
113 AndroidClock_Solid.ttf
114
115ifeq ($(MINIMAL_FONT_FOOTPRINT),true)
116
117$(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf))
118$(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf))
Raph Levienbe456f22012-09-18 15:30:02 -0700119$(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf))
120$(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf))
Keun young Park08761012012-06-05 15:20:17 -0700121$(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf))
122$(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf))
123$(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf))
124$(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf))
125
126else # !MINIMAL_FONT
127font_src_files += \
Raph Levien289c09a2012-05-09 09:49:21 -0700128 Roboto-Light.ttf \
129 Roboto-LightItalic.ttf \
Raph Levienbe456f22012-09-18 15:30:02 -0700130 Roboto-Thin.ttf \
131 Roboto-ThinItalic.ttf \
Raph Levien467ea512012-05-10 17:28:20 -0700132 RobotoCondensed-Regular.ttf \
133 RobotoCondensed-Bold.ttf \
134 RobotoCondensed-Italic.ttf \
135 RobotoCondensed-BoldItalic.ttf \
Ying Wang193ec662012-02-13 18:55:41 -0800136 DroidNaskh-Regular.ttf \
Raph Levien15b8c182013-03-29 16:13:36 -0700137 DroidNaskhUI-Regular.ttf \
Ying Wang193ec662012-02-13 18:55:41 -0800138 DroidSansHebrew-Regular.ttf \
139 DroidSansHebrew-Bold.ttf \
Ying Wang193ec662012-02-13 18:55:41 -0800140 DroidSansArmenian.ttf \
Victoria Lease4ce09312013-09-18 14:51:55 -0700141 DroidSansGeorgian.ttf \
142 AndroidEmoji.ttf
Keun young Park08761012012-06-05 15:20:17 -0700143
144endif # !MINIMAL_FONT
Ying Wang193ec662012-02-13 18:55:41 -0800145
146$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
147
148build-one-font-module :=
149font_src_files :=