Skip to main content
Adjust text size for emphasis and readability. Select text and apply different sizes. Supports pt, px, em, and rem units with automatic min/max clamping.

OOXML Structure

<w:r>
  <w:rPr>
    <w:sz w:val="28"/> <!-- Half-points: 14pt = 28 -->
  </w:rPr>
  <w:t>14pt text</w:t>
</w:r>

Use Case

  • Visual hierarchy - Different sizes for headers, body, and footnotes
  • Emphasis - Larger text draws attention without bold
  • Readability - Adjust size for screen distance and user preference
  • Professional documents - Match specific formatting requirements

Options

Configure the extension behavior:
types
Array<string>
default:"['textStyle','tableCell']"
Node/mark types to add font size support to
defaults
FontSizeDefaults
Default size configuration

Attributes

Node attributes that can be set and retrieved:
fontSize
FontSizeValue
Font size with unit

Commands

setFontSize

Set font size
Automatically clamps to min/max values
Example:
editor.commands.setFontSize('14pt')
editor.commands.setFontSize('18px')
editor.commands.setFontSize(16)
Parameters:
fontSize
FontSizeValue
required
Size to apply (with optional unit)

unsetFontSize

Remove font size
Reverts to default document size
Example:
editor.commands.unsetFontSize()

Types

FontSizeDefaults

Font size configuration

FontSizeValue

Size with optional unit (e.g., ‘12pt’, ‘16px’, 14)

Source Code

I