Update Font Properties of the Text

This article explains how to format the text. Using PUT /words/{name}/{paragraphPath}/runs/{index}/font API you can update font properties of the text.

REST API

~/{file-name}/{paragraphPath}/runs/{index}/font

, where:

  • {file-name} is a name of a document.
  • {paragraphPath} is a path to a paragraph in a document:
    • paragraphs/{paragraphIndex} - references a paragraph.
    • sections/{sectionIndex}/paragraphs/{paragraphIndex} - references a paragraph within a section.
  • {index} is an index of a run.

The important properties are described below:

Property NameTypeDescription
AllCapsboolTrue if the font is formatted as all capital letters.
BidiboolSpecifies whether the contents of this run shall have right-to-left characteristics.
BoldboolTrue if the font is formatted as bold.
BoldBiboolTrue if the right-to-left text is formatted as bold.
BorderBorderBorder object that specifies border for the font.
ColorColorSpecifies the color of the font.
ComplexScriptboolSpecifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run.
DoubleStrikeThroughboolTrue if the font is formatted as double strikethrough text.
EmbossboolTrue if the font is formatted as embossed.
EngraveboolTrue if the font is formatted as engraved.
HiddenboolTrue if the font is formatted as hidden text.
HighlightColorColorSpecifies the highlight (marker) color.
ItalicboolTrue if the font is formatted as italic.
ItalicBiboolTrue if the right-to-left text is formatted as italic.
KerningdoubleSpecifies the font size at which kerning starts.
LocaleIdintSpecifies the locale identifier (language) of the formatted characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx
LocaleIdBiintSpecifies the locale identifier (language) of the formatted right-to-left characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx
LocaleIdFarEastintSpecifies the locale identifier (language) of the formatted Asian characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx
NamestringSpecifies the name of the font.
NameAsciiboolSpecifies the font used for Latin text (characters with character codes from 0 (zero) through 127).
NameBiboolSpecifies the name of the font in a right-to-left language document.
NameFarEastboolSpecifies an East Asian font name.
NameOtherboolSpecifies the font used for characters with character codes from 128 through 255.
NoProofingboolTrue when the formatted characters are not to be spell checked.
OutlineboolTrue if the font is formatted as an outline.
PositiondoubleSpecifies the position of the text (in points) relative to the baseline. A positive number raises the text, and a negative number lowers it.
ScalingintSpecifies character width scaling in percent.
ShadowboolTrue if the font is formatted as shadowed.
SizedoubleSpecifies the font size in points.
SizeBidoubleSpecifies the font size in points used in a right-to-left document.
SmallCapsboolTrue if the font is formatted as small capital letters.
SpacingdoubleSpecifies the spacing (in points) between characters.
StrikeThroughboolTrue if the font is formatted as strikethrough text.
StyleIdentifierStyleIdentifierSpecifies the locale independent style identifier of the character style applied to this formatting.
StyleNamestringSpecifies the name of the character style applied to this formatting.
SubscriptboolTrue if the font is formatted as a subscript.
SuperscriptboolTrue if the font is formatted as superscript.
TextEffectTextEffectSpecifies the font animation effect.
UnderlineUnderlineSpecifies the type of underline applied to the font.
UnderlineColorColorSpecifies the color of the underline applied to the font.

You can use cURL command-line tool to access Aspose.Words web services easily. The following example shows how to make calls to Cloud API with cURL. Feel free to download and explore sample input SampleWordDocument.docx and output ResultWordDocument.docx files designed to act as a demonstration and let you figure out the details quickly.

Cloud SDK Family

Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks.

Please check out the GitHub repository for a complete list of Aspose.Words SDKs.

The following code examples demonstrate how to make calls to Aspose.Words web services using various SDKs: