Appearance
@shbernal/pptxgenjs / index / TextPropsOptions
Interface: TextPropsOptions
Defined in: core-interfaces.ts:1820
Reusable optional data/path fields. Use DataOrPathRequiredProps for APIs that require at least one source.
Extends
Extended by
Properties
_bodyProp?
optional_bodyProp?:object
Defined in: core-interfaces.ts:1821
align?
optionalalign?:AlignH
anchor?
optionalanchor?:TextAnchor
bIns?
optionalbIns?:number
lIns?
optionallIns?:number
numCol?
optionalnumCol?:number
prstTxWarp?
optionalprstTxWarp?:string
rIns?
optionalrIns?:number
spcCol?
optionalspcCol?:number
tIns?
optionaltIns?:number
vert?
optionalvert?:TextVertType
wrap?
optionalwrap?:boolean
_lineIdx?
optional_lineIdx?:number
Defined in: core-interfaces.ts:1835
align?
optionalalign?:HAlign
Defined in: core-interfaces.ts:542
Horizontal alignment
Default
ts
'left'Inherited from
altText?
optionalaltText?:string
Defined in: core-interfaces.ts:800
Alt Text value ("How would you describe this object and its contents to someone who is blind?")
- serialized to the generated object's
p:cNvPrdescrattribute - PowerPoint: [right-click on the object] > "Edit Alt Text..."
Example
ts
'Quarterly revenue bar chart'Inherited from
baseline?
optionalbaseline?:number
Defined in: core-interfaces.ts:1837
bold?
optionalbold?:boolean
Defined in: core-interfaces.ts:547
Bold style
Default
ts
falseInherited from
breakLine?
optionalbreakLine?:boolean
Defined in: core-interfaces.ts:552
Add a line-break
Default
ts
falseInherited from
bullet?
optionalbullet?:boolean| {characterCode?:string;color?:string;fontFace?:string;image?: {data?:string;path?:string; };indent?:number;numberStartAt?:number;numberType?:"alphaLcParenBoth"|"alphaLcParenR"|"alphaLcPeriod"|"alphaUcParenBoth"|"alphaUcParenR"|"alphaUcPeriod"|"arabicParenBoth"|"arabicParenR"|"arabicPeriod"|"arabicPlain"|"romanLcParenBoth"|"romanLcParenR"|"romanLcPeriod"|"romanUcParenBoth"|"romanUcParenR"|"romanUcPeriod";size?:number;type?:"number"|"bullet"; }
Defined in: core-interfaces.ts:567
Add standard or custom bullet
- use
truefor standard bullet - pass object options for custom bullet
Union Members
boolean
Type Literal
{ characterCode?: string; color?: string; fontFace?: string; image?: { data?: string; path?: string; }; indent?: number; numberStartAt?: number; numberType?: "alphaLcParenBoth" | "alphaLcParenR" | "alphaLcPeriod" | "alphaUcParenBoth" | "alphaUcParenR" | "alphaUcPeriod" | "arabicParenBoth" | "arabicParenR" | "arabicPeriod" | "arabicPlain" | "romanLcParenBoth" | "romanLcParenR" | "romanLcPeriod" | "romanUcParenBoth" | "romanUcParenR" | "romanUcPeriod"; size?: number; type?: "number" | "bullet"; }
characterCode?
optionalcharacterCode?:string
Bullet character code (unicode)
Example
ts
'25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA)color?
optionalcolor?:string
Bullet glyph color (separate from the text run color)
Example
ts
'FF0000' // red bulletfontFace?
optionalfontFace?:string
Bullet glyph font typeface (<a:buFont/>), e.g. for symbol-font bullets
Example
ts
'Wingdings' // render `characterCode` using the Wingdings fontimage?
optionalimage?:object
Image to use as the bullet glyph ("picture bullet", <a:buBlip>)
- supply an image
path(filesystem/URL) or base64data(same forms asaddImage()) - raster formats (PNG/JPG/GIF) and SVG are supported; use
sizeto scale relative to the text height - SVG bullets embed a PNG preview plus the SVG (the same dual-rel handling as
addImage()) - takes precedence over
type/characterCodewhen set
Examples
ts
image: { path: 'images/star.png' }ts
image: { data: 'image/png;base64,iVBOR...' }ts
image: { path: 'images/star.svg' }image.data?
optionaldata?:string
image.path?
optionalpath?:string
indent?
optionalindent?:number
Indentation (space between bullet and text) (points)
Default
ts
27 // DEF_BULLET_MARGINExample
ts
10 // Indents text 10 points from bulletnumberStartAt?
optionalnumberStartAt?:number
Number bullets start at
Default
ts
1Example
ts
10 // numbered bullets start with 10numberType?
optionalnumberType?:"alphaLcParenBoth"|"alphaLcParenR"|"alphaLcPeriod"|"alphaUcParenBoth"|"alphaUcParenR"|"alphaUcPeriod"|"arabicParenBoth"|"arabicParenR"|"arabicPeriod"|"arabicPlain"|"romanLcParenBoth"|"romanLcParenR"|"romanLcPeriod"|"romanUcParenBoth"|"romanUcParenR"|"romanUcPeriod"
Number type
Example
ts
'romanLcParenR' // roman numerals lower-case with paranthesis rightsize?
optionalsize?:number
Bullet glyph size as a percentage of the run's text size (25–400)
Default
ts
100Example
ts
80 // bullet glyph is 80% of the text sizetype?
optionaltype?:"number"|"bullet"
Bullet type
Default
ts
bulletDefault
ts
falseInherited from
caps?
optionalcaps?:"small"|"all"|"none"
Defined in: core-interfaces.ts:659
Text capitalization
'all'= ALL CAPS'small'= Small Caps'none'= no override (default)- PowerPoint: Font > Effects > All Caps / Small Caps
Inherited from
charSpacing?
optionalcharSpacing?:number
Defined in: core-interfaces.ts:1841
Character spacing
color?
optionalcolor?:string
Defined in: core-interfaces.ts:667
Text color
HexColororThemeColor- MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Color
Examples
ts
'FF0000' // hex color (red)ts
pptx.SchemeColor.text1 // Theme color (Text1)Inherited from
columns?
optionalcolumns?:number
Defined in: core-interfaces.ts:1849
Number of text columns in the text body
- PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Columns > "Number"
- range: 1-16
Default
ts
1Example
ts
2 // flow text into two columnscolumnSpacing?
optionalcolumnSpacing?:number
Defined in: core-interfaces.ts:1857
Spacing between text columns (points)
- PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Columns > "Spacing"
- only applies when
columns> 1
Default
ts
0Example
ts
10 // 10pt gap between columnsdata?
optionaldata?:string
Defined in: core-interfaces.ts:88
base64-encoded string
- Useful for avoiding potential path/server issues
Example
ts
'image/png;base64,iVtDafDrBF[...]=' // pre-encoded image in base-64Inherited from
fill?
optionalfill?:ShapeFillProps
Defined in: core-interfaces.ts:1893
Shape fill
Examples
ts
{ color:'FF0000' } // hex color (red)ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparentts
{ color:pptx.SchemeColor.accent1 } // theme color Accent1fit?
optionalfit?:"resize"|"none"|TextFitShrinkProps|"shrink"
Defined in: core-interfaces.ts:1886
Text fit options
MS-PPT > Format Shape > Shape Options > Text Box > "[unlabeled group]": [3 options below]
- 'none' = Do not Autofit
- 'shrink' = Shrink text on overflow
- 'resize' = Resize shape to fit text
Measured fit: if you register the box's font with PptxGenJS.registerFontMetrics, both 'shrink' and 'resize' are measured at export time, so the text renders correctly in headless renderers and on plain file-open (no edit/resize needed):
'shrink'computes the largestfontScaleat which the wrapped text fits and bakes<a:normAutofit fontScale=…/>.'resize'computes the height the text needs and bakes it into the shape'sa:ext/@cy(adjustinga:off/@yper vertical anchor), the marker being<a:spAutoFit/>. Without registered metrics they fall back to the bare flag (<a:normAutofit/>/<a:spAutoFit/>, which only PowerPoint recomputes on edit) and warn once.
Note Bare 'shrink'/'resize' (no metrics) only take effect after editing text / resizing the shape; PowerPoint calculates the result then. The object form of 'shrink' always bakes the explicit values you pass.
Examples
ts
'shrink' // measured when metrics are registered; else bare <a:normAutofit/>ts
'resize' // measured when metrics are registered; else bare <a:spAutoFit/>ts
{ type: 'shrink', fontScale: 85, lnSpcReduction: 20 } // pre-shrink with explicit valuesDefault
ts
"none"flipH?
optionalflipH?:boolean
Defined in: core-interfaces.ts:1898
Flip shape horizontally?
Default
ts
falseflipV?
optionalflipV?:boolean
Defined in: core-interfaces.ts:1903
Flip shape vertical?
Default
ts
falsefontFace?
optionalfontFace?:string
Defined in: core-interfaces.ts:677
Font face name
Applied to the Latin (<a:latin>) and complex-script (<a:cs>) font slots, matching how PowerPoint writes a font picked from the UI. The East Asian slot (<a:ea>) is left to inherit from the theme unless fontFaceEA is set — forcing a Latin-only face into the East Asian slot duplicates/ghosts text in Office 365.
Example
ts
'Arial' // Arial fontInherited from
fontFaceEA?
optionalfontFaceEA?:string
Defined in: core-interfaces.ts:685
East Asian font face name (<a:ea> slot), used to render CJK (Chinese/Japanese/Korean) glyphs
Set this when the East Asian font differs from fontFace. When omitted, <a:ea> inherits the theme East Asian font, which is what PowerPoint does for Latin fonts.
Example
ts
'微軟正黑體' // render East Asian glyphs with Microsoft JhengHeiInherited from
fontSize?
optionalfontSize?:number
Defined in: core-interfaces.ts:690
Font size
Example
ts
12 // Font size 12Inherited from
glow?
optionalglow?:TextGlowProps
Defined in: core-interfaces.ts:1904
h?
optionalh?:Coord
Defined in: core-interfaces.ts:61
Height
- inches or percentage
Examples
ts
10.25 // height in inchests
'75%' // height as percentage of slide sizeInherited from
highlight?
optionalhighlight?:string
Defined in: core-interfaces.ts:695
Text highlight color (hex format)
Example
ts
'FFFF00' // yellowInherited from
hyperlink?
optionalhyperlink?:HyperlinkProps
Defined in: core-interfaces.ts:1905
indentLevel?
optionalindentLevel?:number
Defined in: core-interfaces.ts:1906
isTextBox?
optionalisTextBox?:boolean
Defined in: core-interfaces.ts:1907
italic?
optionalitalic?:boolean
Defined in: core-interfaces.ts:700
italic style
Default
ts
falseInherited from
lang?
optionallang?:string
Defined in: core-interfaces.ts:707
language
- ISO 639-1 standard language code
Default
ts
'en-US' // english USExample
ts
'fr-CA' // french CanadianInherited from
line?
optionalline?:ShapeLineProps
Defined in: core-interfaces.ts:1908
lineSpacing?
optionallineSpacing?:number
Defined in: core-interfaces.ts:1914
Line spacing (pt)
- PowerPoint: Paragraph > Indents and Spacing > Line Spacing: > "Exactly"
Example
ts
28 // 28ptlineSpacingMultiple?
optionallineSpacingMultiple?:number
Defined in: core-interfaces.ts:1921
line spacing multiple (percent)
- range: 0.0-9.99
- PowerPoint: Paragraph > Indents and Spacing > Line Spacing: > "Multiple"
Example
ts
1.5 // 1.5X line spacingmargin?
optionalmargin?:Margin
Defined in: core-interfaces.ts:1932
Margin (inches) — the text-frame internal margin/padding
- PowerPoint: Format Shape > Shape Options > Size & Properties > Text Box > Left/Right/Top/Bottom margin (shown in inches)
- array order is
[top, right, bottom, left] - a value
>= 1is honored as inches but warns once (it is likely a legacy points value; divide by 72)
Default
ts
(unset) PowerPoint's "Normal" internal margin [0.05", 0.1", 0.05", 0.1"]Examples
ts
0 // Top/Right/Bottom/Left margin 0ts
0.1 // Top/Right/Bottom/Left margin 0.1 inchts
[0.05, 0.1, 0.05, 0.1] // top 0.05", right 0.1", bottom 0.05", left 0.1"objectLock?
optionalobjectLock?:ObjectLockProps
Defined in: core-interfaces.ts:811
Object lock flags (DrawingML a:spLocks / a:picLocks / a:graphicFrameLocks)
- restrict how the object can be manipulated in PowerPoint (e.g. prevent moving, resizing, or grouping)
- each flag maps 1:1 to the OOXML attribute of the same name; only flags set to
trueare emitted - PowerPoint UI: Selection Pane / right-click protections (most locks are honored at edit time, not as a password)
- flags only apply to the object types that support them (see each flag); flags set on an unsupported object type are ignored with a console warning
Examples
ts
{ noMove: true, noResize: true } // pin an object in placets
{ noGrp: true } // exclude from groupingInherited from
objectName?
optionalobjectName?:string
Defined in: core-interfaces.ts:793
Object name
- used instead of default "Object N" name
- PowerPoint: Home > Arrange > Selection Pane...
Default
ts
'Object 1'Example
ts
'Antenna Design 9'Inherited from
outline?
optionaloutline?:object
Defined in: core-interfaces.ts:1933
color
color:
string
size
size:
number
paraSpaceAfter?
optionalparaSpaceAfter?:number
Defined in: core-interfaces.ts:1934
paraSpaceBefore?
optionalparaSpaceBefore?:number
Defined in: core-interfaces.ts:1935
path?
optionalpath?:string
Defined in: core-interfaces.ts:81
URL or relative path
Example
ts
'https://onedrives.com/myimg.png` // retrieve image via URL
@example '/home/user/images/myimg.png` // retrieve image via local pathInherited from
placeholder?
optionalplaceholder?:string
Defined in: core-interfaces.ts:1947
Placeholder type
- when the value matches a placeholder defined on the slide layout/master, this text inherits that placeholder's position and formatting
- otherwise the text shape is promoted to a standalone placeholder of this type, emitting a real
<p:ph type="...">. Useplaceholder: 'title'to give a slide an accessible title (PowerPoint's accessibility checker otherwise reports "Missing Slide Title") - values: 'title' | 'body' | et. al.
Example
ts
'title'See
https://learn.microsoft.com/en-us/office/vba/api/powerpoint.ppplaceholdertype
rectRadius?
optionalrectRadius?:number
Defined in: core-interfaces.ts:1953
Rounded rectangle radius (only for pptx.ShapeType.roundRect)
- values: 0.0 to 1.0
Default
ts
0rotate?
optionalrotate?:number
Defined in: core-interfaces.ts:1960
Rotation (degrees)
- range: -360 to 360
Default
ts
0Example
ts
180 // rotate 180 degreesrtlMode?
optionalrtlMode?:boolean
Defined in: core-interfaces.ts:1965
Whether to enable right-to-left mode
Default
ts
falseshadow?
optionalshadow?:ShadowProps
Defined in: core-interfaces.ts:1966
shape?
optionalshape?:SHAPE_NAME
Defined in: core-interfaces.ts:1967
softBreakBefore?
optionalsoftBreakBefore?:boolean
Defined in: core-interfaces.ts:712
Add a soft line-break (shift+enter) before line text content
Default
ts
falseInherited from
strike?
optionalstrike?:boolean|"dblStrike"|"sngStrike"
Defined in: core-interfaces.ts:1968
subscript?
optionalsubscript?:boolean
Defined in: core-interfaces.ts:1969
superscript?
optionalsuperscript?:boolean
Defined in: core-interfaces.ts:1970
tabStops?
optionaltabStops?:object[]
Defined in: core-interfaces.ts:718
tab stops
- PowerPoint: Paragraph > Tabs > Tab stop position
alignment?
optionalalignment?:"r"|"l"|"ctr"|"dec"
position
position:
number
Example
ts
[{ position:1 }, { position:3 }] // Set first tab stop to 1 inch, set second tab stop to 3 inchesInherited from
textDirection?
optionaltextDirection?:"horz"|"vert"|"vert270"|"wordArtVert"
Defined in: core-interfaces.ts:727
text direction horz = horizontal vert = rotate 90^ vert270 = rotate 270^ wordArtVert = stacked
Default
ts
'horz'Inherited from
textWarp?
optionaltextWarp?:string
Defined in: core-interfaces.ts:560
Preset text warp / WordArt shape (<a:bodyPr><a:prstTxWarp prst="..">), which bends the text along a preset path (arch, circle, wave, …). The value is an OOXML ST_TextShapeType preset name.
Examples
ts
'textArchUp' // bend text along an upward arch (e.g. a label following a ring/arc)ts
'textCircle'Inherited from
transparency?
optionaltransparency?:number
Defined in: core-interfaces.ts:734
Transparency (percent)
- MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Transparency
- range: 0-100
Default
ts
0Inherited from
underline?
optionalunderline?:object
Defined in: core-interfaces.ts:740
underline properties
- PowerPoint: Font > Color & Underline > Underline Style/Underline Color
color?
optionalcolor?:string
style?
optionalstyle?:"none"|"dash"|"dashHeavy"|"dashLong"|"dashLongHeavy"|"dbl"|"dotDash"|"dotDashHeave"|"dotDotDash"|"dotDotDashHeavy"|"dotted"|"dottedHeavy"|"heavy"|"sng"|"wavy"|"wavyDbl"|"wavyHeavy"
Default
ts
(none)Inherited from
valign?
optionalvalign?:VAlign
Defined in: core-interfaces.ts:1975
Vertical alignment
Default
ts
middleOverrides
vert?
optionalvert?:TextVertType
Defined in: core-interfaces.ts:1976
w?
optionalw?:Coord
Defined in: core-interfaces.ts:68
Width
- inches or percentage
Examples
ts
10.25 // width in inchests
'75%' // width as percentage of slide sizeInherited from
wrap?
optionalwrap?:boolean
Defined in: core-interfaces.ts:1981
Text wrap
Default
ts
truex?
optionalx?:Coord
Defined in: core-interfaces.ts:47
Horizontal position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide sizeInherited from
y?
optionaly?:Coord
Defined in: core-interfaces.ts:54
Vertical position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide size