From 20193a94874c9ad6af424c3f9b5836806ab0cff2 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Thu, 15 Apr 2021 14:50:16 +0800 Subject: [PATCH] IssueNo:#I3ISPV Description:support ICU line break Sig:graphic Feature or Bugfix:Feature Binary Source:No --- test/sample_ui.cpp | 12 ++++++++++-- test/sample_window.cpp | 11 +++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/sample_ui.cpp b/test/sample_ui.cpp index 8e722b5..4a818e0 100755 --- a/test/sample_ui.cpp +++ b/test/sample_ui.cpp @@ -51,11 +51,19 @@ static void InitHal() HORIZONTAL_RESOLUTION); } -static uint32_t g_fontPsramBaseAddr[MIN_FONT_PSRAM_LENGTH / 4]; +static uint32_t g_fontMemBaseAddr[MIN_FONT_PSRAM_LENGTH / 4]; +#if ENABLE_ICU +static uint8_t g_icuMemBaseAddr[OHOS::SHAPING_WORD_DICT_LENGTH]; +#endif + static void InitFontEngine() { - GraphicStartUp::InitFontEngine(reinterpret_cast(g_fontPsramBaseAddr), MIN_FONT_PSRAM_LENGTH, + GraphicStartUp::InitFontEngine(reinterpret_cast(g_fontMemBaseAddr), MIN_FONT_PSRAM_LENGTH, VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); +#if ENABLE_ICU + GraphicStartUp::InitLineBreakEngine(reinterpret_cast(g_icuMemBaseAddr), SHAPING_WORD_DICT_LENGTH, + VECTOR_FONT_DIR, DEFAULT_LINE_BREAK_RULE_FILENAME); +#endif } } // namespace OHOS diff --git a/test/sample_window.cpp b/test/sample_window.cpp index 54bdfef..64c271b 100755 --- a/test/sample_window.cpp +++ b/test/sample_window.cpp @@ -258,11 +258,18 @@ static void InitHal() ScreenDeviceProxy::GetInstance()->SetDevice(display); } -static uint32_t g_fontPsramBaseAddr[MIN_FONT_PSRAM_LENGTH / 4]; +static uint32_t g_fontMemBaseAddr[MIN_FONT_PSRAM_LENGTH / 4]; +#if ENABLE_ICU +static uint8_t g_icuMemBaseAddr[OHOS::SHAPING_WORD_DICT_LENGTH]; +#endif static void InitFontEngine() { - GraphicStartUp::InitFontEngine(reinterpret_cast(g_fontPsramBaseAddr), MIN_FONT_PSRAM_LENGTH, + GraphicStartUp::InitFontEngine(reinterpret_cast(g_fontMemBaseAddr), MIN_FONT_PSRAM_LENGTH, VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); +#if ENABLE_ICU + GraphicStartUp::InitLineBreakEngine(reinterpret_cast(g_icuMemBaseAddr), SHAPING_WORD_DICT_LENGTH, + VECTOR_FONT_DIR, DEFAULT_LINE_BREAK_RULE_FILENAME); +#endif } } // namespace OHOS -- Gitee