Repository navigation
Type: vertical type takes upright glyphs' cells from the font's vertical metrics - #343
Merged
Merged
Conversation
…cal metrics 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>
4 tasks done
h-a-n-a-s-h-i
pushed a commit
that referenced
this pull request
Oct 7, 2026
4 tasks done
bflatastic
added a commit
that referenced
this pull request
Oct 7, 2026
…343) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
added a commit
that referenced
this pull request
Oct 7, 2026
Member
|
Thank you @imachus! This is merged. Upright glyphs in vertical type now take their cell from the font's Checked live: MS Gothic vertical columns render correctly, with the |
bflatastic
pushed a commit
to imachus/vectorcraft
that referenced
this pull request
Oct 7, 2026
… top Japanese layout measures leading from the top of one line's ideographic em box to the next (the right side, in vertical type), not from baseline to baseline. The Paragraph panel menu now offers both: - `ParaStyle.leading_model`: RomanBaseline (as before, the default) or EmBoxTop. With EmBoxTop a line's leading is the space below it — the next line's em box top is this line's plus its leading, and the next baseline hangs from there by that line's tallest em box — and area type's first line touches the top of the frame (its em box top on the frame's top, at least Area Type Options' minimum). With baseline leading a line's leading stays the space above it. - Lines of one size are exactly as far apart either way; the models differ for mixed sizes and for the first line of area type (fonts whose ascent isn't the em box top: Hiragino's nearly is). - The em box top comes from the font's vertical metrics (storytold#343), else 0.88 em. Written only when EmBoxTop. - `text.setFormat {leadingModel: "romanBaseline"|"emBoxTop"}`; menu items Top-to-Top Leading / Bottom-to-Bottom Leading (checked as set); catalog rows in ja and zh-hant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
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 topplus its top side bearing, as in TrueType fonts);
Nonewithoutvhea/vmtxor with values outside a few ems.FontFace::ideographic_centre: the em box centre from an ideograph'scell, else 0.38.
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.
0.88 em), so Japanese vertical type in it renders pixel for pixel the
same; this is the base for proportional vertical metrics (
vpal) andfor fonts whose em box sits elsewhere.
test_fonts::vertical_font: Source Sans 3 withvhea/vmtx(andoptionally
VORG) built in code, one glyph 1.4 em tall hanging from1.1 em; tested with and without
VORG.First of a few small steps toward Japanese composition (the ROADMAP's "CJK composition for vertical type"), following the W3C Requirements for Japanese Text Layout and the OpenType spec (vhea, vmtx, VORG).
How it was tested
cargo testfor text, engine, render, pdf, svg and tools passes (2,135), with the new test intests_vertical.rs(the test font is built in code; nothing is committed).vertical_glyphreads (1000, 880) for 国、、, ー and ゃ.cargo fmt --check,cargo clippy --all-targets -D warnings,cargo xtask brands,layerspass; the web build compiles.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).🤖 Generated with Claude Code