Class: Field
One text field (a:fld): text PowerPoint computes as it renders, such as a slide number (slidenum) or a date (datetime1). A field carries the same a:rPr a run does, so it reads and resolves its formatting like one. text is the rendering PowerPoint last cached, which it recomputes on open.
Extends
Constructors
Constructor
new Field(
element,context,inherited):Field
Parameters
| Parameter | Type | Description |
|---|---|---|
element | Element | - |
context | TextContext | What the run is read against; see TextContext. Its inherit.fontRef is the tier resolvedColor and resolvedFontFace consult just below the run's own a:rPr and above the placeholder and p:defaultTextStyle chain. |
inherited | InheritedRunProps | null | What the run inherits when it sets no colour, size, face, bold or italic of its own, or null for text that inherits through nothing. Built by the owning Paragraph and shared by its runs; nothing in it is resolved until a run asks. |
Returns
Field
Inherited from
Accessors
baselinePct
Get Signature
get baselinePct():
number|null
Baseline shift as a percentage of the font size (a:rPr/@baseline, stored in 1000ths of a percent): positive for superscript (the writer's default is 30), negative for subscript (-40), or null when unset. Reported as the percentage (@baseline ÷ 1000).
@baseline is a:ST_Percentage, a union that also admits "62.5%" (the only form the Strict profile has), so it is read through parsePercentPoints rather than as a bare number.
Returns
number | null
Inherited from
bold
Get Signature
get bold():
boolean|null
Bold (a:rPr/@b), or null when unset (inherited from style).
Returns
boolean | null
Set Signature
set bold(
value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean | null |
Returns
void
Inherited from
breaksBefore
Get Signature
get breaksBefore():
number
How many line breaks (a:br) sit directly before this run in its paragraph, with no run or field between them. A soft break is not a run, so without this the runs on either side of one read as plain neighbours. The read counterpart of the write-side softBreakBefore option.
Returns
number
Inherited from
caps
Get Signature
get caps():
string|null
Capitalization token (a:rPr/@cap: none | small | all), or null when unset. small renders small-caps, all renders all-caps.
Returns
string | null
Inherited from
charSpacingPt
Get Signature
get charSpacingPt():
number|null
Character spacing (tracking) in points (a:rPr/@spc, authored in hundredths of a point), or null when unset. Negative tightens. The read counterpart of the write-side charSpacing option.
Returns
number | null
Inherited from
color
Get Signature
get color():
string|null
Explicit RGB fill colour as a 6-hex string (a:solidFill/a:srgbClr/@val), or null.
Returns
string | null
Set Signature
set color(
value):void
Parameters
| Parameter | Type |
|---|---|
value | string | null |
Returns
void
Inherited from
eastAsianFontName
Get Signature
get eastAsianFontName():
string|null
The East Asian typeface (a:rPr/a:ea/@typeface), or null when unset. fontName is the Latin slot. The read counterpart of the write-side fontFaceEA option.
Returns
string | null
Inherited from
element_
Get Signature
get element_():
Element
Escape hatch: the underlying a:r element. After mutating it call markDirty, or save() writes the original bytes.
Returns
Element
Inherited from
fontName
Get Signature
get fontName():
string|null
Latin typeface name (a:rPr/a:latin/@typeface), or null when unset.
Returns
string | null
Set Signature
set fontName(
value):void
Parameters
| Parameter | Type |
|---|---|
value | string | null |
Returns
void
Inherited from
fontSizePt
Get Signature
get fontSizePt():
number|null
Font size in points (a:rPr/@sz is hundredths of a point), or null if unset.
Returns
number | null
Set Signature
set fontSizePt(
value):void
Parameters
| Parameter | Type |
|---|---|
value | number | null |
Returns
void
Inherited from
glow
Get Signature
get glow():
Glow|null
The run's own glow (a:rPr/a:effectLst/a:glow), resolved against the slide theme, or null. The read counterpart of the write-side text glow option; a shape's glow is Shape.glow.
Returns
Glow | null
Inherited from
highlight
Get Signature
get highlight():
ResolvedColor|null
The run's highlight colour (a:rPr/a:highlight), resolved to a literal hex through the owning slide's theme, or null when the run has no highlight or its colour cannot be made literal. The writer authors highlights from a hex colour, so effectiveHex is that colour; imported decks may carry a theme token.
Returns
ResolvedColor | null
Inherited from
hyperlink
Get Signature
get hyperlink():
Hyperlink|null
The run's click hyperlink (a:rPr/a:hlinkClick), or null when the run carries none. A URL link resolves its @r:id to the external target (Hyperlink.url); a slide jump resolves it to the linked slide's partname (Hyperlink.targetPartName). When the run is read without its part's relationships (see TextContext.rels), only the raw @r:id/@action/@tooltip are reported (the target stays null).
Returns
Hyperlink | null
Inherited from
innerShadow
Get Signature
get innerShadow():
InnerShadow|null
The run's own inner shadow (a:rPr/a:effectLst/a:innerShdw), resolved against the slide theme, or null. What a run's shadow: { type: 'inner' } writes.
Returns
InnerShadow | null
Inherited from
italic
Get Signature
get italic():
boolean|null
Italic (a:rPr/@i), or null when unset (inherited from style).
Returns
boolean | null
Set Signature
set italic(
value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean | null |
Returns
void
Inherited from
kerningPt
Get Signature
get kerningPt():
number|null
Kerning threshold in points (a:rPr/@kern, authored in hundredths of a point), or null when unset: text at this font size or larger is pair-kerned, and 0 means kerning is off. PowerPoint's own default is 12. The read counterpart of the write-side kerning option.
Returns
number | null
Inherited from
language
Get Signature
get language():
string|null
The run's language tag (a:rPr/@lang, e.g. fr-FR), or null when unset. Decides spelling, hyphenation and font fallback. The read counterpart of the write-side lang option.
Returns
string | null
Inherited from
outline
Get Signature
get outline():
RunOutline|null
The run's text outline (a:rPr/a:ln), or null when it has none. The read counterpart of outline.
Returns
RunOutline | null
Inherited from
resolvedBold
Get Signature
get resolvedBold():
boolean|null
Whether this run effectively renders bold. It is the run's own @b (bold) when set; otherwise, for a run inside a placeholder, the bold state it inherits from the placeholder/list-style chain (paragraph a:defRPr → slide a:lstStyle → layout → master placeholder a:lstStyle → master p:txStyles). null when the run sets no @b and inherits none. This is the resolved counterpart of bold, which reports only the run's own value.
Returns
boolean | null
Inherited from
resolvedColor
Get Signature
get resolvedColor():
ResolvedColor|null
The colour this run effectively renders, resolved against the owning slide's theme to a literal hex. It is the run's own solid fill (color/schemeColor) when set; otherwise the shape's p:style/a:fontRef colour, then (for a run inside a placeholder) the colour it inherits from the placeholder/list-style chain (layout → master placeholder a:lstStyle → master p:txStyles), then the presentation's p:defaultTextStyle. null when the run sets no colour and inherits none, or the colour cannot be made literal. null too when the run's own fill is not a solid colour (a:noFill, a gradient): the run decides its own colour then, and the one it would otherwise inherit is not what it paints in, the rule Shape.resolvedFill and TableCell.resolvedFill follow. The returned ResolvedColor carries effectiveHex, the base colour with its child transforms (lumMod/shade/…) applied, for the final rendered colour.
Returns
ResolvedColor | null
Inherited from
resolvedFontFace
Get Signature
get resolvedFontFace():
string|null
The typeface this run effectively renders, resolved to a literal face name. It is the run's own a:latin (fontName) when set; otherwise the face named by the shape's p:style/a:fontRef (idx → theme major/minor font), then (for a run inside a placeholder) the face it inherits from the placeholder/list-style chain, then the presentation's p:defaultTextStyle. A +mj-*/+mn-* major/minor theme-font token, on the run itself or reached through the chain, is resolved through the theme fontScheme to its concrete face. null when the run names no face and inherits none, or a token cannot be resolved. This is the resolved counterpart of fontName, which reports the raw @typeface (possibly a token).
Returns
string | null
Inherited from
resolvedItalic
Get Signature
get resolvedItalic():
boolean|null
Whether this run effectively renders italic. It is the run's own @i (italic) when set; otherwise, for a run inside a placeholder, the italic state it inherits from the placeholder/list-style chain (paragraph a:defRPr → slide a:lstStyle → layout → master placeholder a:lstStyle → master p:txStyles). null when the run sets no @i and inherits none. This is the resolved counterpart of italic, and the twin of resolvedBold: @b and @i are siblings a master text style states together, so a deck that can be authored with an inherited italic can be read back with one.
Returns
boolean | null
Inherited from
resolvedSizePt
Get Signature
get resolvedSizePt():
number|null
The point size this run effectively renders. It is the run's own @sz (fontSizePt) when set; otherwise, for a run inside a placeholder, the size it inherits from the placeholder/list-style chain (paragraph a:defRPr → slide a:lstStyle → layout → master placeholder a:lstStyle → master p:txStyles). null when the run sets no size and inherits none. This is the resolved counterpart of fontSizePt, which reports only the run's own value.
Returns
number | null
Inherited from
schemeColor
Get Signature
get schemeColor():
string|null
Theme colour token when the fill is a scheme colour (a:schemeClr/@val, e.g. accent2), or null.
Returns
string | null
Set Signature
set schemeColor(
value):void
Throws
when the token is not an ST_SchemeColorVal
Parameters
| Parameter | Type |
|---|---|
value | string | null |
Returns
void
Inherited from
shadow
Get Signature
get shadow():
OuterShadow|null
The run's own outer shadow (a:rPr/a:effectLst/a:outerShdw), resolved against the slide theme, or null. The read counterpart of a run's shadow option and of a table cell's, which writes it on every run of the cell; a shape's shadow is Shape.shadow.
Returns
OuterShadow | null
Inherited from
strike
Get Signature
get strike():
string|null
Strikethrough token (a:rPr/@strike: noStrike | sngStrike | dblStrike), or null when unset (inherited from the style). Surfaced as the raw token; sngStrike is the writer's single-strike value.
Returns
string | null
Inherited from
text
Get Signature
get text():
string
The run's text (a:t), verbatim; whitespace is not normalized.
Returns
string
Set Signature
set text(
value):void
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
void
Inherited from
type
Get Signature
get type():
string|null
The field type (@type), such as slidenum or datetime1, or null when unset.
Returns
string | null
underline
Get Signature
get underline():
string|null
Underline style token (a:rPr/@u, e.g. sng), or null when unset.
Returns
string | null
Set Signature
set underline(
value):void
Throws
when the token is not an ST_TextUnderlineType
Parameters
| Parameter | Type |
|---|---|
value | string | null |
Returns
void
Inherited from
underlineColor
Get Signature
get underlineColor():
ColorRef|null
The underline's own colour (a:rPr/a:uFill/a:solidFill), as written and resolved, or null when the underline follows the text colour. The read counterpart of underline.color.
Returns
ColorRef | null
Inherited from
Methods
markDirty()
markDirty():
void
Mark the owning part dirty so save() reserializes it. Call after mutating element_.
Returns
void