merman-render 0.4.1

Headless layout + SVG renderer for Mermaid (parity-focused; upstream SVG goldens).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// This file is intentionally small and hand-curated.
//
// We use these overrides to close the remaining C4 SVG text-measurement parity gaps where
// Mermaid@11.12.2 rounds browser `getBBox().height` to diagram-specific per-line constants.

pub fn lookup_c4_svg_bbox_line_height_px(font_size_px: i64) -> Option<f64> {
    match font_size_px {
        12 => Some(14.0),
        14 => Some(16.0),
        16 => Some(17.0),
        _ => None,
    }
}