Files
2026-04-23 17:26:20 +08:00

100 lines
2.9 KiB
Plaintext

#Copyright (c) 2024 Huawei Device Co., Ltd.
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
import("//build/ohos.gni")
import("fonts_config.gni")
dep_list = []
foreach(font, notofonts_fonts_list) {
isLoadFont = false
foreach(device, font.support_devices) {
if (notofonts_font_feature_product == device) {
isLoadFont = true
}
}
if (isLoadFont) {
font_name = font.font_name
ohos_prebuilt_etc(font_name) {
if (font_name == "NotoSans") {
symlink_target_name = [ "Roboto-Regular.ttf" ]
}
source = font.font_path
if (font.alias_name != "") {
output = font.alias_name
}
module_install_dir = "fonts"
subsystem_name = "thirdparty"
part_name = "notofonts"
}
dep_list += [ font_name ]
}
}
ohos_shared_headers("fonts_notofonts") {
include_dirs = []
deps = []
foreach(dep, dep_list) {
deps += [ ":${dep}" ]
}
subsystem_name = "thirdparty"
part_name = "notofonts"
}
preview_sources = []
foreach(font, notofonts_fonts_list) {
if (font.alias_name == "") {
preview_sources += [ font.font_path ]
}
}
ohos_copy("copy_preview_fonts_notofonts") {
sources = preview_sources
outputs = [ target_out_dir + "/previewer/common/bin/fonts/{{source_file_part}}" ]
module_source_dir = target_out_dir + "/previewer/common/bin/"
module_install_name = ""
subsystem_name = "thirdparty"
part_name = "notofonts"
}
ohos_copy("copy_preview_fonts_notofonts_ext") {
sources = preview_sources
outputs = [ target_out_dir + "/previewer/resources/fonts/{{source_file_part}}" ]
module_source_dir = target_out_dir + "/previewer/resources"
module_install_name = ""
subsystem_name = "thirdparty"
part_name = "notofonts"
}
foreach(font, notofonts_fonts_list) {
if (font.alias_name != "") {
ohos_copy("copy_preview_alias_${font.font_name}") {
sources = [ font.font_path ]
outputs = [ target_out_dir + "/previewer/common/bin/fonts/${font.alias_name}" ]
module_source_dir = target_out_dir + "/previewer/common/bin/"
module_install_name = ""
subsystem_name = "thirdparty"
part_name = "notofonts"
}
ohos_copy("copy_preview_alias_ext_${font.font_name}") {
sources = [ font.font_path ]
outputs = [ target_out_dir + "/previewer/resources/fonts/${font.alias_name}" ]
module_source_dir = target_out_dir + "/previewer/resources"
module_install_name = ""
subsystem_name = "thirdparty"
part_name = "notofonts"
}
}
}