From: Deepanshu Gupta Date: Fri, 1 Aug 2014 17:14:15 +0000 (-0700) Subject: Use fonts from generic device for the SDK. X-Git-Tag: android-x86-6.0-r1~144^2~1^2~268^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4e5e5825222dc5f3608a4b8a61c0ff46f0cdcece;p=android-x86%2Fbuild.git Use fonts from generic device for the SDK. This removes the explicit list of fonts for the SDK and replaces it with the fonts built for the generic device. Also, the symlinked fonts are copied becuase Windows doesn't support symlinks. Change-Id: I8b18b2ab0149ab24448f27dbd5f9716e5d360029 --- diff --git a/core/Makefile b/core/Makefile index c556ed780..ede5a88e9 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1645,6 +1645,29 @@ else sdk_atree_files += $(atree_dir)/sdk.atree endif +# For fonts to be bundled with the SDK. We copy them from the output of the device build. +# They are also processed by the following script to edit their PS Names. +sdk_font_rename_script := frameworks/base/tools/layoutlib/rename_font/build_font_single.py +fonttools_lib := external/fonttools/Lib +sdk_font_temp_dir := $(call intermediates-dir-for,PACKAGING,sdk-fonts) +sdk_fonts := $(filter $(TARGET_OUT)/fonts/%tf, $(INTERNAL_SYSTEMIMAGE_FILES)) +sdk_fonts := $(addprefix $(sdk_font_temp_dir)/, $(notdir $(sdk_fonts))) +sdk_font_config := $(wildcard frameworks/base/data/fonts/*.xml) +sdk_font_config := $(addprefix $(sdk_font_temp_dir)/, $(notdir $(sdk_font_config))) + +# Files ending in 'tf' - .ttf or .otf. This excludes .xml files +$(sdk_fonts): $(sdk_font_temp_dir)/%tf: $(TARGET_OUT)/fonts/%tf \ + $(sdk_font_rename_script) + $(hide) mkdir -p $(dir $@) + $(hide) PYTHONPATH=$$PYTHONPATH:$(fonttools_lib) $(sdk_font_rename_script) \ + $< $@ + +# Files ending in 'xml' +$(sdk_font_config): $(sdk_font_temp_dir)/%.xml: \ + frameworks/base/data/fonts/%.xml + $(hide) mkdir -p $(dir $@) + $(hide) cp -vf $< $@ + deps := \ $(target_notice_file_txt) \ $(tools_notice_file_txt) \ @@ -1658,7 +1681,9 @@ deps := \ $(ATREE_FILES) \ $(sdk_atree_files) \ $(HOST_OUT_EXECUTABLES)/atree \ - $(HOST_OUT_EXECUTABLES)/line_endings + $(HOST_OUT_EXECUTABLES)/line_endings \ + $(sdk_fonts) \ + $(sdk_font_config) INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip $(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name) @@ -1666,10 +1691,6 @@ $(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name) $(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file) $(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files) -sdk_font_temp_dir := $(call intermediates-dir-for,PACKAGING,sdk-fonts) -sdk_font_input_list := frameworks/base/data/fonts external/noto-fonts external/google-fonts external/naver-fonts -sdk_font_rename_script := frameworks/base/tools/layoutlib/rename_font/build_font.py - # Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built. # #SDK_GNU_ERROR := true @@ -1685,9 +1706,6 @@ $(INTERNAL_SDK_TARGET): $(deps) fi; \ done; \ if [ $$FAIL ]; then exit 1; fi - $(hide) mkdir -p $(sdk_font_temp_dir) - $(hide) PYTHONPATH=$$PYTHONPATH:external/fonttools/Lib $(sdk_font_rename_script) $(sdk_font_input_list) \ - $(sdk_font_temp_dir) $(hide) ( \ ATREE_STRIP="strip -x" \ $(HOST_OUT_EXECUTABLES)/atree \ diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 62303d6c5..3ae586080 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -87,3 +87,8 @@ BOARD_SEPOLICY_UNION += \ shell.te \ surfaceflinger.te \ system_server.te + +ifeq ($(TARGET_PRODUCT),sdk) + # include an expanded selection of fonts for the SDK. + EXTENDED_FONT_FOOTPRINT := true +endif