Module units

Module units 

Source
Expand description

HWP measurement unit system.

HWP documents measure everything in HwpUnit, where 1 point = 100 HwpUnit. This module provides HwpUnit and geometry composites built from it: Size, Point, Rect, and Insets.

§Conversion Constants

UnitHwpUnit equivalent
1 pt100
1 inch7200
1 mm283.465… (f64 math)

§Examples

use hwpforge_foundation::HwpUnit;

let twelve_pt = HwpUnit::from_pt(12.0).unwrap();
assert_eq!(twelve_pt.as_i32(), 1200);
assert!((twelve_pt.to_pt() - 12.0).abs() < f64::EPSILON);

Structs§

HwpUnit
The universal measurement unit used throughout HWP documents.
Insets
Edge insets (margins/padding) in HwpUnit.
Point
A 2-dimensional point (x, y) in HwpUnit.
Rect
A rectangle defined by an origin Point and a Size.
Size
A 2-dimensional size (width x height) in HwpUnit.