mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 The font Noto Sans SC is not available https://github.com/siyuan-note/siyuan/issues/15238
This commit is contained in:
parent
0936ef7065
commit
c060b093ee
1 changed files with 0 additions and 12 deletions
|
|
@ -52,24 +52,12 @@ func LoadSysFonts() (ret []string) {
|
||||||
ret = append(ret, font.Family)
|
ret = append(ret, font.Family)
|
||||||
}
|
}
|
||||||
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
||||||
ret = removeUnusedFonts(ret)
|
|
||||||
sort.Strings(ret)
|
sort.Strings(ret)
|
||||||
sysFonts = ret
|
sysFonts = ret
|
||||||
logging.LogInfof("loaded system fonts [%d] in [%dms]", len(sysFonts), time.Since(start).Milliseconds())
|
logging.LogInfof("loaded system fonts [%d] in [%dms]", len(sysFonts), time.Since(start).Milliseconds())
|
||||||
return
|
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 {
|
type Font struct {
|
||||||
Path string
|
Path string
|
||||||
Family string
|
Family string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue