Android.mk revision f99c12cee55bae44bbac0a943a18b5121c007101
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################################ 50193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# On space-constrained devices, we include a subset of fonts: 51193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangifeq ($(SMALLER_FONT_FOOTPRINT),true) 52f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 53193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdroidsans_fallback_src := DroidSansFallback.ttf 54f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 55f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseelse # !SMALLER_FONT_FOOTPRINT 56f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 57f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leasedroidsans_fallback_src := DroidSansFallbackFull.ttf 58f99c12cee55bae44bbac0a943a18b5121c007101Victoria Lease 59f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseifneq ($(EXTENDED_FONT_FOOTPRINT),true) 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 68f99c12cee55bae44bbac0a943a18b5121c007101Victoria Leaseendif # !EXTENDED_FONT_FOOTPRINT 691c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brenner 708e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangendif # SMALLER_FONT_FOOTPRINT 718e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang 72193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################ 7346b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(CLEAR_VARS) 748e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying WangLOCAL_MODULE := DroidSansFallback.ttf 758e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying WangLOCAL_SRC_FILES := $(droidsans_fallback_src) 7646b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_CLASS := ETC 7746b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_TAGS := optional 7846b20e7f41ded340596b732aaf08cc2d05a8e842Ying WangLOCAL_MODULE_PATH := $(TARGET_OUT)/fonts 791c097a9c21096a0d677f336081bfdeb4cfc96063Russell BrennerLOCAL_REQUIRED_MODULES := $(extra_font_files) 8046b20e7f41ded340596b732aaf08cc2d05a8e842Ying Wanginclude $(BUILD_PREBUILT) 818e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wang 828e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangfont_symlink_src := 838e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangfont_symlink := 848e359817da14f6a4ffcf3bf4f7a59bc4fef8c211Ying Wangdroidsans_fallback_src := 851c097a9c21096a0d677f336081bfdeb4cfc96063Russell Brennerextra_font_files := 86193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang################################ 87193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# Build the rest font files as prebuilt. 88193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 89193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# $(1): The source file name in LOCAL_PATH. 90193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang# It also serves as the module name and the dest file name. 91193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangdefine build-one-font-module 92193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(CLEAR_VARS))\ 93193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE := $(1))\ 94193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_SRC_FILES := $(1))\ 95193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_CLASS := ETC)\ 96193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_TAGS := optional)\ 97193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts)\ 98193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(eval include $(BUILD_PREBUILT)) 99193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangendef 100193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 101193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := \ 102193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang Roboto-Regular.ttf \ 103193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang Roboto-Bold.ttf \ 104193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang Roboto-Italic.ttf \ 105193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang Roboto-BoldItalic.ttf \ 106087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park DroidSansMono.ttf \ 107087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park Clockopia.ttf \ 108087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock.ttf \ 109087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock_Highlight.ttf \ 110087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park AndroidClock_Solid.ttf 111087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park 112087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkifeq ($(MINIMAL_FONT_FOOTPRINT),true) 113087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park 114d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-Black.ttf,Roboto-Bold.ttf)) 115e210ded9fc794197dc5aa69d9c46ea602df21575Roozbeh Pournader$(eval $(call create-font-symlink,Roboto-BlackItalic.ttf,Roboto-BoldItalic.ttf)) 116087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-Light.ttf,Roboto-Regular.ttf)) 117087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,Roboto-LightItalic.ttf,Roboto-Italic.ttf)) 118d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-Medium.ttf,Roboto-Regular.ttf)) 119d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease$(eval $(call create-font-symlink,Roboto-MediumItalic.ttf,Roboto-Italic.ttf)) 120be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-Thin.ttf,Roboto-Regular.ttf)) 121be456f2e81ac9c205178883b6cbf880304665319Raph Levien$(eval $(call create-font-symlink,Roboto-ThinItalic.ttf,Roboto-Italic.ttf)) 122087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Regular.ttf,Roboto-Regular.ttf)) 123087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Bold.ttf,Roboto-Bold.ttf)) 124087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-Italic.ttf,Roboto-Italic.ttf)) 125087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park$(eval $(call create-font-symlink,RobotoCondensed-BoldItalic.ttf,Roboto-BoldItalic.ttf)) 126087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park 127087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkelse # !MINIMAL_FONT 128087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkfont_src_files += \ 129d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease Roboto-Black.ttf \ 130e210ded9fc794197dc5aa69d9c46ea602df21575Roozbeh Pournader Roboto-BlackItalic.ttf \ 131289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien Roboto-Light.ttf \ 132289c09aae5879936bdeeabdc8047fcf2c7d28c6eRaph Levien Roboto-LightItalic.ttf \ 133d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease Roboto-Medium.ttf \ 134d0769f6981ab8eea039a9516bbc37c8fbacfd545Victoria Lease Roboto-MediumItalic.ttf \ 135be456f2e81ac9c205178883b6cbf880304665319Raph Levien Roboto-Thin.ttf \ 136be456f2e81ac9c205178883b6cbf880304665319Raph Levien Roboto-ThinItalic.ttf \ 137467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien RobotoCondensed-Regular.ttf \ 138467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien RobotoCondensed-Bold.ttf \ 139467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien RobotoCondensed-Italic.ttf \ 140467ea516175f5dfa52c4b9900d24e6b0062721d1Raph Levien RobotoCondensed-BoldItalic.ttf \ 141f1596064d38b4e9f6cacd6703f282d376f32b5b3Justin Koh RobotoCondensed-Light.ttf \ 142f1596064d38b4e9f6cacd6703f282d376f32b5b3Justin Koh RobotoCondensed-LightItalic.ttf \ 1434ce0931ffd78c0cfe1de37c291f96b5275ae53a4Victoria Lease AndroidEmoji.ttf 144087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Park 145087610198e82bc5537b2a8e9c07ed6a20829a16dKeun young Parkendif # !MINIMAL_FONT 146193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 147193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang$(foreach f, $(font_src_files), $(call build-one-font-module, $(f))) 148193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wang 149193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangbuild-one-font-module := 150193ec66214ecf4cdb43702655a4a571ae0c7e6ceYing Wangfont_src_files := 151