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
| Unit | HwpUnit equivalent |
|---|---|
| 1 pt | 100 |
| 1 inch | 7200 |
| 1 mm | 283.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);