Styles And Numbering¶
featherdoc::Document exposes style and numbering APIs for inspection,
controlled mutation, refactoring, and default formatting. Use this page to find
the direct entry points for style and numbering work.
Typed Signature Guide¶
Style APIs address styles by style_id. Numbering levels are zero-based.
Methods returning std::optional<T> return an empty value when the style,
numbering definition, or generated plan cannot be resolved.
Signature |
Parameters |
Return semantics |
|---|---|---|
|
|
|
|
None. |
Current numbering catalog for governance or reuse. |
|
|
Import counts and conflicts. |
|
|
Definition id, or empty when it cannot be ensured. |
|
|
|
|
|
Summary, or empty when the style is missing. |
|
|
|
|
|
|
|
|
|
|
|
Audit report for all or one table style. |
Numbering¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Attach a generated list to a paragraph. |
|
|
Start a new list instance for a paragraph. |
|
|
Remove list metadata from a paragraph. |
|
|
Enumerate numbering definitions. |
|
|
Find one numbering definition. |
|
|
Export definitions for governance or reuse. |
|
|
Import a numbering catalog. |
|
|
Attach an existing numbering definition to a paragraph. |
Styles¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Enumerate styles. |
|
|
Find a style by id. |
|
|
Resolve inherited style properties. |
|
|
Inspect one style’s usage. |
|
|
Inspect usage across all styles. |
|
|
Rename a style id. |
|
|
Move usage from one style to another. |
|
|
Generate conservative merge suggestions. |
|
|
Plan or apply unused style cleanup. |
Default Formatting¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Read the default run font family. |
|
|
Set the default run font family. |
|
|
Set the default run language. |
|
|
Set the default paragraph bidi flag. |
|
|
Clear the default run font family. |
Table Style Quality¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Inspect a table style definition. |
|
|
Audit table style region consistency. |
|
|
Audit table style inheritance. |
|
|
Inspect table look flags. |
|
|
Apply conservative table look repairs. |
|
|
Run table style quality checks. |
Example¶
featherdoc::Document doc{"styled.docx"};
doc.open();
auto styles = doc.list_styles();
auto usage = doc.list_style_usage();
auto suggestions = doc.suggest_style_merges();
auto ¶graph = doc.paragraphs();
doc.set_paragraph_list(paragraph, featherdoc::list_kind::bullet);
doc.set_default_run_language("en-US");