go-fonts/stix
GitHub: go-fonts/stix
将 STIX 科学与数学字体封装为可直接 import 的 Go 包,方便在 Go 应用中嵌入并解析使用。
Stars: 3 | Forks: 0
# stix
[](https://github.com/go-fonts/stix/releases)
[](https://godoc.org/github.com/go-fonts/stix)
[](https://github.com/go-fonts/stix/raw/main/LICENSE)
`stix` 将 [STIX](https://www.stixfonts.org/) 字体提供为可导入的 Go 包。
这些字体基于 [SIL Open Font](https://github.com/go-fonts/stix/raw/main/SIL-LICENSE) 许可证发布。
Go 包基于 [BSD-3](https://github.com/go-fonts/stix/raw/main/LICENSE) 许可证。
## 示例
```
import (
"fmt"
"log"
"github.com/go-fonts/stix/stix2mathregular"
"golang.org/x/image/font/sfnt"
)
func Example() {
ttf, err := sfnt.Parse(stix2mathregular.TTF)
if err != nil {
log.Fatalf("could not parse STIX2 Math font: %+v", err)
}
var buf sfnt.Buffer
v, err := ttf.Name(&buf, sfnt.NameIDVersion)
if err != nil {
log.Fatalf("could not retrieve font version: %+v", err)
}
fmt.Printf("version: %s\n", v)
fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())
// Output:
// version: Version 2.13 b171
// num glyphs: 6760
}
```
标签:EVTX分析, 日志审计