Adjust spacing between lines for better readability.
Control line height for paragraphs and headings. Perfect for improving document readability and meeting formatting requirements.
Use case
- Readability - Increase spacing for easier reading
- Academic requirements - Double spacing for papers and theses
- Accessibility - Better spacing helps users with dyslexia
- Design control - Match brand guidelines or style requirements
Commands
setLineHeight
Set line height as a multiplier (e.g., 1.5 for 1.5x line spacing).
Example:
editor.commands.setLineHeight(1.5)
editor.commands.setLineHeight(2)
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
const superdoc = new SuperDoc({
selector: '#editor',
document: yourFile,
onReady: (superdoc) => {
const editor = superdoc.activeEditor;
editor.commands.setLineHeight(1.5)
editor.commands.setLineHeight(2)
},
});
Parameters:
Line height multiplier (e.g., 1.0 for single, 1.5, 2.0 for double)
unsetLineHeight
Remove line height and revert to default line spacing.
Example:
editor.commands.unsetLineHeight()
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
const superdoc = new SuperDoc({
selector: '#editor',
document: yourFile,
onReady: (superdoc) => {
const editor = superdoc.activeEditor;
editor.commands.unsetLineHeight()
},
});
Source code