Module caption

Module caption 

Source
Expand description

Caption types for shape objects (tables, images, textboxes, etc.).

A Caption attaches descriptive text (typically numbered) below, above, or beside a shape object. In HWPX, this maps to the <hp:caption> element nested inside drawing objects like <hp:tbl>, <hp:pic>, <hp:rect>, etc.

§Design

Caption is a Core-level structural type. It holds position, gap, optional width, and paragraph content. HWPX-specific attributes (fullSz, lastWidth) belong in the Schema layer, not here.

§Examples

use hwpforge_core::caption::{Caption, CaptionSide};
use hwpforge_core::paragraph::Paragraph;
use hwpforge_foundation::{HwpUnit, ParaShapeIndex};

let caption = Caption {
    side: CaptionSide::Bottom,
    width: None,
    gap: HwpUnit::new(850).unwrap(),
    paragraphs: vec![Paragraph::new(ParaShapeIndex::new(0))],
};
assert_eq!(caption.side, CaptionSide::Bottom);

Structs§

Caption
Caption attached to a shape object (table, image, textbox, etc.).

Enums§

CaptionSide
Position of caption relative to its parent object.

Constants§

DEFAULT_CAPTION_GAP
Default caption gap in HWPUNIT (~3mm). Used by Caption::default and Caption::new.