ApiTextPr

class ApiTextPr

Description

Class representing the text properties.

Instance Methods

GetClassType(): textPr

Returns a type of the ApiTextPr class.

SetBold(isBold): ApiTextPr

Sets the bold property to the text character.

GetBold(): boolean

Gets the bold property from the current text properties.

SetItalic(isItalic): ApiTextPr

Sets the italic property to the text character.

GetItalic(): boolean

Gets the italic property from the current text properties.

SetStrikeout(isStrikeout): ApiTextPr

Specifies that the contents of the run are displayed with a single horizontal line through the center of the line.

GetStrikeout(): boolean

Gets the strikeout property from the current text properties.

SetUnderline(isUnderline): ApiTextPr

Specifies that the contents of the run are displayed along with a line appearing directly below the character (less than all the spacing above and below the characters on the line).

GetUnderline(): boolean

Gets the underline property from the current text properties.

SetFontFamily(sFontFamily): ApiTextPr

Sets all 4 font slots with the specified font family.

GetFontFamily(): string

Gets the font family from the current text properties.

SetFontSize(nSize): ApiTextPr

Sets the font size to the characters of the current text run.

GetFontSize(): hps

Gets the font size from the current text properties.

SetVertAlign(sType): ApiTextPr

Specifies the alignment which will be applied to the contents of the run in relation to the default appearance of the run text: "baseline" - the characters in the current text run will be aligned by the default text baseline.

SetHighlight(sColor): ApiTextPr

Specifies a highlighting color which is added to the text properties and applied as a background to the contents of the current run/range/paragraph.

GetHighlight(): string

Gets the highlight property from the current text properties.

SetSpacing(nSpacing): ApiTextPr

Sets the text spacing measured in twentieths of a point.

GetSpacing(): twips

Gets the text spacing from the current text properties measured in twentieths of a point.

SetDoubleStrikeout(isDoubleStrikeout): ApiTextPr

Specifies that the contents of the run are displayed with two horizontal lines through each character displayed on the line.

GetDoubleStrikeout(): boolean

Gets the double strikeout property from the current text properties.

SetCaps(isCaps): ApiTextPr

Specifies that any lowercase characters in the text run are formatted for display only as their capital letter character equivalents.

GetCaps(): boolean

Specifies whether the text with the current text properties are capitalized.

SetSmallCaps(isSmallCaps): ApiTextPr

Specifies that all the small letter characters in the text run are formatted for display only as their capital letter character equivalents which are two points smaller than the actual font size specified for this text.

GetSmallCaps(): boolean

Specifies whether the text with the current text properties are displayed capitalized two points smaller than the actual font size.

SetFill(oApiFill): ApiTextPr

Sets the text color to the current text run.

GetFill(): ApiFill

Gets the text color from the current text properties.

SetTextFill(oApiFill): ApiTextPr

Sets the text fill to the current text run.

GetTextFill(): ApiFill

Gets the text fill from the current text properties.

SetOutLine(oStroke): ApiTextPr

Sets the text outline to the current text run.

GetOutLine(): ApiStroke

Gets the text outline from the current text properties.

Extends By

ApiRunApiTextPr

Class representing a small text block called 'run'.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).