feat(渲染编辑): 修复保存、文字与渲染问题
build.yaml / build (push) Successful in 40s

This commit is contained in:
xiaoqidun committed 2026-09-23 21:05:47 +08:00
1 parent 580e7043c4
commit d6f70de7be
40 files changed
+2299 -407

No files matched your search

+4 -1
View File
@@ -27,6 +27,9 @@ import (
// 入参: obj 文字对象, value 原文, options 段落排版选项, metrics 字体度量
// 返回: error 错误信息
func LayoutText(obj *TextObject, value string, options TextLayout, metrics FontMetrics) error {
if obj == nil || metrics == nil {
return fmt.Errorf("text object and font metrics are required")
}
if metrics.UnitsPerEm() == 0 {
return fmt.Errorf("font units per em must be positive")
}
@@ -73,7 +76,7 @@ func LayoutText(obj *TextObject, value string, options TextLayout, metrics FontM
if lineHeight == 0 {
lineHeight = math.Max(obj.Size, float64(int(ascender)+int(descender)+int(gap))*unit)
}
if options.Shape {
if options.Shape || options.Shaping != (TextShapeOptions{}) {
return layoutShapedText(obj, value, options, metrics, width, lineHeight, hScale, float64(ascender)*unit)
}
var codes []TextCode