mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🐛 Settings - Editor - Font is garbled on macOS https://github.com/siyuan-note/siyuan/issues/13713
This commit is contained in:
parent
de7794804d
commit
fc2411f5bd
1 changed files with 26 additions and 11 deletions
|
|
@ -125,17 +125,32 @@ func loadFonts() (ret []*Font) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
v, _, err := transform.Bytes(textUnicode.UTF16(textUnicode.BigEndian, textUnicode.IgnoreBOM).NewDecoder(), e.Value)
|
if sfnt.PlatformLanguageID(1033) == e.LanguageID {
|
||||||
if err != nil {
|
v, _, err := transform.Bytes(textUnicode.UTF16(textUnicode.BigEndian, textUnicode.IgnoreBOM).NewDecoder(), e.Value)
|
||||||
//LogErrorf("decode font family [%s] failed: %s", fontPath, err)
|
if err != nil {
|
||||||
continue
|
//LogErrorf("decode font family [%s] failed: %s", fontPath, err)
|
||||||
}
|
continue
|
||||||
val := string(v)
|
}
|
||||||
if sfnt.NameFontFamily == e.NameID && "" != val {
|
val := string(v)
|
||||||
family = val
|
if sfnt.NameFontFamily == e.NameID && "" != val {
|
||||||
}
|
family = val
|
||||||
if sfnt.NamePreferredFamily == e.NameID && "" != val {
|
}
|
||||||
family = val
|
if sfnt.NamePreferredFamily == e.NameID && "" != val {
|
||||||
|
family = val
|
||||||
|
}
|
||||||
|
} else if 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)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
val := string(v)
|
||||||
|
if sfnt.NameFontFamily == e.NameID && "" != val {
|
||||||
|
family = val
|
||||||
|
}
|
||||||
|
if sfnt.NamePreferredFamily == e.NameID && "" != val {
|
||||||
|
family = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if "" != family && !strings.HasPrefix(family, ".") {
|
if "" != family && !strings.HasPrefix(family, ".") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue