-
Notifications
You must be signed in to change notification settings - Fork 719
[css-inline-3] Tight vs loose fit into a line box #5239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I went back and looked at the case of an ordinary superscript in text. Even with Yellow = ascent/descent bounds for superscript Cap height and ex height are shown in red in the diagram (info is from Adobe Caslon Pro). |
The CSS Working Group just discussed The full IRC log of that discussion |
I was playing around to figure out which properties on the superscript element could currently be used to allow a superscript/subscript to extend outside the line box. Negative Just in case anyone is looking for a workaround until we come up with a proper solution… |
...
We've had a go at implementing I've put an example at https://jsbin.com/lecudab/edit?html,output. The way this renders with I chose As suggested, I then put a negative margin on the super/subscript - it feels a little awkward as I must also set sub {
text-edge: ex;
margin-bottom: -1em
} This made no difference: the margin is applied to the Even assuming it does apply, I'd chosen an arbitrary "-1em" to try and ensure the margin disappears above the main alphabetic baseline, but with But where even the "ex" baseline is outside the default bounds of the line-box (say for very large baseline-shifts, or nested super/subscripts) I'd have to further adjust both the top and bottom margins to ensure they're still within the default bounds of the line box and prevent them from changing the rhythm. It's starting to get very complicated at this point and not at all intuitive. If all I want is to preserve line rhythm at all costs and in all cases, a value like |
In today's discussion about how to decide whether content fits, we talked a bit about the models we use for fit. Mostly we focused on the question of “what do we consider to be the size of the inline” when deciding whether it fits, but the other question is what do we consider to be the “container” representing the line box?
Currently we have two models for the height of container:
For an illustration of this, see slide 52 here.
The idea for sizing a line box is, if an item sticks outside of that bounds, it doesn't fit, and we increase the size of the line box to make it fit.
In general, CSS uses model A. This guarantees that there will be no overflow, no overlap of content unless the author specifically indicated the desire for that effect through negative margins or negative leading.
However, for ruby annotations, we use model B. This is a bit risky, but as long as the text is fairly consistently sized and there is only ruby on one side (and the start of the block has enough margin or padding), it works. We increase the height of the line if the author didn't provide sufficient line gaps (which is advantageous in certain typographic environments) but when they do, the ruby fits within that gap.
The question came up, if the effects of slicing down the size of ascent/descent inline down to internal metrics isn't sufficient to get the desired typographical fits, we might consider a more general switch for model B.
I guess the open question is, do we want that, and if so, what does that look like syntactically-speaking?
The text was updated successfully, but these errors were encountered: