pub trait StyleLookup {
Show 25 methods
// Provided methods
fn char_bold(&self, _id: CharShapeIndex) -> Option<bool> { ... }
fn char_italic(&self, _id: CharShapeIndex) -> Option<bool> { ... }
fn char_underline(&self, _id: CharShapeIndex) -> Option<UnderlineType> { ... }
fn char_strikeout(&self, _id: CharShapeIndex) -> Option<bool> { ... }
fn char_superscript(&self, _id: CharShapeIndex) -> Option<bool> { ... }
fn char_subscript(&self, _id: CharShapeIndex) -> Option<bool> { ... }
fn char_font_name(&self, _id: CharShapeIndex) -> Option<&str> { ... }
fn char_font_axis_names(&self, id: CharShapeIndex) -> Vec<&str> { ... }
fn char_font_size(&self, _id: CharShapeIndex) -> Option<HwpUnit> { ... }
fn char_style_shape(&self, _name: &str) -> Option<CharShapeIndex> { ... }
fn char_text_color(&self, _id: CharShapeIndex) -> Option<Color> { ... }
fn para_alignment(&self, _id: ParaShapeIndex) -> Option<Alignment> { ... }
fn para_indent_left(&self, _id: ParaShapeIndex) -> Option<HwpUnit> { ... }
fn para_indent_first_line(&self, _id: ParaShapeIndex) -> Option<HwpUnit> { ... }
fn para_list_type(&self, _id: ParaShapeIndex) -> Option<&str> { ... }
fn para_list_level(&self, _id: ParaShapeIndex) -> Option<u8> { ... }
fn para_checked_state(&self, _id: ParaShapeIndex) -> Option<bool> { ... }
fn para_style_name(&self, _id: ParaShapeIndex) -> Option<&str> { ... }
fn para_heading_level(&self, _id: ParaShapeIndex) -> Option<u8> { ... }
fn style_name(&self, _id: StyleIndex) -> Option<&str> { ... }
fn style_heading_level(&self, _id: StyleIndex) -> Option<u8> { ... }
fn image_resolve_filename(&self, _key: &str) -> Option<&str> { ... }
fn image_data(&self, _key: &str) -> Option<&[u8]> { ... }
fn border_fill_lines(&self, _id: u32) -> Option<BorderFillLines> { ... }
fn border_fill_face(&self, _id: u32) -> Option<FillKind> { ... }
}Expand description
Trait for querying resolved style properties by index.
This is the bridge between format-specific style stores and
format-independent consumers (like the Markdown encoder). Each method
takes a branded index and returns Option<T>, where None means the
property is unavailable or unsupported.
§Default Implementations
Every method defaults to None, so an empty implementation is valid:
use hwpforge_core::StyleLookup;
use hwpforge_foundation::CharShapeIndex;
struct NoopStore;
impl StyleLookup for NoopStore {}
let store = NoopStore;
assert!(store.char_bold(CharShapeIndex::new(0)).is_none());Provided Methods§
Sourcefn char_bold(&self, _id: CharShapeIndex) -> Option<bool>
fn char_bold(&self, _id: CharShapeIndex) -> Option<bool>
Returns whether the character shape at id is bold.
Sourcefn char_italic(&self, _id: CharShapeIndex) -> Option<bool>
fn char_italic(&self, _id: CharShapeIndex) -> Option<bool>
Returns whether the character shape at id is italic.
Sourcefn char_underline(&self, _id: CharShapeIndex) -> Option<UnderlineType>
fn char_underline(&self, _id: CharShapeIndex) -> Option<UnderlineType>
Returns the underline type of the character shape at id.
Sourcefn char_strikeout(&self, _id: CharShapeIndex) -> Option<bool>
fn char_strikeout(&self, _id: CharShapeIndex) -> Option<bool>
Returns whether the character shape at id has strikeout.
Sourcefn char_superscript(&self, _id: CharShapeIndex) -> Option<bool>
fn char_superscript(&self, _id: CharShapeIndex) -> Option<bool>
Returns whether the character shape at id is superscript.
Sourcefn char_subscript(&self, _id: CharShapeIndex) -> Option<bool>
fn char_subscript(&self, _id: CharShapeIndex) -> Option<bool>
Returns whether the character shape at id is subscript.
Sourcefn char_font_name(&self, _id: CharShapeIndex) -> Option<&str>
fn char_font_name(&self, _id: CharShapeIndex) -> Option<&str>
Returns the font name of the character shape at id.
Sourcefn char_font_axis_names(&self, id: CharShapeIndex) -> Vec<&str>
fn char_font_axis_names(&self, id: CharShapeIndex) -> Vec<&str>
Returns the distinct font face names referenced across the per-language axes (hangul/latin/hanja/…) of the character shape.
Formats with per-language font references (HWPX fontRef) override
this to surface axis mismatches — a result longer than 1 means the
character shape renders with different fonts per script, which a
single-font consumer cannot reproduce faithfully. The first element
matches char_font_name when both resolve.
The default implementation returns the single
char_font_name (no axis information).
Sourcefn char_font_size(&self, _id: CharShapeIndex) -> Option<HwpUnit>
fn char_font_size(&self, _id: CharShapeIndex) -> Option<HwpUnit>
Returns the font size (in HwpUnit) of the character shape at id.
Sourcefn char_style_shape(&self, _name: &str) -> Option<CharShapeIndex>
fn char_style_shape(&self, _name: &str) -> Option<CharShapeIndex>
Returns the char shape referenced by the named character style
(style table type="CHAR"), matching either the localized or the
English style name.
Hancom renders page numbers (hp:pageNum) with the dedicated
“쪽 번호”/“Page Number” CHAR style rather than the document default —
fixture-verified (rules-pagenum, 2026-08-10). Consumers that
synthesize such text need the style’s char shape to match Hancom
output. The default implementation reports no style table.
Sourcefn char_text_color(&self, _id: CharShapeIndex) -> Option<Color>
fn char_text_color(&self, _id: CharShapeIndex) -> Option<Color>
Returns the text color of the character shape at id.
Sourcefn para_alignment(&self, _id: ParaShapeIndex) -> Option<Alignment>
fn para_alignment(&self, _id: ParaShapeIndex) -> Option<Alignment>
Returns the horizontal alignment of the paragraph shape at id.
Sourcefn para_indent_left(&self, _id: ParaShapeIndex) -> Option<HwpUnit>
fn para_indent_left(&self, _id: ParaShapeIndex) -> Option<HwpUnit>
Returns the left indent of the paragraph shape at id.
Sourcefn para_indent_first_line(&self, _id: ParaShapeIndex) -> Option<HwpUnit>
fn para_indent_first_line(&self, _id: ParaShapeIndex) -> Option<HwpUnit>
Returns the first-line indent of the paragraph shape at id.
Sourcefn para_list_type(&self, _id: ParaShapeIndex) -> Option<&str>
fn para_list_type(&self, _id: ParaShapeIndex) -> Option<&str>
Returns the list type for a paragraph shape: "BULLET", "NUMBER", or None.
Returns None if the paragraph has no list heading or if the heading
type is NONE / OUTLINE.
Sourcefn para_list_level(&self, _id: ParaShapeIndex) -> Option<u8>
fn para_list_level(&self, _id: ParaShapeIndex) -> Option<u8>
Returns the zero-based list nesting level for a paragraph shape.
This is only meaningful for numbered/bulleted list semantics. Outline
headings should use para_heading_level
instead.
Sourcefn para_checked_state(&self, _id: ParaShapeIndex) -> Option<bool>
fn para_checked_state(&self, _id: ParaShapeIndex) -> Option<bool>
Returns the checkbox state for a paragraph shape when it is a checkable bullet.
Some(true) means a checked checkbox item, Some(false) means an
unchecked checkbox item, and None means the paragraph is not a
checkable bullet.
Sourcefn para_style_name(&self, _id: ParaShapeIndex) -> Option<&str>
fn para_style_name(&self, _id: ParaShapeIndex) -> Option<&str>
Returns the preferred style name associated with the paragraph shape.
This is useful for encoders that need to recover semantics carried by a
dedicated paragraph shape even when the paragraph itself has no explicit
style_id.
Sourcefn para_heading_level(&self, _id: ParaShapeIndex) -> Option<u8>
fn para_heading_level(&self, _id: ParaShapeIndex) -> Option<u8>
Returns the heading level (1–6) implied by the paragraph shape at id.
This is the format-agnostic truth source for paragraph-level outline semantics. Implementors that can inspect real paragraph-shape outline metadata should override this method; downstream styled export paths use it before style-name heuristics whenever both are available.
Sourcefn style_name(&self, _id: StyleIndex) -> Option<&str>
fn style_name(&self, _id: StyleIndex) -> Option<&str>
Returns the Korean name of the style at id.
Sourcefn style_heading_level(&self, _id: StyleIndex) -> Option<u8>
fn style_heading_level(&self, _id: StyleIndex) -> Option<u8>
Returns the heading level (1–6) of the style at id, if it is
a heading style. Returns None for non-heading styles.
Sourcefn image_resolve_filename(&self, _key: &str) -> Option<&str>
fn image_resolve_filename(&self, _key: &str) -> Option<&str>
Resolves a binaryItemIDRef (e.g. "BinData/image1") to the actual
filename with extension (e.g. "image1.png").
Returns None if no matching image is found.
Sourcefn image_data(&self, _key: &str) -> Option<&[u8]>
fn image_data(&self, _key: &str) -> Option<&[u8]>
Returns the raw binary data for the image identified by key.
key is typically a path like "image1.jpg". Returns None if
the image is not available or if the implementor does not store
image data.
Sourcefn border_fill_lines(&self, _id: u32) -> Option<BorderFillLines>
fn border_fill_lines(&self, _id: u32) -> Option<BorderFillLines>
Returns the four rendered border edges of the borderFill at id
(1-based wire reference, e.g. crate::table::TableCell::border_fill_id).
None means the id is not registered in this store.
Sourcefn border_fill_face(&self, _id: u32) -> Option<FillKind>
fn border_fill_face(&self, _id: u32) -> Option<FillKind>
Returns the face-fill verdict of the borderFill at id (1-based
wire reference).
None means the id is not registered — distinguish this from
FillKind::None (registered, but transparent) and
FillKind::Unsupported (registered, but not renderable — warn).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".