w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.44k stars 657 forks source link

[css-text-decor] `text-decoration-skip: ink` should allow not to skip for CJK and certain ideographic scripts #707

Open kojiishi opened 7 years ago

kojiishi commented 7 years ago

Currently we're considering implementing text-decoration-skip: ink, and investigating what to do with CJK.

Implementing text-underline-position: auto to draw at under position for CJK is one way to solve this, and we're investigating this option.

The other option, we found WebKit does not skip ink for characters in CJK and Linear B ideogram blocks.

This might make sense since when font-size is small, no matter what we do, there may be overlaps.

On the other hand, some special fancy CJK fonts such as Kazuraki may want to skip ink.

I haven't come to the conclusion yet, but should the text-decoration-skip: ink allow not to skip for some scripts or under certain conditions? I mean I think it should, though I'm not clear how to define it properly yet.

Thoughts?

cc @litherum @fantasai @drott @masayuki-nakano @dbaron @upsuper @r12a

litherum commented 7 years ago

It should definitely be left up to the UA. The UA knows the environment where the page is being viewed (such as location) as well as any context the page has already provided (such as lang attribute).

If there are additional signals that web authors may want to declare to control skipping, the current syntax can be extended in the future. However, the default behavior should be to let the UA do the right thing.

upsuper commented 7 years ago

I have a slightly different but maybe related question: should text-decoration-skip: ink applied on decoration lines other than underline, namely overline and line-through?

kojiishi commented 7 years ago

@litherum than you, so something like "UA may decide not to skip for certain scripts such as ideographs or under condition where UA determines is appropriate not to skip. Future CSS may provide additional controls for such behavior if desired"?

@upsuper that's really a good question, I don't know the answer from top of my head. Probably worth an issue by itself?

upsuper commented 7 years ago

Filed #711.

yisibl commented 7 years ago

Yes, I think CJK does not want to skip ink in general.

At present, the realization of Blink is very strange: image

yisibl commented 7 years ago

For special CJK fonts(Kazuraki), I do not know whether the specification is not supposed to add a new attribute that allows the developer to define the behavior of the ink itself.

fantasai commented 7 years ago

This seems like more of a case for adjusting the position of the underline, which the UA is already allowed to do, than fixing the ink-skipping rules... If the underline is too close to the CJK glyphs, it already looks bad, even if we turn off skipping. Another thing that is under control of the UA is how much ink to skip: it looks like rather too much skipping in the screenshot.

Personally, I don't think there is anything to fix in the specs here. Blink just needs a better implementation of the existing spec.

kojiishi commented 7 years ago

>This seems like more of a case for adjusting the position of the underline

I think that's different topic.

fantasai commented 7 years ago

The UA can pull the underline below the em-box if necessary. There is no restriction on the position. Afaict it will look bad if it overlaps, whether or not ink is skipped, no?

In any case, if for some reason the underline is positioned to overlap (e.g. author sets text-underline-offset to create this overlap), then the ink-skipping, if specified, should be honored.

kojiishi commented 7 years ago

It's hard to explain in short, but position and skipping are two independent issues. Positioning can mitigate skipping ink issue by making the interceptions very rare though.

I think this discussion is very similar to the one about line-through #711; when author says "skip ink", should we skip ink regardless of how sane it is, or should we interpret "improve typography by skipping ink, but don't skip ink if insane."?

I think we prefer the latter, and let UA be smart enough to know when to skip and when not to.