From 2b0f2e702e44a43ab5b0f531f5415083bea31212 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 4 Jan 2025 20:44:02 +0800 Subject: [PATCH] :bug: Settings - Editor - Font is garbled on macOS https://github.com/siyuan-note/siyuan/issues/13713 --- kernel/util/font.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/kernel/util/font.go b/kernel/util/font.go index 97ad30b7f..0b1824ee4 100644 --- a/kernel/util/font.go +++ b/kernel/util/font.go @@ -125,20 +125,7 @@ func loadFonts() (ret []*Font) { continue } - if sfnt.PlatformLanguageID(1033) == e.LanguageID { - v, _, err := transform.Bytes(textUnicode.UTF16(textUnicode.BigEndian, textUnicode.IgnoreBOM).NewDecoder(), e.Value) - if err != nil { - //LogErrorf("decode font family [%s] failed: %s", fontPath, err) - continue - } - val := string(v) - if sfnt.NameFontFamily == e.NameID && "" != val { - family = val - } - if sfnt.NamePreferredFamily == e.NameID && "" != val { - family = val - } - } else if sfnt.PlatformLanguageID(2052) == e.LanguageID { + if sfnt.PlatformLanguageID(1033) == e.LanguageID || sfnt.PlatformLanguageID(2052) == e.LanguageID { v, _, err := transform.Bytes(textUnicode.UTF16(textUnicode.BigEndian, textUnicode.IgnoreBOM).NewDecoder(), e.Value) if err != nil { //LogErrorf("decode font family [%s] failed: %s", fontPath, err)