mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
Upright glyphs in vertical type advanced one em (or their horizontal advance, if wider) and turned about a fixed point 0.38 em above the baseline. Fonts that carry vertical metrics now place them as they ask: - `FontFace::vertical_glyph`: a glyph's advance down the column (`vmtx`) and the height of its vertical origin (`VORG`, else the glyph's top plus its top side bearing, as in TrueType fonts); `None` without `vhea`/`vmtx` or with values outside a few ems. `FontFace::ideographic_centre`: the em box centre from an ideograph's cell, else 0.38. - The layout advances an upright glyph by its vertical advance and hangs it from its vertical origin; tate-chu-yoko blocks and point type's anchor use the font's em box centre. Fonts without vertical metrics are laid out exactly as before. - Hiragino's tables give the values the layout assumed (one em, origin 0.88 em), so Japanese vertical type in it renders pixel for pixel the same; this is the base for proportional vertical metrics (`vpal`) and for fonts whose em box sits elsewhere. - `test_fonts::vertical_font`: Source Sans 3 with `vhea`/`vmtx` (and optionally `VORG`) built in code, one glyph 1.4 em tall hanging from 1.1 em; tested with and without `VORG`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>