-
Notifications
You must be signed in to change notification settings - Fork 707
[css-text] cursive shaping breaks needs better scoping #698
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
Are you arguing that shaping shouldn't, on principle, be applied across changes in font weight/style/size, or that because this is not implemented it should be considered a spec bug and not an implementation bug? We definitely should be maintaining shaping across font family changes, fwiw, simply because that's a font fallback issue. |
Trying to remember what i was thinking back then. Coming to it fresh, i also wonder why i suggested that changes in font weight/style/size should break the shaping. I'm now thinking that we should probably call out at least the more obvious things we believe should not break the shaping, to improve consistency across browsers. And i guess i'd include font weight/style/size in that list, as well as non-zero width borders and font-family. |
From https://drafts.csswg.org/css-text-3/#boundary-shaping
Although it's a good start, but the "if it is reasonable and possible for that case given the limitations of the font technology" part apparently makes it a matter of choice again and leaves a lot of room for inconsistency between implementations, and eventually, as a result of the inconsistencies, users not being able to rely on it. Regarding "joining context" of elements, has it been discussed to allow user to control it for Why I think explicit method is better than implicit is that there exist cases that the element can have a margin/border/padding and also a non- Here's an example of a drop caps being applied without proper joining context for either the first letter or the rest of the word: Example is from this discussion: https://groups.google.com/forum/#!topic/persian-computing/W-Upl6DAEcg |
I agree it would be good to call out property changes that MUST NOT break shaping. For the rest (font change), I like to still suggest the correct behavior, even if no implementation does it currently. FWIW, the layout-ng rewrite effort in Chrome is going to fix that. That has been one of the design goals. |
@behnam, just to be sure i'm clear, i think you saying that the paragraphs should start with rather than what is shown in your picture. Is that right? |
That's correct, @r12a. For both cases. |
Filed #2399 about drop-caps. Fwiw, the current text is the result of discussions in the thread at https://lists.w3.org/Archives/Public/www-style/2014Aug/0217.html which would be worth a read. I agree that there's no excuse to break Arabic joining in #2; I would find that unreasonable, and therefore a spec violation, but I suppose we can make it more explicit. :) |
Possible edits: add the following note
Open to suggestions/comments, but only from people who have read the thread linked above. ;) |
Here's an easier to read version of the thread mentioned by @fantasai |
Based on the classification in the thread @fantasai pointed to, here's a first proposal:
|
@r12a Font changes should all be handled as a single category, and same with margin/border/padding. |
The Working Group just discussed The full IRC log of that discussion<dael> Topic: cursive shaping breaks needs better scoping<dael> github: https://github.com//issues/698 <dael> Rossen: Who wants this? fantasai ? <dael> fantasai: This was from F2F. Not sure ther's anything to talk about. Trying to figure out what to put. There was a lot of pushback when first drew up text to not being specific enough. There's a lot about shaping like Arabic doesn't need a lot of assistance like more complex scripts <dael> fantasai: Issues is b/c there's a certain amount of shaping you can do across font changes. In terms of what edits need to be made brings in a q as to how to handle other aspects of glyph shaping. <dael> fantasai: I don't know enough about this to figure out the issue. There's a long thread. I'd appreciate help from someone who knows more about this topic. <dael> myles: I can take a look. I have some opinions but no proposal. I can come up with something for next call <dael> fantasai: That's all on this one. I need help. <dael> Rossen: I'll get our fonts people to look and comment and ideally we can resolve on github and put on agenda for resolution. |
… shaping across formatting changes. #698
i was unaware of the outline property (!). Ok then.
Sure, there are things that are more difficult, and content authors are not likely to try mark colouring, if it doesn't work for those, but it can still be useful in many situations. [text & image removed here, because it belonged in a different issue]
I begin to wonder what is the meaning of 'change in formatting' if first-letter styling doesn't result in any?? What would be the point in using first-letter unless it changed the formatting? Can you make that clearer? |
Using So, if you put |
Sure, i understand that, but the example you give is not a particularly useful thing to do. I suspect that much of the time one will apply first-letter in order to change the formatting (see the image at #698 (comment)). We have https://drafts.csswg.org/css-inline-3/#initial-letter-shaping saying that
But we have https://drafts.csswg.org/css-text/#boundary-shaping saying that
The two things seem to be contradictory, or at least to warrant some additional explanation. |
Well, yes. But we still have to define what happens in all cases. This is a Web Platform spec after all. :) Wrt Agenda+ to ask the WG if we should have margins/borders/padding not affect shaping in regular inlines, as Firefox now appears to do. @jfkthame Any opinions? testcase |
The WG decided several years ago that non-zero margins/borders/padding should interrupt shaping at inline boundaries; the fact that Firefox currently applies shaping across these is simply a Gecko bug and we should fix it. (I thought I had an experimental patch for this somewhere, even; maybe I can resurrect it.) |
IIUC, this was mostly about font-related properties (size, weight, etc); he then mentioned border as well:
but the hypothetical use-case suggested here would be better served by outline, IMO. I think the properties that introduce visual separation between the adjacent elements (so any of margin/border/padding at the relevant side) should indeed interrupt shaping, and I've seen sites where the current Firefox behavior of shaping across such gaps results in broken rendering. People do things like navigation or menu bars across a page:
and apply margins to the |
If the first letter is styled with a different font-size, font-family, etc it's entirely possible it won't actually connect to the next letter even when the appropriate contextual forms are used; I think that's what the emphasized sentence above is pointing out. Adding margin or border around the letter, OTOH, would be a cause for not shaping between the initial letter and following text. Raised caps are an interesting edge case, where I guess it's reasonable to maintain joining as the baseline isn't changed and no horizontal separation is being introduced (though it seems an unlikely thing for someone to really want to do in such a script). The few examples I've seen of traditional practice (see #698 (comment) and the linked discussion) don't appear to support shaping across more general drop-cap-like formatting: the large dropped, boxed initial in https://upload.wikimedia.org/wikipedia/commons/6/6a/Hafezeshamlu02.jpg, for example, is not shaped in an initial form. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: cursive shaping breaks needs better scoping<dael> github: https://github.com//issues/698#issuecomment-437944436 <dael> Rossen: Reopened a couple weeks ago. <dael> fantasai: This was an issue where Richard asked us to clarify or change where we have breaks across element boundries or not. I think he was asking for it to not break when there's a border. There's a span mid-word. Current spec requires if you have border, margin, or padding we don't shape across that boundry <dael> fantasai: Richard asked to have that changed. Asked Jonathan for his opinion and that FF does that is a problem. We're keeping current set of rules is that latest on the issue <dael> fantasai: Wanted to ask if there's anyting to add. If not I'll close editorial for clarifications, but no change <dael> Rossen: I support the no change. Change would be nontrivial and i'm not sure how it would impact web compat. <dael> Rossen: Objections? <dael> RESOLVED: Close issue #698 no change |
Closing out as a mix of Editorial and Wontfix per #698 (comment) and WG resolution supporting @jfkthame's position that margin/border/padding should break shaping across boundaries. Wrt #698 (comment) about shaping initial letters, re-opening #2399 and copying over @jfkthame's comment. @r12a If you want something changed here or would like to object to the resolution, please open a new issue. This one has turned into issue salad. |
Not correct. @jfkthame said earlier
(my emphasis) which is fine by me. I was only suggesting that zero m/b/p should not interrupt, but i think i'm fine breaking for any m/b/p – particularly now that i know that the outline property can be used for drawing around things. (see above) The i18n WG will keep our tracker issue open until we've seen the edited text. Btw, it would be nice if you could briefly summarise the conclusions reached (preferably before closing the issue), wrt the other aspects. PS: Please don't open another issue to continue this discussion. Apart from a small but mostly relevant digression into first-letter, i don't see any salad. The really useful thing about github issue threads is that you don't have to go chasing all over the place to find the discussion about a particular topic/request. |
Unfortunately, due to some historical decisions made back in the 90s, we can't distinguish between zero m/b/p and no m/b/p, so indeed zero m/b/p will not interrupt because it's the default case. :P
Heh. Here, I'll sort it into piles for you so you can see how many different issues have been raised in this thread: 1. font-weight / font-style / font-size changes should break shaping@r12a raised this request in the OP, but later retracted in #698 (comment) and confirmed in #698 (comment) 2. Borders should not break shaping@r12a raised this in the OP, reiterated in #698 (comment) and #698 (comment) 3. Spec should lock down when shaping occurs@behnam asserts the spec is too lenient in not requiring shaping in all cases where it would make sense in #698 (comment) 4. Allow explicit control over shaping isolation@behnam requests explicit control over shaping isolation in #698 (comment) 5. Initial letters should join to adjacent content@behnam raised this in #698 (comment) 6. Text decoration should not break shaping@r12a proposes that the spec explicitly say that text decoration not break shaping 7. Color changes within grapheme clustersSide discussion on color changes within clusters (for various definitions of clusters) starts in #698 (comment), continues in #698 (comment), and gets pushed out to #699 8. :first-letter should not break shaping(Note that :first-letter styling is not synonymous with initial letter formatting. :first-letter styling is the styling of an inline box (similar to a span) which is automatically generated around the first letter of a paragraph. Initial letter styling is a type of special formatting--effectively a different @r12a asserts that :first-letter should not break shaping in #698 (comment) Essentially this sub-issue is invalid. I suppose I can add a “Closed as Invalid” tag to the soup here. As we can see here, there are at least 8 separate sub-issues discussed in this issue. I think I'm thoroughly justified in calling it an issue salad. :) |
I guess it depends on the vantage-point of the reader. For me, those are all just facets of the discussion that addresses the original comment, where i was asking, essentially "what things should or shouldn't break cursive joining behaviour". It wasn't just about border. So the summary appears to be that which is currently stated in the spec as of https://www.w3.org/TR/2018/WD-css-text-3-20181206/#boundary-shaping. Good. |
And a salad is just a single dish, but the chef still has to prep each ingredient independently. ;) OK, then, closing out as Commenter Satisfied! Note: Initial letter discussion continues in #2399 Current status of that issue is that @behnam and @jfkthame are arguing for opposite behavior, so we're going to need some help sorting it out. :) |
8.3. Shaping Across Element Boundaries
https://drafts.csswg.org/css-text/#boundary-shaping
previous discussion on this topic can be found at:
http://www.w3.org/Mail/flatten/index?subject=Arabic+letters+connecting+between+elements+with+display%3A+inline&list=www-style
I think this is too broad. I created a set of tests for arabic script text at
https://w3c.github.io/i18n-tests/results/css-text-shaping (click on the link in the left column to see the test run)
The results show that no browser tested maintains the joining behaviour where font-weight and font-style and font-size are different. (Red appears because the spec currently implies that those shouldn't break the cursive shaping.) Those should probably be added to the list of styles that break the text shaping. Either that, or it may be simpler to list styling that should not break shaping.
Note also that a border doesn't break the joining behaviour in Firefox and Edge. This perhaps seems like reasonable behaviour for highlighting items, and i wonder whether we should drop that from the list of things that break shaping? I suppose the argument (as for margins and padding) is that this might have been a block element that has been added inline. It seems a pity, however, that such a possibility would rule out the ability to put a border around one character in a cursive sequence using inline markup when wanted.
The text was updated successfully, but these errors were encountered: