Android.mk revision 8e359817da14f6a4ffcf3bf4f7a59bc4fef8c211
1# 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
20##########################################
21# We may only afford small font footprint.
22##########################################
23# Use only symlinks.
24# Symlink: DroidSans.ttf -> Roboto-Regular.ttf
25LOCAL_MODULE := DroidSans.ttf
26font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Regular.ttf
27font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE)
28$(font_symlink) : $(font_symlink_src)
29	@echo "Symlink: $@ -> $<"
30	@mkdir -p $(dir $@)
31	@rm -rf $@
32	$(hide) ln -sf $(notdir $<) $@
33
34# this magic makes LOCAL_REQUIRED_MODULES work
35ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
36    $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink)
37
38################################
39# Symlink: DroidSans-Bold.ttf -> Roboto-Bold.ttf
40LOCAL_MODULE := DroidSans-Bold.ttf
41font_symlink_src := $(PRODUCT_OUT)/system/fonts/Roboto-Bold.ttf
42font_symlink := $(dir $(font_symlink_src))$(LOCAL_MODULE)
43$(font_symlink) : $(font_symlink_src)
44	@echo "Symlink: $@ -> $<"
45	@mkdir -p $(dir $@)
46	@rm -rf $@
47	$(hide) ln -sf $(notdir $<) $@
48
49# this magic makes LOCAL_REQUIRED_MODULES work
50ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
51    $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(font_symlink)
52
53################################
54include $(CLEAR_VARS)
55LOCAL_MODULE := DroidSansEthiopic-Regular.ttf
56LOCAL_SRC_FILES := $(LOCAL_MODULE)
57LOCAL_MODULE_CLASS := ETC
58LOCAL_MODULE_TAGS := optional
59LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
60include $(BUILD_PREBUILT)
61
62################################
63ifeq ($(SMALLER_FONT_FOOTPRINT),true)
64droidsans_fallback_src := DroidSansFallback.ttf
65extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf
66else
67droidsans_fallback_src := DroidSansFallbackFull.ttf
68extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf DroidSansEthiopic-Regular.ttf
69endif  # SMALLER_FONT_FOOTPRINT
70
71include $(CLEAR_VARS)
72LOCAL_MODULE := DroidSansFallback.ttf
73LOCAL_SRC_FILES := $(droidsans_fallback_src)
74LOCAL_MODULE_CLASS := ETC
75LOCAL_MODULE_TAGS := optional
76LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
77LOCAL_REQUIRED_MODULES := $(extra_droidsans_fonts)
78include $(BUILD_PREBUILT)
79
80font_symlink_src :=
81font_symlink :=
82droidsans_fallback_src :=
83extra_droidsans_fonts :=
84