Skip to content
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

[css-text-3] The spec should provide guidance about interop issues related to ink overflow from text #10066

Open
szager-chromium opened this issue Mar 12, 2024 · 5 comments

Comments

@szager-chromium
Copy link
Contributor

This is an offshoot from #8649. In cases where the extent of ink overflow can't be pre-determined or programmatically measured (primarily text and text decorations), we should offer non-conforming guidance to authors about interoperability issues and provide best practices for minimizing them.

This would be generally useful information, and would be specifically relevant to the same issues mentioned in #8649.

@jfkthame
Copy link
Contributor

jfkthame commented May 1, 2024

I think there's some confusion here regarding the term hanging glyph. In CSS Text 3, 8.2. Hanging Glyphs is discussing the convention of allowing certain characters to protrude or "hang" into the margin of the text block, so that their normal typographic advance is ignored (or placed outside the typographic bounds of the line). This is a deliberate typographic effect that involves adjusting the glyph's position from its "natural" place in the line.

The example of an italicized f

  <div class="figure" style="margin:0; font-size:10rem; font-family:garamond; font-style:italic">
    <span style="display:inline-block; width:1ch; height:1lh; background:green; opacity:0.5"></span><span style="vertical-align: top;">f</span><span style="display:inline-block; width:1ch; height:1lh; background:green; opacity:0.5"></span>
  </div>

mentioned in #9842 (comment) is of a different nature. This glyph does not "hang" because it has been moved into the margin of the text block; it remains at its default inline position, occupying its normal space in the line. It has "hanging" ink because the actual glyph outline extends beyond its origin and advance (i.e. it has negative sidebearings). If it happens to occur at the beginning or end of a line, it will contribute ink overflow to the line because its negative sidebearings project into the margins, yet it is not a "hanging glyph" in the sense of CSS Text 3.

Such ink overflow can of course occur in the block as well as inline directions; an extreme example being "zalgo" text, where diacritics (that in themselves might not have any ink overflow) are stacked such that they render far beyond the typographic bounds of the line.

These glyph-level forms of ink overflow are conceptually quite distinct from the character-level ink overflow that CSS Text 3's hanging glyphs create, and the two cases should be addressed separately.

@chrishtr
Copy link
Contributor

chrishtr commented May 1, 2024

These glyph-level forms of ink overflow are conceptually quite distinct from the character-level ink overflow that CSS Text 3's hanging glyphs create, and the two cases should be addressed separately.

I agree they are different. Are you just saying the two cases need separate spec text to account for them specially in defining the extent of ink overflow?

(Also, both contribute to ink overflow--do you agree?)

@jfkthame
Copy link
Contributor

jfkthame commented May 1, 2024

These glyph-level forms of ink overflow are conceptually quite distinct from the character-level ink overflow that CSS Text 3's hanging glyphs create, and the two cases should be addressed separately.

I agree they are different. Are you just saying the two cases need separate spec text to account for them specially in defining the extent of ink overflow?

Yes, to the extent that the spec aims to define/explain ink overflow, the two cases should be described separately; in particular, the current PR #9842 seems to use the italic-f example as though it were related to what CSS Text 3 calls "hanging glyphs", which I think is confusing.

(Also, both contribute to ink overflow--do you agree?)

They do, though because of the different levels at which they operate, it's conceivable they might be handled differently by an implementation.

@szager-chromium
Copy link
Contributor Author

@jfkthame As I'm sure is apparent, I am a novice when it comes to the details of text rendering. After reading the relevant specs, I understand the distinction you make between hanging glyphs and a glyph with a hanging outline. However, I can't seem to find an example or demonstration of a hanging glyph as described in the spec. hanging-punctuation has virtually no browser support, and text-indent does not generate ink overflow. Is there some other source of ink overflow from hanging glyphs that I am missing?

@szager-chromium
Copy link
Contributor Author

@jfkthame I've updated the PR to correct the references to "hanging glyphs", and also based on the discussion in #8649.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants