更新CHANGELOG,修复模板样式保持问题,重构样式复制机制,优化代码结构,更新README示例中的方法调用,确保API向下兼容,增加测试用例以验证修复效果。

This commit is contained in:
zero
2025-06-04 09:43:07 +08:00
parent 5ccd71e726
commit b037e832c8
21 changed files with 2003 additions and 1810 deletions

View File

@@ -19,10 +19,10 @@ func main() {
title := doc.AddParagraph("表格布局和尺寸功能演示")
title.SetAlignment(document.AlignCenter)
titleFormat := &document.TextFormat{
Bold: true,
FontSize: 18,
FontColor: "2F5496",
FontName: "微软雅黑",
Bold: true,
FontSize: 18,
FontColor: "2F5496",
FontFamily: "微软雅黑",
}
title.AddFormattedText("", titleFormat)
@@ -45,10 +45,10 @@ func main() {
// 设置表头格式
headerFormat := &document.CellFormat{
TextFormat: &document.TextFormat{
Bold: true,
FontSize: 12,
FontColor: "FFFFFF",
FontName: "微软雅黑",
Bold: true,
FontSize: 12,
FontColor: "FFFFFF",
FontFamily: "微软雅黑",
},
HorizontalAlign: document.CellAlignCenter,
VerticalAlign: document.CellVAlignCenter,
@@ -203,10 +203,10 @@ func main() {
for col := 0; col < 4; col++ {
complexTable.SetCellFormat(0, col, &document.CellFormat{
TextFormat: &document.TextFormat{
Bold: true,
FontSize: 14,
FontColor: "FFFFFF",
FontName: "微软雅黑",
Bold: true,
FontSize: 14,
FontColor: "FFFFFF",
FontFamily: "微软雅黑",
},
HorizontalAlign: document.CellAlignCenter,
VerticalAlign: document.CellVAlignCenter,