Android.mk revision 5225620508a5a0d39de4f508cec5cecec60f527d
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 205225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournader# Use full Noto Sans Japanese font on non-smaller footprints 215225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournaderifneq ($(SMALLER_FONT_FOOTPRINT),true) 2249455ab3f562112e963cd27a57320508778f602bRoozbeh PournaderFONT_NOTOSANS_JP_FULL := true 2349455ab3f562112e963cd27a57320508778f602bRoozbeh Pournaderendif 2449455ab3f562112e963cd27a57320508778f602bRoozbeh Pournader 258e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang########################################## 26087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# create symlink for given font 27087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# $(1): new font $(2): link target 28087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park# should be used with eval: $(eval $(call ...)) 29087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkdefine create-font-symlink 30087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(PRODUCT_OUT)/system/fonts/$(1) : $(PRODUCT_OUT)/system/fonts/$(2) 31087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park @echo "Symlink: $$@ -> $$<" 32087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park @mkdir -p $$(dir $$@) 33087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park @rm -rf $$@ 34087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park $(hide) ln -sf $$(notdir $$<) $$@ 358e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang# this magic makes LOCAL_REQUIRED_MODULES work 36087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young ParkALL_MODULES.$(1).INSTALLED := \ 37087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park $(ALL_MODULES.$(1).INSTALLED) $(PRODUCT_OUT)/system/fonts/$(1) 38087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkendef 398e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang 40087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park########################################## 415225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournader# The following fonts are just symlinks, for backward compatibility. 42087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park########################################## 43087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,DroidSans.ttf,Roboto-Regular.ttf)) 44087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,DroidSans-Bold.ttf,Roboto-Bold.ttf)) 45a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Regular.ttf,NotoSerif-Regular.ttf)) 46a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Bold.ttf,NotoSerif-Bold.ttf)) 47a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-Italic.ttf,NotoSerif-Italic.ttf)) 48a08f0f8f453bb192dd0c4cd25a5aeb05986805fcVictoria Lease$(eval $(call create-font-symlink,DroidSerif-BoldItalic.ttf,NotoSerif-BoldItalic.ttf)) 4946b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wang 50f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseextra_font_files := \ 51f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease DroidSans.ttf \ 52f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease DroidSans-Bold.ttf 53f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 548e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang################################ 5532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Do not include Motoya on space-constrained devices 5632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderifneq ($(SMALLER_FONT_FOOTPRINT),true) 575225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournader# Do not include Motoya if we are including Noto Sans Japanese 585f49c28bfcdd43277b155da65c9312109fac142cRoozbeh Pournaderifneq ($(FONT_NOTOSANS_JP_FULL),true) 59f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 6046b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS) 611c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE := MTLmr3m.ttf 621c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_SRC_FILES := $(LOCAL_MODULE) 631c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_CLASS := ETC 641c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_TAGS := optional 651c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 661c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerinclude $(BUILD_PREBUILT) 67f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseextra_font_files += MTLmr3m.ttf 681c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner 695f49c28bfcdd43277b155da65c9312109fac142cRoozbeh Pournaderendif # !FONT_NOTOSANS_JP_FULL 7032a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderendif # !SMALLER_FONT_FOOTPRINT 718e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang 72193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################ 7332a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Use DroidSansMono to hang extra_font_files on 7446b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS) 7532a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE := DroidSansMono.ttf 7632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_SRC_FILES := $(LOCAL_MODULE) 7746b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_CLASS := ETC 7846b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_TAGS := optional 7946b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 801c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_REQUIRED_MODULES := $(extra_font_files) 8146b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(BUILD_PREBUILT) 8232a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderextra_font_files := 8332a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader 8432a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader################################ 855225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournader# Include the DroidSansFallback subset on SMALLER_FONT_FOOTPRINT build 8632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderifeq ($(SMALLER_FONT_FOOTPRINT),true) 878e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang 8832a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderinclude $(CLEAR_VARS) 8932a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE := DroidSansFallback.ttf 905225620508a5a0d39de4f508cec5cecec60f527dRoozbeh PournaderLOCAL_SRC_FILES := $(LOCAL_MODULE) 9132a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_CLASS := ETC 9232a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_TAGS := optional 9332a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh PournaderLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 9432a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournaderinclude $(BUILD_PREBUILT) 958e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangdroidsans_fallback_src := 9632a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader 975225620508a5a0d39de4f508cec5cecec60f527dRoozbeh Pournaderendif # SMALLER_FONT_FOOTPRINT 9832a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader 99193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################ 10032a65c7ddd6bebe30af668274757599d5a47cc60Roozbeh Pournader# Build the rest of font files as prebuilt. 101193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 102193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# $(1): The source file name in LOCAL_PATH. 103193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# It also serves as the module name and the dest file name. 104193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdefine build-one-font-module 105193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(CLEAR_VARS))\ 106193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE := $(1))\ 107193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_SRC_FILES := $(1))\ 108193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_CLASS := ETC)\ 109193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_TAGS := optional)\ 110193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ 111193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(BUILD_PREBUILT)) 112193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangendef 113193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 114193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := \ 115087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park Clockopia.ttf \ 116087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock.ttf \ 117087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock_Highlight.ttf \ 118087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock_Solid.ttf 119087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park 120193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) 121193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 122193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangbuild-one-font-module := 123193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := 124