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

This commit is contained in:
Daniel 2025-01-04 16:36:25 +08:00
parent fc2411f5bd
commit 4554290d7b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -78,6 +78,9 @@ type Font struct {
func loadFonts() (ret []*Font) {
ret = []*Font{}
for _, fontPath := range findfont.List() {
if strings.Contains(fontPath, "AppData") {
logging.LogInfof("skip font [%s]", fontPath)
}
if strings.HasSuffix(strings.ToLower(fontPath), ".ttc") {
data, err := os.ReadFile(fontPath)
if err != nil {
@ -151,6 +154,8 @@ func loadFonts() (ret []*Font) {
if sfnt.NamePreferredFamily == e.NameID && "" != val {
family = val
}
} else {
logging.LogInfof("skip font family [%s] [%+v]", fontPath, e)
}
}
if "" != family && !strings.HasPrefix(family, ".") {