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  font_name = font.font_name
20  ohos_prebuilt_etc(font_name) {
21    source = font.font_path
22    module_install_dir = "fonts"
23    subsystem_name = "global"
24    part_name = "ace_engine"
25  }
26  dep_list += [ font_name ]
27}
28
29group("ohos_fonts") {
30  deps = []
31  foreach(dep, dep_list) {
32    deps += [ ":${dep}" ]
33  }
34
35  if (system_resources_support_ext) {
36    deps += [ "${systemres_ext_path}:ohos_fonts_ext" ]
37  }
38}
39
40ohos_copy("copy_preview_fonts") {
41  sources = []
42  foreach(font, sys_fonts_list) {
43    sources += [ font.font_path ]
44  }
45  outputs =
46      [ target_out_dir + "/previewer/common/bin/fonts/{{source_file_part}}" ]
47  module_source_dir = target_out_dir + "/previewer/common/bin/"
48  module_install_name = ""
49  subsystem_name = "global"
50  part_name = "system_resources"
51}
52