Replace one font family with another throughout a document — the CLI
equivalent of Word’s Home → Replace → Replace Fonts. Replaces every
content-level reference in one pass; theme font references are untouched
(use uniword theme fonts for those).
1. Subcommands
| Subcommand | Description |
|---|---|
|
Replace a font family throughout a document |
2. replace
Replace one font family with another across every place a font name appears in the body content, styles and defaults, headers/footers, footnotes, endnotes, comments, and numbering definitions.
# Swap Calibri for Carlito (Calibri-metric OFL substitute)
uniword fonts replace input.docx output.docx --from Calibri --to Carlito
# Replace Arial with Liberation Sans
uniword fonts replace input.docx output.docx --from Arial --to "Liberation Sans"
Options:
--from-
Font family to replace (exact, case-sensitive match; required)
--to-
Replacement font family (required)
--verbose,-v-
Verbose output
The command prints the total number of references rewritten.
|
This command rewrites content-level fonts. To replace the theme’s major/minor fonts (Word’s Design → Fonts gallery), use:
|
3. Where replacement applies
fonts replace walks every part that can carry a font reference:
| Part | What is rewritten |
|---|---|
|
|
|
Run-level |
|
Run-level |
|
Run-level |
|
Run-level |
|
Run-level |
Theme font references (<a:latin> / <a:cs> in word/theme/theme1.xml) are
deliberately left alone so the document’s font scheme stays coherent.