pub fn text_ascent(text: &str, size_px: f32) -> f32
文本首行字体 ascent(逻辑像素)。
语法高亮按 span 分别绘制时,不同 fallback 字体(中文 vs 拉丁)的 ascent 不同;直接把同一个 y 传给每个 span 会让基线错位。调用方用 origin.y + (canonical - span_ascent) 对齐到同一条基线。
origin.y + (canonical - span_ascent)