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>

Why you’d use this

  • 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
Usage:
FontSize.configure({
  resizable: false,
  cellMinWidth: 50
})

Attributes

fontSize
FontSizeValue
Font size with unit

Commands

setFontSize

Set font size
Automatically clamps to min/max values
// Set to 14pt
setFontSize('14pt')

// Set to 18px
setFontSize('18px')

// Set without unit (uses default)
setFontSize(16)
Parameters:
fontSize
FontSizeValue
required
See FontSizeValue type definition

unsetFontSize

Remove font size
Reverts to default document size
unsetFontSize()

Types

FontSizeDefaults

Font size configuration

FontSizeValue

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