From 186dcc391c48e32da401fc139b33415883a3975b Mon Sep 17 00:00:00 2001 From: wangshengwen Date: Tue, 24 Dec 2024 20:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Demoji=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangshengwen --- src/ports/skia_ohos/SkFontMgr_ohos.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ports/skia_ohos/SkFontMgr_ohos.cpp b/src/ports/skia_ohos/SkFontMgr_ohos.cpp index 545835e2..3ef97af6 100644 --- a/src/ports/skia_ohos/SkFontMgr_ohos.cpp +++ b/src/ports/skia_ohos/SkFontMgr_ohos.cpp @@ -232,6 +232,18 @@ SkTypeface* SkFontMgr_OHOS::findTypeface(const FallbackSetPos& fallbackItem, con } tps[ret] = i; } + if (character >= 0x2018 && character <= 0x201D) { + for (int i = 0; i <= bcp47Count - 1; i++) { + if (tps[i] == -1) { + continue; + } + const TypefaceSet& tpSet = *(fallbackSet[tps[i]]->typefaceSet.get()); + if (tpSet.size() > 0 && tpSet[0]->unicharToGlyph(character) != 0) { + sk_sp typeface = FontConfig_OHOS::matchFontStyle(tpSet, style); + return SkSafeRef(typeface.get()); + } + } + } // match typeface in families for (int i = bcp47Count - 1; i >= 0; i--) { if (tps[i] == -1) { -- Gitee