- From: Valerij via GitHub <noreply@w3.org>
- Date: Wed, 22 Oct 2025 12:01:09 +0000
- To: public-css-archive@w3.org
@kannanwisen Okay, so you where asking for physical size and the line gap metric. My script already *illustrates* how to compute a "physical" value (132px) and covers line gap, in the sense that the gap metric is not relevant for your example, because you declared a `line-height` for parent and child, so this metric isn't used. If you would have kept the `line-height` `normal` for one or both elements, then the gap metric from the respective font would have been used instead of the value from the CSS declaration; it's as simple as that. E.g. modifying your example to not declare line-heights at all would make the line as tall as the "Edu" font needs it to be, according to its font metrics (or synthesized metrics, if there were none). Edu's AD is so big, that baseline offsets and metrics of Roboto probably wouldn't have an effect on the outcome (Just guessing from experience. Encouraging you to try yourself to gain an intuition). As for your last remark, that you find it counterintuitive that > This property specifies the box’s preferred line height does not mean that the preferred value is a definite one and therefore will not be enforced: Maybe an illustration would help? I mean, the illustration in 2.1 actually shows exactly that. The line with big text is itself taller than every other line:  Because verbally it already mentions that it's preference and not definition, and says that line boxes fit their inline/layout boxes and inline boxes are scaled according to the font-size (not the line-height) and use their own metrics (except for special cases for fallback fonts), including leading (unless line-height is not normal, and again some special cases, but yada yada yada). Still, from OP, I'm under the impression that you, or somebody, is or was confusing the terms `inline box`, `line box`, `first available font` and the semantics of the `line-height` property with whatever seams intuitive, instead of their actual definitions given in the spec. It is unclear whether this confusion has been resolved? I'm referring to this part of OP: > A common interpretation of the CSS specification, and a frequently cited rule, is that: > > > "Metrics from fonts other than the first available font only impact the layout bounds of an inline box with line-height: normal." > > However, this is not always the case. A secondary font on a line can also impact the layout bounds even when a specific, fixed line-height is used. -- GitHub Notification of comment by valler Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12764#issuecomment-3432019606 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 22 October 2025 12:01:10 UTC