style(代码风格): 整理声明顺序与字体模块
build.yaml / build (push) Successful in 51s

This commit is contained in:
xiaoqidun committed 2026-09-28 15:17:45 +08:00
1 parent 5e0da3da28
commit ee6c9f6a16
82 files changed
+4316 -4310

No files matched your search

+7 -7
View File
@@ -21,6 +21,13 @@ import (
"github.com/tdewolff/font"
)
// canvasFontMetrics 保留默认字体度量,写出时不更新原始时间
type canvasFontMetrics struct {
*font.SFNT
*fontShaper
outlines *sfntOutliner
}
// ResolveFont 按需加载字体资源,保留内嵌数据及外部字体的名称、样式和集合索引匹配
// 入参: r 渲染器, id 字体标识, exact 是否禁止无关回退
// 返回: ResolvedFont 字体与来源, error 字体不可用错误
@@ -41,13 +48,6 @@ func (CanvasBackend) OpenFont(data []byte) (FontMetrics, error) {
return metrics, nil
}
// canvasFontMetrics 保留默认字体度量,写出时不更新原始时间
type canvasFontMetrics struct {
*font.SFNT
*fontShaper
outlines *sfntOutliner
}
// Write 返回字体数据,不修改字体元信息
// 返回: []byte 独立SFNT数据
func (f canvasFontMetrics) Write() []byte {