Skip to content

Commit 46b20e7

Browse files
author
Ying Wang
committed
Correction the use of SMALLER_FONT_FOOTPRINT
SMALLER_FONT_FOOTPRINT is a BoardConfig variable that's only available in Android.mks but not product config makefiles. Change-Id: I1784b6e8c744ffcca1538e76d338f5800f150e72
1 parent 2d56123 commit 46b20e7

File tree

3 files changed

+66
-13
lines changed

3 files changed

+66
-13
lines changed

CleanSpec.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framew
113113
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
114114
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/Lohit_Hindi.ttf)
115115
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
116+
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/fonts/DroidSans*)
116117
# ************************************************
117118
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
118119
# ************************************************

data/fonts/Android.mk

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
18+
LOCAL_PATH := $(call my-dir)
19+
20+
ifeq ($(SMALLER_FONT_FOOTPRINT),true)
21+
droidsans_fallback_src := DroidSansFallback.ttf
22+
extra_droidsans_fonts :=
23+
else
24+
droidsans_fallback_src := DroidSansFallbackFull.ttf
25+
extra_droidsans_fonts := DroidSans.ttf DroidSans-Bold.ttf DroidSansEthiopic-Regular.ttf
26+
endif
27+
28+
include $(CLEAR_VARS)
29+
LOCAL_MODULE := DroidSansFallback.ttf
30+
LOCAL_SRC_FILES := $(droidsans_fallback_src)
31+
LOCAL_MODULE_CLASS := ETC
32+
LOCAL_MODULE_TAGS := optional
33+
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
34+
LOCAL_REQUIRED_MODULES := $(extra_droidsans_fonts)
35+
droidsans_fallback_src :=
36+
extra_droidsans_fonts :=
37+
include $(BUILD_PREBUILT)
38+
39+
include $(CLEAR_VARS)
40+
LOCAL_MODULE := DroidSans.ttf
41+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
42+
LOCAL_MODULE_CLASS := ETC
43+
LOCAL_MODULE_TAGS := optional
44+
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
45+
include $(BUILD_PREBUILT)
46+
47+
include $(CLEAR_VARS)
48+
LOCAL_MODULE := DroidSans-Bold.ttf
49+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
50+
LOCAL_MODULE_CLASS := ETC
51+
LOCAL_MODULE_TAGS := optional
52+
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
53+
include $(BUILD_PREBUILT)
54+
55+
include $(CLEAR_VARS)
56+
LOCAL_MODULE := DroidSansEthiopic-Regular.ttf
57+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
58+
LOCAL_MODULE_CLASS := ETC
59+
LOCAL_MODULE_TAGS := optional
60+
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
61+
include $(BUILD_PREBUILT)

data/fonts/fonts.mk

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,7 @@ PRODUCT_COPY_FILES := \
3939
frameworks/base/data/fonts/system_fonts.xml:system/etc/system_fonts.xml \
4040
frameworks/base/data/fonts/fallback_fonts.xml:system/etc/fallback_fonts.xml
4141

42-
# Next, include additional fonts, depending on how much space we have
43-
ifeq ($(SMALLER_FONT_FOOTPRINT),true)
44-
# Smaller fonts alternatives
45-
PRODUCT_COPY_FILES += \
46-
frameworks/base/data/fonts/DroidSansFallback.ttf:system/fonts/DroidSansFallback.ttf
47-
else
48-
# Full font set alternatives
49-
PRODUCT_COPY_FILES += \
50-
frameworks/base/data/fonts/DroidSansFallbackFull.ttf:system/fonts/DroidSansFallback.ttf \
51-
frameworks/base/data/fonts/DroidSans.ttf:system/fonts/DroidSans.ttf \
52-
frameworks/base/data/fonts/DroidSans-Bold.ttf:system/fonts/DroidSans-Bold.ttf \
53-
frameworks/base/data/fonts/DroidSansEthiopic-Regular.ttf:system/fonts/DroidSansEthiopic-Regular.ttf
54-
endif
42+
# Next, include additional fonts, depending on how much space we have.
43+
# Details see module definitions in Android.mk.
44+
PRODUCT_PACKAGES := \
45+
DroidSansFallback.ttf

0 commit comments

Comments
 (0)