IssueRaiser

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

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

github (SaaS)

Proposal: change `leading` option to `line-height`

peng1999May 22, 2024, 3:18 PM

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.

Comment on this issue