• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2024 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.
13
14import("//build/ohos.gni")
15import("fonts_config.gni")
16
17dep_list = []
18
19foreach(font, notofonts_fonts_list) {
20  isLoadFont = false
21  foreach(device, font.support_devices) {
22    if (notofonts_font_feature_product == device) {
23      isLoadFont = true
24    }
25  }
26
27  if (isLoadFont) {
28    font_name = font.font_name
29    ohos_prebuilt_etc(font_name) {
30      if (font_name == "NotoSans") {
31        symlink_target_name = [ "Roboto-Regular.ttf" ]
32      }
33      source = font.font_path
34      if (font.alias_name != "") {
35        output = font.alias_name
36      }
37      module_install_dir = "fonts"
38      subsystem_name = "thirdparty"
39      part_name = "notofonts"
40    }
41    dep_list += [ font_name ]
42  }
43}
44
45group("fonts_notofonts") {
46  deps = []
47  foreach(dep, dep_list) {
48    deps += [ ":${dep}" ]
49  }
50}
51
52ohos_copy("copy_preview_fonts_notofonts") {
53  sources = []
54  foreach(font, notofonts_fonts_list) {
55    sources += [ font.font_path ]
56  }
57  outputs =
58      [ target_out_dir + "/previewer/common/bin/fonts/{{source_file_part}}" ]
59  module_source_dir = target_out_dir + "/previewer/common/bin/"
60  module_install_name = ""
61  subsystem_name = "thirdparty"
62  part_name = "notofonts"
63}
64
65ohos_copy("copy_preview_fonts_notofonts_ext") {
66  sources = []
67  foreach(font, notofonts_fonts_list) {
68    sources += [ font.font_path ]
69  }
70  outputs =
71      [ target_out_dir + "/previewer/resources/fonts/{{source_file_part}}" ]
72  module_source_dir = target_out_dir + "/previewer/resources"
73  module_install_name = ""
74  subsystem_name = "thirdparty"
75  part_name = "notofonts"
76}
77