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##########################################
36087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# We may only afford small font footprint.
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))
4046b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
418e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang################################
42193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# On space-constrained devices, we include a subset of fonts:
43193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangifeq ($(SMALLER_FONT_FOOTPRINT),true)
44193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdroidsans_fallback_src := DroidSansFallback.ttf
451c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerextra_font_files := DroidSans.ttf DroidSans-Bold.ttf
46193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangelse
4746b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS)
488e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying WangLOCAL_MODULE := DroidSansEthiopic-Regular.ttf
4946b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_SRC_FILES := $(LOCAL_MODULE)
5046b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_CLASS := ETC
5146b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_TAGS := optional
5246b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
5346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(BUILD_PREBUILT)
5446b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang
551c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerinclude $(CLEAR_VARS)
561c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE := MTLmr3m.ttf
571c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_SRC_FILES := $(LOCAL_MODULE)
581c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_CLASS := ETC
591c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_TAGS := optional
601c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
611c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerinclude $(BUILD_PREBUILT)
621c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner
638e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangdroidsans_fallback_src := DroidSansFallbackFull.ttf
641c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerextra_font_files := \
651c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner	DroidSans.ttf \
661c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner	DroidSans-Bold.ttf \
671c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner	DroidSansEthiopic-Regular.ttf \
68ac1cbaf2e5575ac75a0160e13089d51a0bb232faBilly Hewlett	MTLmr3m.ttf
698e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangendif  # SMALLER_FONT_FOOTPRINT
708e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang
71193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################
7246b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS)
738e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying WangLOCAL_MODULE := DroidSansFallback.ttf
748e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying WangLOCAL_SRC_FILES := $(droidsans_fallback_src)
7546b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_CLASS := ETC
7646b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_TAGS := optional
7746b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
781c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_REQUIRED_MODULES := $(extra_font_files)
7946b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(BUILD_PREBUILT)
808e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang
818e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangfont_symlink_src :=
828e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangfont_symlink :=
838e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangdroidsans_fallback_src :=
841c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerextra_font_files :=
85193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################
86193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# Build the rest font files as prebuilt.
87193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
88193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# $(1): The source file name in LOCAL_PATH.
89193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang#       It also serves as the module name and the dest file name.
90193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdefine build-one-font-module
91193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(CLEAR_VARS))\
92193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE := $(1))\
93193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_SRC_FILES := $(1))\
94193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_CLASS := ETC)\
95193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_TAGS := optional)\
96193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\
97193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(BUILD_PREBUILT))
98193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangendef
99193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
100193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := \
101193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Regular.ttf \
102193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Bold.ttf \
103193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-Italic.ttf \
104193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    Roboto-BoldItalic.ttf \
105087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    DroidSerif-Regular.ttf \
106087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    DroidSerif-Bold.ttf \
107087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    DroidSerif-Italic.ttf \
108087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    DroidSerif-BoldItalic.ttf \
109087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    DroidSansMono.ttf \
110087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    Clockopia.ttf \
111087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock.ttf \
112087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock_Highlight.ttf \
113087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park    AndroidClock_Solid.ttf
114087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
115087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkifeq ($(MINIMAL_FONT_FOOTPRINT),true)
116087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
117087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf))
118087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf))
119be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf))
120be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf))
121087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf))
122087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf))
123087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf))
124087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf))
125087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
126087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkelse # !MINIMAL_FONT
127087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkfont_src_files += \
128289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien    Roboto-Light.ttf \
129289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien    Roboto-LightItalic.ttf \
130be456f2e81ac9c205178883b6cbf880304665319Raph Levien    Roboto-Thin.ttf \
131be456f2e81ac9c205178883b6cbf880304665319Raph Levien    Roboto-ThinItalic.ttf \
132467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Regular.ttf \
133467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Bold.ttf \
134467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-Italic.ttf \
135467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien    RobotoCondensed-BoldItalic.ttf \
136193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    DroidNaskh-Regular.ttf \
13715b8c185037410dfd15b65b2246500e0a2545c5dRaph Levien    DroidNaskhUI-Regular.ttf \
138193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    DroidSansHebrew-Regular.ttf \
139193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    DroidSansHebrew-Bold.ttf \
140193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang    DroidSansArmenian.ttf \
1414ce0931ffd78c0cfe1de37c291f96b5275ae53a4Victoria Lease    DroidSansGeorgian.ttf \
1424ce0931ffd78c0cfe1de37c291f96b5275ae53a4Victoria Lease    AndroidEmoji.ttf
143087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park
144087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkendif # !MINIMAL_FONT
145193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
146193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
147193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang
148193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangbuild-one-font-module :=
149193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files :=
150