diff --git a/build/BUILD.gn b/build/BUILD.gn index ac5858ff59241580bbff19f5665af7e3e6eefba4..47784bebc95a7be6000c35c1e5ea8794addcded8 100644 --- a/build/BUILD.gn +++ b/build/BUILD.gn @@ -179,6 +179,16 @@ template("flutter_engine_fml") { "CoreFoundation.framework", "Foundation.framework", ] + } else if (platform == "linux") { + sources += [ + "$flutter_root/engine/flutter/fml/platform/linux/message_loop_linux.cc", + "$flutter_root/engine/flutter/fml/platform/linux/paths_linux.cc", + "$flutter_root/engine/flutter/fml/platform/linux/timerfd.cc", + "$flutter_root/engine/flutter/fml/platform/posix/file_posix.cc", + "$flutter_root/engine/flutter/fml/platform/posix/mapping_posix.cc", + "$flutter_root/engine/flutter/fml/platform/posix/native_library_posix.cc", + "$flutter_root/engine/flutter/fml/platform/posix/paths_posix.cc", + ] } else { sources += [ "$flutter_root/engine/flutter/fml/platform/linux/timerfd.cc", @@ -651,7 +661,8 @@ template("flutter_engine_lib_ui") { "$flutter_root/engine/flutter/lib/ui/window/window.cc", ] - if (platform == "mac" || platform == "windows" || platform == "ios") { + if (platform == "mac" || platform == "windows" || platform == "ios" || + platform == "linux") { sources += [ "$flutter_root/engine/flutter/lib/ui/window/pointer_data.cc" ] } diff --git a/build/glfw/BUILD.gn b/build/glfw/BUILD.gn index 96914541f644cd9b733a78ebc081de7caef15465..03869dd4d230ab6d6aa0703fe52cec71a2cd4f80 100644 --- a/build/glfw/BUILD.gn +++ b/build/glfw/BUILD.gn @@ -142,7 +142,7 @@ template("flutter_platform_glfw") { ] # wait for glfw enabled in standard system - if (!is_standard_system || use_mingw_win || use_mac) { + if (!is_standard_system || use_mingw_win || use_mac || use_linux) { deps += [ "$flutter_root/glfw:glfw_$platform" ] } } @@ -150,7 +150,7 @@ template("flutter_platform_glfw") { foreach(item, ace_platforms) { platform = item.name - if (platform == "windows" || platform == "mac") { + if (platform == "windows" || platform == "mac" || platform == "linux") { flutter_platform_glfw("flutter_glfw_preview_" + item.name) { platform = item.name defines = [] diff --git a/build/icu/BUILD.gn b/build/icu/BUILD.gn index 8d81f608d82715b853c74f8fef4f2046f06d4b53..1e182cd9b8f407cc4cece79c8d3e68525a31431e 100644 --- a/build/icu/BUILD.gn +++ b/build/icu/BUILD.gn @@ -82,7 +82,7 @@ template("ace_icu_make_data_assembly") { action(target_name) { script = "$flutter_root/skia/third_party/externals/icu/scripts/make_data_assembly.py" - if (platform == "windows" || platform == "mac") { + if (platform == "windows" || platform == "mac" || platform == "linux") { inputs = [ "$flutter_root/skia/third_party/externals/icu/common/icudtl.dat" ] } else if (platform == "android") { diff --git a/build/libjpeg/BUILD.gn b/build/libjpeg/BUILD.gn index 6471cf0de990bdd513ad412535551c2bda1254e7..f2bbedb64addba1ead6769697a11af8d4fa26dad 100644 --- a/build/libjpeg/BUILD.gn +++ b/build/libjpeg/BUILD.gn @@ -88,7 +88,7 @@ ohos_source_set("ace_libjpeg") { "$flutter_root/skia/third_party/externals/libjpeg-turbo/jutils.c", ] - if (use_mingw_win || use_mac) { + if (use_mingw_win || use_mac || use_linux) { sources += [ "$flutter_root/skia/third_party/externals/libjpeg-turbo/jsimd_none.c", ] diff --git a/build/libtxt/BUILD.gn b/build/libtxt/BUILD.gn index b893af869bfe37f6f922fa1d6b8b29c0969eb984..66369e964e4b63bd705ef89a7313424e6929d75e 100644 --- a/build/libtxt/BUILD.gn +++ b/build/libtxt/BUILD.gn @@ -114,6 +114,14 @@ template("thirdparty_lib_txt") { } } else if (platform == "android") { sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_android.cc" ] + } else if (platform == "linux") { + sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_linux.cc" ] + if (is_standard_system) { + defines += [ "OHOS_STANDARD_SYSTEM" ] + } + if (use_linux) { + defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ] + } } } } diff --git a/build/libwebp/BUILD.gn b/build/libwebp/BUILD.gn index c7c0117238c12855e712d59c2ddabbef0ee7e91b..6880949e991b793f34ae6b9ef26287008af84c6d 100644 --- a/build/libwebp/BUILD.gn +++ b/build/libwebp/BUILD.gn @@ -40,7 +40,7 @@ ohos_source_set("ace_libwebp") { configs = [ ":ace_libwebp_config" ] configs += [ "$ace_root/build:reduce_eh_frame_config" ] - if ((target_cpu == "x86_64" && !use_mingw_win) || use_mac) { + if ((target_cpu == "x86_64" && !use_mingw_win) || use_mac || use_linux) { deps = [ ":ace_libwebp_sse41" ] } diff --git a/build/skia/BUILD.gn b/build/skia/BUILD.gn index fd44e00fc7a877c602a107dbaec5948196aa00b2..264210fb07059dca312f209d79a4a2310b48cf64 100644 --- a/build/skia/BUILD.gn +++ b/build/skia/BUILD.gn @@ -354,7 +354,7 @@ template("ace_skia_opts") { sources = [] if (target_cpu == "x86_64" || platform == "windows" || platform == "mac" || - platform == "ios") { + platform == "linux" || platform == "ios") { cflags -= [ "-march=armv8-a+crc" ] sources += [ "$flutter_root/skia/src/opts/SkOpts_avx.cpp", @@ -369,6 +369,12 @@ template("ace_skia_opts") { "$flutter_root/skia/src/opts/SkOpts_sse42.cpp", "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp", ] + } else if (platform == "linux") { + sources += [ + "$flutter_root/skia/src/opts/SkOpts_sse41.cpp", + "$flutter_root/skia/src/opts/SkOpts_sse42.cpp", + "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp", + ] } else if (platform == "mac") { cflags += [ "-mavx", @@ -885,6 +891,9 @@ template("ace_skia_core") { # UIKit symbols UIFontWeightXXX may be dlsym'ed. "UIKit.framework", ] + } else if (platform == "linux") { + sources += [ "$flutter_root/skia/src/ports/SkDebug_stdio.cpp" ] + libs = [ "GL" ] } else { # Ohos and Android plarform if (target_cpu != "arm") { @@ -1514,6 +1523,14 @@ template("ace_gpu") { sources += [ "$flutter_root/skia/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp", ] + } else if (platform == "linux") { + defines += [ "SK_R32_SHIFT=16" ] + sources -= [ + "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp", + ] + sources += [ + "$flutter_root/skia/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp", + ] } else if (platform == "ios") { defines += [ "SK_BUILD_FOR_IOS", @@ -1738,6 +1755,24 @@ template("ace_fontmgr") { "$flutter_root/skia/src/ports/SkFontMgr_preview.cpp", ] } + } else if (platform == "linux") { + if (defined(config.ohos_standard_fontmgr) && + config.ohos_standard_fontmgr) { + sources = [ + "$flutter_root/skia/src/ports/SkFontMgr_custom.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_custom_directory.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_custom_directory_factory.cpp", + ] + deps = [ ":ace_fontmgr_standard" ] + } else { + sources = [ + "$flutter_root/skia/src/ports/SkFontMgr_config_parser.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_custom.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_custom_directory.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_custom_directory_factory.cpp", + "$flutter_root/skia/src/ports/SkFontMgr_preview.cpp", + ] + } } else { # Ohos or Android platform if (defined(config.ohos_standard_fontmgr) && @@ -1833,6 +1868,9 @@ ohos_source_set("ace_fontmgr_standard") { } else if (use_mac) { defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ] defines -= [ "SK_BUILD_FONT_MGR_FOR_OHOS" ] + } else if (use_linux) { + defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ] + defines -= [ "SK_BUILD_FONT_MGR_FOR_OHOS" ] } } diff --git a/engine/flutter/fml/logging.cc b/engine/flutter/fml/logging.cc index 5cd38e1e86b40dadeb042c54a646039ffe7ad557..891faa68b259935fee0bbd7bb69a0c20fd890ae0 100644 --- a/engine/flutter/fml/logging.cc +++ b/engine/flutter/fml/logging.cc @@ -4,6 +4,7 @@ #include #include +#include #include "flutter/fml/build_config.h" #include "flutter/fml/log_settings.h" diff --git a/engine/flutter/fml/message_loop_task_queues.h b/engine/flutter/fml/message_loop_task_queues.h index a2259438565b418399bfc32d39cae07d73dd8f4c..c3e7caff4ebe08353fcab51e6c273de9c84e53fd 100644 --- a/engine/flutter/fml/message_loop_task_queues.h +++ b/engine/flutter/fml/message_loop_task_queues.h @@ -5,7 +5,9 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_TASK_QUEUES_H_ #define FLUTTER_FML_MESSAGE_LOOP_TASK_QUEUES_H_ +#include #include +#include #include #include diff --git a/engine/flutter/fml/platform/posix/file_posix.cc b/engine/flutter/fml/platform/posix/file_posix.cc index d30a9c2f1d2df8008b9ae9655dfa011033857700..520db7fc457b779f0c9a1e225c5d714bf46c43d1 100644 --- a/engine/flutter/fml/platform/posix/file_posix.cc +++ b/engine/flutter/fml/platform/posix/file_posix.cc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/engine/flutter/shell/common/vsync_waiter_fallback.cc b/engine/flutter/shell/common/vsync_waiter_fallback.cc index c5c05c29d1b46045fb84dd9aa378b66854288647..15f3fe3948abfb20623c0fd51c8840f58307cfc3 100644 --- a/engine/flutter/shell/common/vsync_waiter_fallback.cc +++ b/engine/flutter/shell/common/vsync_waiter_fallback.cc @@ -30,7 +30,7 @@ VsyncWaiterFallback::~VsyncWaiterFallback() = default; // |VsyncWaiter| void VsyncWaiterFallback::AwaitVSync() { // ACE PC preview -#if defined(WINDOWS_PLATFORM) || defined(MAC_PLATFORM) +#if defined(WINDOWS_PLATFORM) || defined(MAC_PLATFORM) || defined(LINUX_PLATFORM) constexpr fml::TimeDelta kSingleFrameInterval = fml::TimeDelta::FromSecondsF(1.0 / 30.0); #else diff --git a/engine/flutter/shell/gpu/gpu_surface_gl.cc b/engine/flutter/shell/gpu/gpu_surface_gl.cc index 2c329c8db842daf59b75f7163b7bbe74c80b0d4a..815170da6072bd52f955c49c6b67061783ce8e0d 100644 --- a/engine/flutter/shell/gpu/gpu_surface_gl.cc +++ b/engine/flutter/shell/gpu/gpu_surface_gl.cc @@ -292,7 +292,7 @@ bool GPUSurfaceGL::PresentSurface(SkCanvas* canvas) { onscreen_surface_->getCanvas()->flush(); // ACE PC preview -#if defined(WINDOWS_PLATFORM) or defined(MAC_PLATFORM) +#if defined(WINDOWS_PLATFORM) or defined(MAC_PLATFORM) or defined(LINUX_PLATFORM) int32_t width = onscreen_surface_->width(); int32_t height = onscreen_surface_->height(); SkImageInfo info = SkImageInfo::Make(width, height, kRGBA_8888_SkColorType, kOpaque_SkAlphaType); diff --git a/engine/flutter/shell/platform/embedder/embedder.h b/engine/flutter/shell/platform/embedder/embedder.h index cde957bb8db74f8ffede73bd5b02d07cfb6cc074..4af3f57a1b4709a14756ec56fb53563ca5375091 100644 --- a/engine/flutter/shell/platform/embedder/embedder.h +++ b/engine/flutter/shell/platform/embedder/embedder.h @@ -8,7 +8,7 @@ #include #include #include - +#include #if defined(__cplusplus) #include extern "C" { diff --git a/engine/flutter/shell/platform/glfw/glfw_event_loop.h b/engine/flutter/shell/platform/glfw/glfw_event_loop.h index 4c9185a60fc3dc744ae8d25f573c4235234466dd..7e6f320fed44312b97be15a4fb282df9967e4853 100644 --- a/engine/flutter/shell/platform/glfw/glfw_event_loop.h +++ b/engine/flutter/shell/platform/glfw/glfw_event_loop.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "flutter/shell/platform/embedder/embedder.h" diff --git a/engine/flutter/shell/platform/glfw/public/flutter_glfw.h b/engine/flutter/shell/platform/glfw/public/flutter_glfw.h index a65ec5a5e5f8fd025f32319a42e978dea56f0df7..0e45779e3e0690908ae5781942f6a8daf4ae7e18 100644 --- a/engine/flutter/shell/platform/glfw/public/flutter_glfw.h +++ b/engine/flutter/shell/platform/glfw/public/flutter_glfw.h @@ -7,6 +7,7 @@ #include #include +#include #include "flutter_export.h" diff --git a/engine/flutter/third_party/txt/src/minikin/Hyphenator.cpp b/engine/flutter/third_party/txt/src/minikin/Hyphenator.cpp index 321a0ec5c0d91bef0de58edf2334860a8fe6402b..6e6f9757a603e2a0b2ae6f0dd1eb6f43455a3376 100644 --- a/engine/flutter/third_party/txt/src/minikin/Hyphenator.cpp +++ b/engine/flutter/third_party/txt/src/minikin/Hyphenator.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include // HACK: for reading pattern file diff --git a/engine/flutter/third_party/txt/src/minikin/LineBreaker.cpp b/engine/flutter/third_party/txt/src/minikin/LineBreaker.cpp index de4999292ad6cf03a2aa40c090ee51dba81eeb2a..c654e030842c2144ed3f6ab6b02250e3ead2b795 100644 --- a/engine/flutter/third_party/txt/src/minikin/LineBreaker.cpp +++ b/engine/flutter/third_party/txt/src/minikin/LineBreaker.cpp @@ -20,6 +20,7 @@ #include #include +#include #include diff --git a/engine/flutter/third_party/txt/src/txt/font_collection.h b/engine/flutter/third_party/txt/src/txt/font_collection.h index 78e7b7cd60af001a3b24553aeba107490a90540c..4d533cb1e53bf1df06cc13b3ea31d6e1a5f44daa 100644 --- a/engine/flutter/third_party/txt/src/txt/font_collection.h +++ b/engine/flutter/third_party/txt/src/txt/font_collection.h @@ -18,6 +18,7 @@ #define LIB_TXT_SRC_FONT_COLLECTION_H_ #include +#include #include #include #include diff --git a/engine/flutter/third_party/txt/src/txt/platform_linux.cc b/engine/flutter/third_party/txt/src/txt/platform_linux.cc index 36df613eecb905509114e748259d47d707853d6a..b1baa3c8294999a82b1ae0559139a504e2b516c9 100644 --- a/engine/flutter/third_party/txt/src/txt/platform_linux.cc +++ b/engine/flutter/third_party/txt/src/txt/platform_linux.cc @@ -4,6 +4,11 @@ #include "txt/platform.h" +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) +#include "include/core/SkFontMgr.h" +bool SkFontMgr::physicalDeviceFonts = false; +#endif + #ifdef FLUTTER_USE_FONTCONFIG #include "third_party/skia/include/ports/SkFontMgr_fontconfig.h" #else @@ -12,12 +17,24 @@ namespace txt { +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) +std::string GetDefaultFontFamily() { +#ifdef OHOS_STANDARD_SYSTEM + return "HarmonyOS-Sans"; +#else + return "Arial"; +#endif +} +#else std::string GetDefaultFontFamily() { return "Arial"; } +#endif sk_sp GetDefaultFontManager() { -#ifdef FLUTTER_USE_FONTCONFIG +#ifdef SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX + return SkFontMgr::RefDefault(); +#elif FLUTTER_USE_FONTCONFIG return SkFontMgr_New_FontConfig(nullptr); #else return SkFontMgr_New_Custom_Directory("/usr/share/fonts/"); diff --git a/glfw/BUILD.gn b/glfw/BUILD.gn index a9873566a81b364474a104fb7ea5985ab9eab778..44312a1edf66b394bc716386f349dd2215eb211e 100644 --- a/glfw/BUILD.gn +++ b/glfw/BUILD.gn @@ -81,6 +81,39 @@ template("glfw") { public_configs += [ ":glfw_config_mac" ] defines += [ "_GLFW_COCOA" ] } + if (platform == "linux") { + sources += [ + "src/egl_context.c", + "src/egl_context.h", + "src/glx_context.c", + "src/glx_context.h", + "src/linux_joystick.c", + "src/linux_joystick.h", + "src/posix_time.c", + "src/posix_time.h", + "src/posix_tls.c", + "src/posix_tls.h", + "src/x11_init.c", + "src/x11_monitor.c", + "src/x11_platform.h", + "src/x11_window.c", + "src/xkb_unicode.c", + "src/xkb_unicode.h", + ] + cflags_c = [ + "-Wno-sign-compare", + "-Wno-missing-field-initializers", + ] + libs = [ + "rt", + "dl", + "X11", + "Xcursor", + "Xinerama", + "Xrandr", + ] + defines += [ "_GLFW_X11" ] + } } } @@ -93,3 +126,8 @@ glfw("glfw_mac") { defines = ace_mac_defines platform = "mac" } + +glfw("glfw_linux") { + defines = ace_linux_defines + platform = "linux" +} diff --git a/glfw/glfw_ace_config.gni b/glfw/glfw_ace_config.gni index 5668821ec3ea271b1978deb7e0551b1c8ed9aa45..0f6fa860aacd806cc8438d786f8cc1dbce40c790 100644 --- a/glfw/glfw_ace_config.gni +++ b/glfw/glfw_ace_config.gni @@ -2,3 +2,4 @@ # Defines ace_windows_defines = [ "WINDOWS_PLATFORM" ] ace_mac_defines = [ "MAC_PLATFORM" ] +ace_linux_defines = [ "LINUX_PLATFORM" ] diff --git a/skia/include/core/SkFontMgr.h b/skia/include/core/SkFontMgr.h index e9880d41305a885606fea6a6f369500f317dae23..fff3d8725c96b52da706c225fd87b54aa371f83f 100644 --- a/skia/include/core/SkFontMgr.h +++ b/skia/include/core/SkFontMgr.h @@ -41,7 +41,7 @@ public: void getFamilyName(int index, SkString* familyName) const; SkFontStyleSet* createStyleSet(int index) const; -#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) /** * Whether to use the physical device font for previewer flag. * If true, use physical device font collecton. @@ -134,7 +134,7 @@ public: /** Return the default fontmgr. */ static sk_sp RefDefault(); -#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) /** Set the whether to use physical device font in previwer */ static void setPhysicalDeviceFonts(bool& physicalDeviceFontsEnabled) { diff --git a/skia/src/ports/SkFontMgr_config_parser.cpp b/skia/src/ports/SkFontMgr_config_parser.cpp index 2a49fb370b085a6f5ec8fe9c4665292893fb8183..08a2323915752820ffc9f5a1d7db8b354b1908ea 100644 --- a/skia/src/ports/SkFontMgr_config_parser.cpp +++ b/skia/src/ports/SkFontMgr_config_parser.cpp @@ -26,7 +26,7 @@ std::string g_lmpSystemFontsFile = "INVALID_FILE_PATH"; } #if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) std::string SkFontMgr_Config_Parser::basePath = "..\\..\\resources\\fonts\\"; -#elif defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) +#elif defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) || defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) std::string SkFontMgr_Config_Parser::basePath = "../../resources/fonts/"; #endif diff --git a/skia/src/ports/SkFontMgr_config_parser.h b/skia/src/ports/SkFontMgr_config_parser.h index d9cb9894f2d017296f7e7fbb4a8951f75f64417b..1c7066578e1ee12b3c2b4131e9821ca9acb32811 100644 --- a/skia/src/ports/SkFontMgr_config_parser.h +++ b/skia/src/ports/SkFontMgr_config_parser.h @@ -11,6 +11,7 @@ #define SkFontMgr_config_parser_DEFINED #include +#include #include "include/core/SkFontMgr.h" #include "include/core/SkString.h" diff --git a/skia/src/ports/SkFontMgr_custom_directory_factory.cpp b/skia/src/ports/SkFontMgr_custom_directory_factory.cpp index 3bb52eb3393ec4210eba22c9739818c05b950cad..2a6925b3e3811c58b1a9e3787cf31543ac79e26e 100644 --- a/skia/src/ports/SkFontMgr_custom_directory_factory.cpp +++ b/skia/src/ports/SkFontMgr_custom_directory_factory.cpp @@ -12,6 +12,14 @@ # define SK_FONT_FILE_PREFIX "/usr/share/fonts/" #endif +#ifdef SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX +SK_API sk_sp SkFontMgr_New_OHOS(const char* path); +#endif + sk_sp SkFontMgr::Factory() { +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) + return SkFontMgr_New_OHOS(nullptr); +#else return SkFontMgr_New_Custom_Directory(SK_FONT_FILE_PREFIX); +#endif } diff --git a/skia/src/ports/skia_ohos/FontConfig_ohos.cpp b/skia/src/ports/skia_ohos/FontConfig_ohos.cpp index 9356893b06fbf822f227eeeffd6ce497b74da89e..6d37689e20a85870dc6720b0f184691a2f333fc3 100644 --- a/skia/src/ports/skia_ohos/FontConfig_ohos.cpp +++ b/skia/src/ports/skia_ohos/FontConfig_ohos.cpp @@ -16,7 +16,7 @@ #include "SkString.h" using namespace ErrorCode; -#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) +#if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX) static const char* OHOS_DEFAULT_CONFIG = "fontconfig.json"; #else static const char* OHOS_DEFAULT_CONFIG = "/system/etc/fontconfig.json";