Description
Description
To the best of my knowledge, there is no simple and reliable way to control the line height and baseline alignment of text placed next to each other. I assume this issue is related to #493, #4224, and #4755. By "reliable," I mean that the baseline parameter of both #text and #box is inadequate because it breaks when the font or font size changes. I wanted to highlight this basic and common case as an issue because it demonstrates that this is a fundamental problem, not just related to emojis or "edge cases."
Consider this MWE
#place(dy:0.68em, stack(spacing: 2.96em,
..(line(
length: 100%,
stroke: .25pt + gray,
),)*3
))
#grid(
columns: (0.2fr, 1fr),
row-gutter: 1em,
text(8pt)[Flying Title],
[The list item text.\ Can span around multiple lines.],
text(8pt, baseline: 0.25em)[Baseline Title],
[The list item text.\ Can span around multiple lines.],
par(leading: 11pt, {text(8pt)[Paragraph Test]}),
[The list item text.]
)Use Case
There is probably no silver bullet, but having a "real" line-height option could be a great start. For tables and grids, a vertical alignment to the baseline would be an even better solution, potentially allowing not just alignment to the first baseline but optionally to the n-th baseline.

Activity
wisp3rwind commentedon Nov 28, 2024
As a workaround, I'm now putting content with
#text("The cell content", top-edge: "ascender")(for the first line of the cell only, otherwise, line spacing is affected) in my tables. By forcing identical line height in all columns, this makes baselines align for top-aligned table cells. However, it's a huge manual mess and it might also effectively increase padding at the top if lines are not actually that high. It'd be great if proper baseline alignment could be prioritized.