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
Default size configuration
Attributes
Node attributes that can be set and retrieved:
Commands
setFontSize
Set font size
Automatically clamps to min/max values
Example:
editor . commands . setFontSize ( '14pt' )
editor . commands . setFontSize ( '18px' )
editor . commands . setFontSize ( 16 )
import { SuperDoc } from 'superdoc' ;
import 'superdoc/style.css' ;
const superdoc = new SuperDoc ({
selector: '#editor' ,
document: yourFile ,
onReady : ( superdoc ) => {
const editor = superdoc . activeEditor ;
editor . commands . setFontSize ( '14pt' )
editor . commands . setFontSize ( '18px' )
editor . commands . setFontSize ( 16 )
},
});
Parameters:
Size to apply (with optional unit)
unsetFontSize
Remove font size
Reverts to default document size
Example:
editor . commands . unsetFontSize ()
import { SuperDoc } from 'superdoc' ;
import 'superdoc/style.css' ;
const superdoc = new SuperDoc ({
selector: '#editor' ,
document: yourFile ,
onReady : ( superdoc ) => {
const editor = superdoc . activeEditor ;
editor . commands . unsetFontSize ()
},
});
Types
FontSizeDefaults
Font size configuration
Default unit (pt, px, em, rem)
FontSizeValue
Size with optional unit (e.g., ‘12pt’, ‘16px’, 14)
Source code