Proposal: change `leading` option to `line-height`
I propose deprecating the `par.leading` option, and add a `par.line-height` option instead. # Motivation ## The current leading model do not persist baseline distance Current leading model specifies the space between bottom edge of last line and top edge of the next line. This is fine when every line frame is of the same height but becomes undesirable when some lines become taller. See https://github.com/typst/typst/issues/1028#issuecomment-2029983751 for example. To alleviate the problem, currently Typst hacks into the bounding box of inline formula. However, this workaround is not ideal as it leads to the exact issues described in #1028 and lacks a straightforward solution. Furthermore, line spacing becomes uneven when text with different size appeared in paragraph. No proper solution exists under current leading model. Typst: <img width="483" alt="image" src="https://github.com/typst/typst/assets/12483662/3e2a9a5a-c7e1-488e-9885-d60c64ecf4e8"> LaTeX: <img width="483" alt="image" src="https://github.com/typst/typst/assets/12483662/3043aa09-85cd-4cd9-8ed5-f324d0ba50c3"> ## The current leading model is confusing and inconsistent with precedence Typst define leading as “The spacing between lines”. However, other typesetting software such as Adobe InDesign and Affinity Publisher use the term “leading” to refer to the distance between text baselines. Other typesetting systems like CSS, LaTeX, and Microsoft Word do not employ the term “leading”, yet they all relate line
Posted by peng1999 on May 22, 2024, 3:18 PM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Proposal: change `leading` option to `line-height`
I propose deprecating the `par.leading` option, and add a `par.line-height` option instead. # Motivation ## The current leading model do not persist baseline distance Current leading model specifies the space between bottom edge of last line and top edge of the next line. This is fine when every line frame is of the same height but becomes undesirable when some lines become taller. See https://github.com/typst/typst/issues/1028#issuecomment-2029983751 for example. To alleviate the problem, currently Typst hacks into the bounding box of inline formula. However, this workaround is not ideal as it leads to the exact issues described in #1028 and lacks a straightforward solution. Furthermore, line spacing becomes uneven when text with different size appeared in paragraph. No proper solution exists under current leading model. Typst: <img width="483" alt="image" src="https://github.com/typst/typst/assets/12483662/3e2a9a5a-c7e1-488e-9885-d60c64ecf4e8"> LaTeX: <img width="483" alt="image" src="https://github.com/typst/typst/assets/12483662/3043aa09-85cd-4cd9-8ed5-f324d0ba50c3"> ## The current leading model is confusing and inconsistent with precedence Typst define leading as “The spacing between lines”. However, other typesetting software such as Adobe InDesign and Affinity Publisher use the term “leading” to refer to the distance between text baselines. Other typesetting systems like CSS, LaTeX, and Microsoft Word do not employ the term “leading”, yet they all relate line
Comments (0)
No comments yet. Start the discussion.