Ai
1 Star 0 Fork 1

窦雪峰/unioffice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
textbox.go 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
Todd 提交于 2017-11-21 09:11 +08:00 . presentation: support vertical text anchoring
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package presentation
import (
"baliance.com/gooxml/drawing"
"baliance.com/gooxml/schema/soo/dml"
"baliance.com/gooxml/schema/soo/pml"
)
// TextBox is a text box within a slide.
type TextBox struct {
x *pml.CT_Shape
}
// AddParagraph adds a paragraph to the text box
func (t TextBox) AddParagraph() drawing.Paragraph {
p := dml.NewCT_TextParagraph()
t.x.TxBody.P = append(t.x.TxBody.P, p)
return drawing.MakeParagraph(p)
}
// Properties returns the properties of the TextBox.
func (t TextBox) Properties() drawing.ShapeProperties {
if t.x.SpPr == nil {
t.x.SpPr = dml.NewCT_ShapeProperties()
}
return drawing.MakeShapeProperties(t.x.SpPr)
}
// SetTextAnchor controls the text anchoring
func (t TextBox) SetTextAnchor(a dml.ST_TextAnchoringType) {
t.x.TxBody.BodyPr = dml.NewCT_TextBodyProperties()
t.x.TxBody.BodyPr.AnchorAttr = a
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/douxuefeng/unioffice.git
git@gitee.com:douxuefeng/unioffice.git
douxuefeng
unioffice
unioffice
v0.7.1

搜索帮助