🐛 The font Noto Sans SC is not available https://github.com/siyuan-note/siyuan/issues/15238

This commit is contained in:
Daniel 2025-07-10 16:37:32 +08:00
parent 0936ef7065
commit c060b093ee
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -52,24 +52,12 @@ func LoadSysFonts() (ret []string) {
ret = append(ret, font.Family)
}
ret = gulu.Str.RemoveDuplicatedElem(ret)
ret = removeUnusedFonts(ret)
sort.Strings(ret)
sysFonts = ret
logging.LogInfof("loaded system fonts [%d] in [%dms]", len(sysFonts), time.Since(start).Milliseconds())
return
}
func removeUnusedFonts(fonts []string) (ret []string) {
ret = []string{}
for _, font := range fonts {
if strings.HasPrefix(font, "Noto Sans") {
continue
}
ret = append(ret, font)
}
return
}
type Font struct {
Path string
Family string