mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-02 14:38:13 -06:00
Chinese next to Latin in one label sat a few percent of the font size above or below the Latin, depending on the installed Chinese face. egui centres a fallback face's line box on the primary face's instead of lining up their baselines, so the fallback's baseline moves by half the difference of ascent + descent (less half the difference of the line gaps): +0.047 em for Microsoft JhengHei, +0.034 em for Microsoft YaHei, -0.075 em for SimSun under Inter. Fallback faces (the installed system face and the craft-fonts faces) now get a FontTweak::y_offset_factor that cancels that shift, computed from their own metrics with the skrifa egui uses, so any face lands on Inter's baseline. skrifa moves from the native-only dependencies to all targets (egui already brings it to wasm). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>