1# Copyright (c) 2022 Huawei Device Co., Ltd.. All rights reserved. 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("//foundation/graphic/graphic_2d/graphic_config.gni") 16import("$graphic_2d_root/rosen/modules/2d_engine/rosen_text/config.gni") 17 18config("rosen_text_public_config") { 19 include_dirs = [ 20 "export", 21 "$graphic_2d_root/rosen/modules/2d_graphics/include", 22 "$graphic_2d_root/rosen/modules/2d_graphics/src", 23 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing", 24 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", 25 "$rosen_root/modules/texgine/texgine_drawing/src", 26 "$graphic_2d_root/rosen/modules", 27 "$graphic_2d_root/rosen/modules/render_service_client", 28 "$graphic_2d_root/rosen/modules/render_service_client/core", 29 "$graphic_2d_root/rosen/modules/render_service_base", 30 "$graphic_2d_root/rosen/modules/render_service_base/include", 31 "$graphic_2d_root/rosen/modules/platform/image_native", 32 ] 33} 34 35defines = [ "USE_GRAPHIC_TEXT_GINE" ] 36 37ohos_source_set("rosen_text_inner") { 38 public_deps = [ ":rosen_text_skia" ] 39 40 part_name = "graphic_2d" 41 subsystem_name = "graphic" 42} 43 44ohos_source_set("rosen_text_skia") { 45 public_configs = [ ":rosen_text_public_config" ] 46 include_dirs = [ 47 "$rosen_root/modules/2d_engine/rosen_text/skia_txt", 48 "$rosen_root/modules/2d_engine/rosen_text/skia_txt/txt/src", 49 ] 50 51 if (is_arkui_x) { 52 include_dirs += [ "//third_party/bounds_checking_function/include" ] 53 } else { 54 public_external_deps = [ "bounds_checking_function:libsec_shared" ] 55 } 56 57 defines += [ 58 "USE_GRAPHIC_TEXT_GINE", 59 "WINDOWS_PLATFORM", 60 ] 61 cflags_cc = [ "-std=c++17" ] 62 63 sources = [ 64 "adapter/common/hm_symbol_txt.cpp", 65 "adapter/common/text_style.cpp", 66 "adapter/common/typography_style.cpp", 67 "adapter/skia_txt/convert.cpp", 68 "adapter/skia_txt/custom_symbol_config.cpp", 69 "adapter/skia_txt/font_collection.cpp", 70 "adapter/skia_txt/line_typography.cpp", 71 "adapter/skia_txt/run_impl.cpp", 72 "adapter/skia_txt/text_line_base.cpp", 73 "adapter/skia_txt/typography.cpp", 74 "adapter/skia_txt/typography_create.cpp", 75 ] 76 77 platform = current_os 78 if (platform == "mingw") { 79 platform = "windows" 80 } 81 82 if (defined(use_rosen_drawing) && use_rosen_drawing) { 83 defines += [ 84 "USE_ROSEN_DRAWING", 85 "USE_SKIA_TXT", 86 ] 87 if (rs_enable_gpu) { 88 defines += [ "RS_ENABLE_GPU" ] 89 } 90 } 91 92 external_deps = [ 93 "hilog:libhilog", 94 "jsoncpp:jsoncpp", 95 "skia:skia_canvaskit", 96 ] 97 98 deps = [ 99 "$graphic_2d_root/rosen/modules/texgine:libtexgine_source", 100 "./skia_txt:skia_libtxt_$platform", 101 ] 102 103 is_cross_platform = 104 current_os == "mac" || current_os == "mingw" || current_os == "linux" || 105 current_os == "android" || current_os == "ios" 106 107 if (!is_cross_platform) { 108 external_deps += [ 109 "hitrace:hitrace_meter", 110 "init:libbegetutil", 111 ] 112 defines += [ "OHOS_TEXT_ENABLE" ] 113 } 114 115 part_name = "graphic_2d" 116 subsystem_name = "graphic" 117} 118