🐛 Settings - Editor - Font is garbled on macOS https://github.com/siyuan-note/siyuan/issues/13713

This commit is contained in:
Daniel 2025-01-04 20:44:02 +08:00
parent fbb7bdad82
commit 2b0f2e702e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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)