1# Copyright (C) 2025 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/config/components/ets_frontend/ets2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/graphic/graphic_2d/frameworks/text/config.gni") 17import("//foundation/graphic/graphic_2d/graphic_config.gni") 18 19group("text_engine_ani_group") { 20 deps = [ 21 ":text_engine_ani", 22 ":text_engine_etc", 23 ] 24} 25 26config("text_config") { 27 visibility = [ ":*" ] 28 29 include_dirs = [ 30 "$rosen_text_root", 31 "$rosen_text_root/interface/mlb/ani/include", 32 "$rosen_text_root/interface/export/rosen_text", 33 "$graphic_2d_root/interfaces/kits/ani/drawing", 34 "$graphic_2d_root/rosen/modules/2d_graphics/include", 35 ] 36} 37 38ohos_shared_library("text_engine_ani") { 39 branch_protector_ret = "pac_ret" 40 sources = [ 41 "./src/ani_drawing_converter.cpp", 42 "./src/ani_font_collection.cpp", 43 "./src/ani_line_metrics_converter.cpp", 44 "./src/ani_paragraph.cpp", 45 "./src/ani_paragraph_builder.cpp", 46 "./src/ani_paragraph_style_converter.cpp", 47 "./src/ani_resource_parser.cpp", 48 "./src/ani_run_metrics_converter.cpp", 49 "./src/ani_text_manager.cpp", 50 "./src/ani_text_style_converter.cpp", 51 "./src/ani_text_utils.cpp", 52 ] 53 54 configs = [ ":text_config" ] 55 sanitize = { 56 cfi = true 57 cfi_cross_dso = true 58 cfi_vcall_icall_only = true 59 debug = false 60 } 61 62 deps = [ 63 "$graphic_2d_root/interfaces/kits/ani/drawing:drawing_ani", 64 "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics", 65 "$rosen_text_root:rosen_text", 66 ] 67 68 external_deps = [ 69 "ability_runtime:abilitykit_native", 70 "ability_runtime:app_context", 71 "hilog:libhilog", 72 "resource_management:global_resmgr", 73 "runtime_core:ani", 74 "runtime_core:libarkruntime", 75 ] 76 77 if (current_os == "ohos" || current_os == "ohos_ng") { 78 external_deps += [ "init:libbegetutil" ] 79 defines = [ "OHOS_TEXT_ENABLE" ] 80 } 81 cflags_cc = [ "-std=c++17" ] 82 83 if (current_os == "mingw") { 84 defines += [ "WINDOWS_PLATFORM" ] 85 } 86 87 innerapi_tags = [ "platformsdk" ] 88 89 part_name = "graphic_2d" 90 subsystem_name = "graphic" 91} 92 93generate_static_abc("text_engine") { 94 base_url = "$rosen_text_root/interface/export/ani" 95 files = [ "$rosen_text_root/interface/export/ani/@ohos.graphics.text.ets" ] 96 is_boot_abc = "True" 97 device_dst_file = "/system/framework/text_engine.abc" 98} 99 100ohos_prebuilt_etc("text_engine_etc") { 101 source = "$target_out_dir/text_engine.abc" 102 module_install_dir = "framework" 103 subsystem_name = "graphic" 104 part_name = "graphic_2d" 105 deps = [ ":text_engine" ] 106} 107