146b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# Copyright (C) 2011 The Android Open Source Project
246b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang#
346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# Licensed under the Apache License, Version 2.0 (the "License");
446b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# you may not use this file except in compliance with the License.
546b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# You may obtain a copy of the License at
646b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang#
746b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang#      http://www.apache.org/licenses/LICENSE-2.0
846b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang#
946b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# Unless required by applicable law or agreed to in writing, software
1046b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# distributed under the License is distributed on an "AS IS" BASIS,
1146b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1246b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# See the License for the specific language governing permissions and
1346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# limitations under the License.
1446b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
1546b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FIES,
1646b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang# because SMALLER_FONT_FOOTPRINT is only available in Android.mks.
1746b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
1846b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_PATH := $(call my-dir)
1946b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
208e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang##########################################
21087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# create symlink for given font
22087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# $(1): new font $(2): link target
23087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# should be used with eval: $(eval $(call ...))
24087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkdefine create-font-symlink
25087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(PRODUCT_OUT)/system/fonts/$(1) : $(PRODUCT_OUT)/system/fonts/$(2)
26087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park	@echo "Symlink: $$@ -> $$<"
27087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park	@mkdir -p $$(dir $$@)
28087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park	@rm -rf $$@
29087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park	$(hide) ln -sf $$(notdir $$<) $$@
308e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang# this magic makes LOCAL_REQUIRED_MODULES work
31087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young ParkALL_MODULES.$(1).INSTALLED := \
32087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    $(ALL_MODULES.$(1).INSTALLED) $(PRODUCT_OUT)/system/fonts/$(1)
33087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkendef
348e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang
35087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park##########################################
36a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease# The following fonts are distributed as symlink only.
37087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park##########################################
38087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,DroidSans.ttf,Roboto-Regular.ttf))
39087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,DroidSans-Bold.ttf,Roboto-Bold.ttf))
40a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Regular.ttf,NotoSerif-Regular.ttf))
41a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Bold.ttf,NotoSerif-Bold.ttf))
42a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Italic.ttf,NotoSerif-Italic.ttf))
43a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-BoldItalic.ttf,NotoSerif-BoldItalic.ttf))
4446b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
45f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseextra_font_files := \
46f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease    DroidSans.ttf \
47f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease    DroidSans-Bold.ttf
48f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease
498e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang################################
5032a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Do not include Motoya on space-constrained devices
5132a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderifneq ($(SMALLER_FONT_FOOTPRINT),true)
52f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease
5346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS)
541c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE := MTLmr3m.ttf
551c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_SRC_FILES := $(LOCAL_MODULE)
561c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_CLASS := ETC
571c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_TAGS := optional
581c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
591c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerinclude $(BUILD_PREBUILT)
60f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseextra_font_files += MTLmr3m.ttf
611c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner
6232a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderendif  # !SMALLER_FONT_FOOTPRINT
638e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang
64193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################
6532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Use DroidSansMono to hang extra_font_files on
6646b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS)
6732a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE := DroidSansMono.ttf
6832a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_SRC_FILES := $(LOCAL_MODULE)
6946b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_CLASS := ETC
7046b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_TAGS := optional
7146b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
721c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_REQUIRED_MODULES := $(extra_font_files)
7346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(BUILD_PREBUILT)
7432a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderextra_font_files :=
7532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader
7632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader################################
7732a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Include DroidSansFallback only on non-EXTENDED_FONT_FOOTPRINT builds
7832a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderifneq ($(EXTENDED_FONT_FOOTPRINT),true)
7932a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader
8032a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Include a subset of DroidSansFallback on SMALLER_FONT_FOOTPRINT build
8132a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderifeq ($(SMALLER_FONT_FOOTPRINT),true)
8232a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderdroidsans_fallback_src := DroidSansFallback.ttf
8332a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderelse  # !SMALLER_FONT_FOOTPRINT
8432a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderdroidsans_fallback_src := DroidSansFallbackFull.ttf
8532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderendif  # SMALLER_FONT_FOOTPRINT
868e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang
8732a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderinclude $(CLEAR_VARS)
8832a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE := DroidSansFallback.ttf
8932a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_SRC_FILES := $(droidsans_fallback_src)
9032a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_CLASS := ETC
9132a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_TAGS := optional
9232a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
9332a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderinclude $(BUILD_PREBUILT)
948e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangdroidsans_fallback_src :=
9532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader
9632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderendif  # !EXTENDED_FONT_FOOTPRINT
9732a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader
98193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################
9932a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Build the rest of font files as prebuilt.
100193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
101193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# $(1): The source file name in LOCAL_PATH.
102193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang#       It also serves as the module name and the dest file name.
103193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdefine build-one-font-module
104193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(CLEAR_VARS))\
105193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE := $(1))\
106193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_SRC_FILES := $(1))\
107193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_CLASS := ETC)\
108193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_TAGS := optional)\
109193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\
110193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(BUILD_PREBUILT))
111193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangendef
112193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
113193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := \
114193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Regular.ttf \
115193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Bold.ttf \
116193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Italic.ttf \
117193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-BoldItalic.ttf \
118087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    Clockopia.ttf \
119087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock.ttf \
120087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock_Highlight.ttf \
121087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock_Solid.ttf
122087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
123087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkifeq ($(MINIMAL_FONT_FOOTPRINT),true)
124087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
125d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-Black.ttf,Roboto-Bold.ttf))
126e210ded9fc794197dc5aa69d9c46ea602df21575Roozbeh Pournader$(eval $(call create-font-symlink,Roboto-BlackItalic.ttf,Roboto-BoldItalic.ttf))
127087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf))
128087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf))
129d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-Medium.ttf,Roboto-Regular.ttf))
130d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-MediumItalic.ttf,Roboto-Italic.ttf))
131be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf))
132be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf))
133087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf))
134087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf))
135087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf))
136087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf))
137087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
138087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkelse # !MINIMAL_FONT
139087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkfont_src_files += \
140d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease    Roboto-Black.ttf \
141e210ded9fc794197dc5aa69d9c46ea602df21575Roozbeh Pournader    Roboto-BlackItalic.ttf \
142289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien    Roboto-Light.ttf \
143289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien    Roboto-LightItalic.ttf \
144d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease    Roboto-Medium.ttf \
145d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease    Roboto-MediumItalic.ttf \
146be456f2e81ac9c205178883b6cbf880304665319Raph Levien    Roboto-Thin.ttf \
147be456f2e81ac9c205178883b6cbf880304665319Raph Levien    Roboto-ThinItalic.ttf \
148467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Regular.ttf \
149467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Bold.ttf \
150467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Italic.ttf \
151467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-BoldItalic.ttf \
152f1596064d38b4e9f6cacd6703f282d376f32b5b3Justin Koh    RobotoCondensed-Light.ttf \
153cbd098920d3f358312302f76b520a33536c0d0cbRoozbeh Pournader    RobotoCondensed-LightItalic.ttf
154087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
155087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkendif # !MINIMAL_FONT
156193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
157193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
158193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
159193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangbuild-one-font-module :=
160193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files :=
161