1# Copyright (c) 2021-2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13import("//build/ohos.gni") 14import("systemres.gni") 15 16dep_list = [] 17 18foreach(font, sys_fonts_list) { 19 isLoadFont = false 20 foreach(device, font.support_devices) { 21 if (system_resources_font_feature_product == device) { 22 isLoadFont = true 23 } 24 } 25 26 if (isLoadFont) { 27 font_name = font.font_name 28 ohos_prebuilt_etc(font_name) { 29 source = font.font_path 30 if (font.alias_name != "") { 31 output = font.alias_name 32 } 33 module_install_dir = "fonts" 34 subsystem_name = "global" 35 part_name = "system_resources" 36 } 37 dep_list += [ font_name ] 38 } 39} 40 41ohos_shared_headers("ohos_fonts") { 42 deps = [] 43 foreach(dep, dep_list) { 44 deps += [ ":${dep}" ] 45 } 46 include_dirs = [] 47 subsystem_name = "global" 48 part_name = "system_resources" 49} 50 51ohos_copy("copy_preview_fonts") { 52 sources = [] 53 foreach(font, sys_fonts_list) { 54 sources += [ font.font_path ] 55 } 56 outputs = 57 [ target_out_dir + "/previewer/common/bin/fonts/{{source_file_part}}" ] 58 module_source_dir = target_out_dir + "/previewer/common/bin/" 59 module_install_name = "" 60 subsystem_name = "global" 61 part_name = "system_resources" 62} 63 64ohos_copy("copy_preview_fonts_ext") { 65 sources = [ 66 "${fontconfig_path}", 67 "${fontconfig_ohos_path}", 68 ] 69 foreach(font, sys_fonts_list) { 70 sources += [ font.font_path ] 71 } 72 outputs = 73 [ target_out_dir + "/previewer/resources/fonts/{{source_file_part}}" ] 74 module_source_dir = target_out_dir + "/previewer/resources" 75 module_install_name = "" 76 subsystem_name = "global" 77 part_name = "system_resources" 78} 79