Text
Text shapes can be added to Slides.
slide.addText([{ text: "TEXT", options: { OPTIONS } }]);
PositionProps
)Name | Type | Default | Description | Possible Values |
---|---|---|---|---|
x | number | 1.0 | hor location (inches) | 0-n |
x | string | hor location (percent) | 'n%'. (Ex: {x:'50%'} middle of the Slide) | |
y | number | 1.0 | ver location (inches) | 0-n |
y | string | ver location (percent) | 'n%'. (Ex: {y:'50%'} middle of the Slide) | |
w | number | 1.0 | width (inches) | 0-n |
w | string | width (percent) | 'n%'. (Ex: {w:'50%'} 50% the Slide width) | |
h | number | 1.0 | height (inches) | 0-n |
h | string | height (percent) | 'n%'. (Ex: {h:'50%'} 50% the Slide height) |
TextPropsOptions
) italic是否斜体Option | Type | Unit | Default | Description | Possible Values |
---|---|---|---|---|---|
align | string | left | alignment | left or center or right | |
autoFit | boolean | false | 适合形状 | true or false | |
baseline | number | points | 文本基线 | 0-256 | |
bold | boolean | false | 文本加粗 | true or false | |
breakLine | boolean | false | 附加一个换行符 | true or false (only applies when used in text options) Ex: {text:'hi', options:{breakLine:true}} | |
bullet | boolean | false | 项目符号文本 | true or false | |
bullet | object | bullet options | object with type , code or style . Ex: bullet:{type:'number'} . Ex: bullet:{code:'2605'} . Ex: {style:'alphaLcPeriod'} | ||
charSpacing | number | points | 字符间距 | 1-256. Ex: { charSpacing:12 } | |
color | string | text color | hex color code or scheme color. Ex: { color:'0088CC' } | ||
fill | string | fill/bkgd color | hex color code or scheme color. Ex: { color:'0088CC' } | ||
fit | string | none | text fit options | none , <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的主题颜色变量