blob: 1ea459f17de43c4d75bc3557bf378757b9844b24 [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##########################################
Victoria Leasea08f0f82014-05-12 16:05:52 -070036# The following fonts are distributed as symlink only.
Ying Wang8e359812011-10-06 11:14:13 -070037##########################################
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))
Victoria Leasea08f0f82014-05-12 16:05:52 -070040$(eval $(call create-font-symlink,DroidSerif-Regular.ttf,NotoSerif-Regular.ttf))
41$(eval $(call create-font-symlink,DroidSerif-Bold.ttf,NotoSerif-Bold.ttf))
42$(eval $(call create-font-symlink,DroidSerif-Italic.ttf,NotoSerif-Italic.ttf))
43$(eval $(call create-font-symlink,DroidSerif-BoldItalic.ttf,NotoSerif-BoldItalic.ttf))
Ying Wang8e359812011-10-06 11:14:13 -070044
Victoria Leasef99c12c2014-06-13 07:56:58 -070045extra_font_files := \
46 DroidSans.ttf \
47 DroidSans-Bold.ttf
48
Ying Wang8e359812011-10-06 11:14:13 -070049################################
Roozbeh Pournader32a65c72014-07-24 14:36:04 -070050# Do not include Motoya on space-constrained devices
51ifneq ($(SMALLER_FONT_FOOTPRINT),true)
Kris Giesing6180e5b2015-03-26 15:37:46 -070052# Do not include Motoya if we are including full NotoSans
Roozbeh Pournader5f49c282015-04-29 15:38:07 -070053ifneq ($(FONT_NOTOSANS_JP_FULL),true)
Victoria Leasef99c12c2014-06-13 07:56:58 -070054
Ying Wang8e359812011-10-06 11:14:13 -070055include $(CLEAR_VARS)
Russell Brenner1c097a92012-03-28 09:45:27 -070056LOCAL_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)
Victoria Leasef99c12c2014-06-13 07:56:58 -070062extra_font_files += MTLmr3m.ttf
Russell Brenner1c097a92012-03-28 09:45:27 -070063
Roozbeh Pournader5f49c282015-04-29 15:38:07 -070064endif # !FONT_NOTOSANS_JP_FULL
Roozbeh Pournader32a65c72014-07-24 14:36:04 -070065endif # !SMALLER_FONT_FOOTPRINT
Ying Wang46b20e72011-09-29 18:07:41 -070066
Ying Wang193ec662012-02-13 18:55:41 -080067################################
Roozbeh Pournader32a65c72014-07-24 14:36:04 -070068# Use DroidSansMono to hang extra_font_files on
69include $(CLEAR_VARS)
70LOCAL_MODULE := DroidSansMono.ttf
71LOCAL_SRC_FILES := $(LOCAL_MODULE)
72LOCAL_MODULE_CLASS := ETC
73LOCAL_MODULE_TAGS := optional
74LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
75LOCAL_REQUIRED_MODULES := $(extra_font_files)
76include $(BUILD_PREBUILT)
77extra_font_files :=
78
79################################
80# Include DroidSansFallback only on non-EXTENDED_FONT_FOOTPRINT builds
81ifneq ($(EXTENDED_FONT_FOOTPRINT),true)
82
83# Include a subset of DroidSansFallback on SMALLER_FONT_FOOTPRINT build
84ifeq ($(SMALLER_FONT_FOOTPRINT),true)
85droidsans_fallback_src := DroidSansFallback.ttf
86else # !SMALLER_FONT_FOOTPRINT
87droidsans_fallback_src := DroidSansFallbackFull.ttf
88endif # SMALLER_FONT_FOOTPRINT
89
Ying Wang46b20e72011-09-29 18:07:41 -070090include $(CLEAR_VARS)
91LOCAL_MODULE := DroidSansFallback.ttf
92LOCAL_SRC_FILES := $(droidsans_fallback_src)
93LOCAL_MODULE_CLASS := ETC
94LOCAL_MODULE_TAGS := optional
95LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
Ying Wang8e359812011-10-06 11:14:13 -070096include $(BUILD_PREBUILT)
Ying Wang46b20e72011-09-29 18:07:41 -070097droidsans_fallback_src :=
Roozbeh Pournader32a65c72014-07-24 14:36:04 -070098
99endif # !EXTENDED_FONT_FOOTPRINT
100
Ying Wang193ec662012-02-13 18:55:41 -0800101################################
Roozbeh Pournader32a65c72014-07-24 14:36:04 -0700102# Build the rest of font files as prebuilt.
Ying Wang193ec662012-02-13 18:55:41 -0800103
104# $(1): The source file name in LOCAL_PATH.
105# It also serves as the module name and the dest file name.
106define build-one-font-module
107$(eval include $(CLEAR_VARS))\
108$(eval LOCAL_MODULE := $(1))\
109$(eval LOCAL_SRC_FILES := $(1))\
110$(eval LOCAL_MODULE_CLASS := ETC)\
111$(eval LOCAL_MODULE_TAGS := optional)\
112$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\
113$(eval include $(BUILD_PREBUILT))
114endef
115
116font_src_files := \
Keun young Park08761012012-06-05 15:20:17 -0700117 Clockopia.ttf \
118 AndroidClock.ttf \
119 AndroidClock_Highlight.ttf \
120 AndroidClock_Solid.ttf
121
Ying Wang193ec662012-02-13 18:55:41 -0800122$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
123
124build-one-font-module :=
125font_src_files :=