登录 - 注册 您好!欢迎来到聊城市宜购网络科技有限公司!
18963548078
技术文档
text参数
发表日期:2022-11-29

Text

Text shapes can be added to Slides.

Usage

slide.addText([{ text: "TEXT", options: { OPTIONS } }]);

Properties

Position/Size Props (PositionProps)

NameTypeDefaultDescriptionPossible Values
xnumber1.0hor location (inches)0-n
xstring
hor location (percent)'n%'. (Ex: {x:'50%'} middle of the Slide)
ynumber1.0ver location (inches)0-n
ystring
ver location (percent)'n%'. (Ex: {y:'50%'} middle of the Slide)
wnumber1.0width (inches)0-n
wstring
width (percent)'n%'. (Ex: {w:'50%'} 50% the Slide width)
hnumber1.0height (inches)0-n
hstring
height (percent)'n%'. (Ex: {h:'50%'} 50% the Slide height)

Base Properties (TextPropsOptions)  italic是否斜体

OptionTypeUnitDefaultDescriptionPossible Values
alignstring
leftalignmentleft or center or right
autoFitboolean
false适合形状true or false
baselinenumberpoints
文本基线0-256
boldboolean
false文本加粗true or false
breakLineboolean
false附加一个换行符true or false (only applies when used in text options) Ex: {text:'hi', options:{breakLine:true}}
bulletboolean
false项目符号文本true or false
bulletobject

bullet optionsobject with typecode or style. Ex: bullet:{type:'number'}. Ex: bullet:{code:'2605'}. Ex: {style:'alphaLcPeriod'}
charSpacingnumberpoints
字符间距1-256. Ex: { charSpacing:12 }
colorstring

text colorhex color code or scheme color. Ex: { color:'0088CC' }
fillstring

fill/bkgd colorhex color code or scheme color. Ex: { color:'0088CC' }
fitstring
nonetext fit optionsnone, <code style="box-sizing: border-box; vertical-align: middle; background-color: var(--ifm-code-background); border: 0.1rem solid rgba(0, 0, 0, 0.1); border-radius: var(--ifm-code-border-radius); font-family: var(--bs-font-monospace); font-size: 0.875em; padding: var(--ifm-code-padding-vertical) var(--ifm-c


上一篇: text示例 下一篇: pptxgenjs的主题颜色变量