You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-text-decor-3] behavior of text-decoration + text-emphasis #160
I think that the spec mentions behavior of text-emphasis + ruby (see below) but doesn't say behavior of combination of text-decoration and text-emphasis.
It's just FYI, but our EPUB viewer behaves like the attached file. We decided this after talking with Toppan printing people, so we believe this behavior might be sufficient for lots of printing situation.
Interaction between decoration lines and emphasis marks could be complex (mostly because decoration line is complex). Text could be vertical aligned to some other place, which could be very far from the decoration line, and the relative position of the text and decoration line could even be reversed. There could also be multiple decoration lines, and they could be much further from the text as well.
Those kinds of cases may not be as important as the main usecases, but I think they should still be considered when specing the behavior, so that they would at least have a reasonable result.
@realskk Could you provide more information about what rule are you using to archive that result? What would the behavior be for the cases I mentioned in the comment above?
@upsuper
In Blink, the underline is drawn in InlineTextBox. It means "CO" and "2" correspondingly in your example. We moved the drawing functionality to InlineFlowBox. Then the line is drawn over "CO2", as the attached file shows.
I wonder that the current editor's draft of 'text-underline-position' says in note that the line can be drawn line-through (as attached).
But in case of the example below, where the emphasis mark can be drawn? If the line is drawn on top of the line as spec describes and emphasis mark is drawn on top of the line as shown by me, then the emphasis mark can be put on the character "2".
That example is showing a bad result. :) The UA should ideally not do that, is what it's saying. Maybe I should make the example clearer...
Underline/overline should be between the text and the ruby/emphasis marks. It's a bit complicated as you note in cases with varying font size or vertical alignment. I think maybe we need to add something like “The position of ruby and of text-emphasis dots may be adjusted in order to avoid text decoration lines.”
@realskk Another question, is the position of emphasis marks affected by presence of decoration lines? I mean, in the CO2 example, if there is no overline, should the emphasis marks be placed differently?
OK, I checked in two sets of changes. First to clarify the note to address @realskk's confusion about the behavior in the note--you can see the new text and a new image in the editor's draft.
Second set of changes adds the following text to CSS Ruby and references it from the definition of text-emphasis-position:
The positions of ruby annotations may be adjusted to avoid conflicts with overline and underline decorations applied to the base text. In the basic case of consistent font size and baseline alignment, an underline or overline is to be positioned between the base level and any annotations on that side.
I'm open to additional suggestions/improvements, this is just a first pass. Let me know what you think.
Also, @realskk is it OK if I use your image in the spec?
Also, it seems to me that the variation in the emphasis marks' position and size in those examples is awkward, shall I open an issue on that for Text Decoration Level 4?
Note: @upsuper filed #1918 for discussion of further details in css-ruby. If everyone's OK with the current allowances, I would like to close this issue. For reference again, the added text is
CSS Ruby Level 1:
The positions of ruby annotations may be adjusted to avoid potential conflicts with overline and underline decorations applied to the base text. In the basic case of consistent font size and baseline alignment, an underline or overline is positioned between the base level and any annotations on that side.
CSS Text Decoration Level 3:
Emphasis marks are drawn exactly as if each character was assigned the mark as its ruby annotation text with the ruby position given by 'text-emphasis-position' and the ruby alignment as centered. Note that this position may be adjusted if it would conflict with underline or overline decorations.
I don't really think #1918 covers some of the issues (specifically that what happens when font size changes in the piece of text). #1918 was merely for that ruby can conflict with decoration lines even if all text has the same size and position.
The interaction between them with changed font size and vertical position feels more complicated.
I think I have a question to @realskk not answered that: is the position of emphasis marks affected by presence of decoration lines? I mean, in the CO2 example, if there is no overline, should the emphasis marks be placed differently?
It is not clear to me what the answer should be, and I think that would affect how the spec should work.
This question can apply to ruby as well. Is the position of ruby annotation of text which has different size / vertical position affected by decoration lines?
Activity
realskk commentedon Jun 2, 2016
It's just FYI, but our EPUB viewer behaves like the attached file. We decided this after talking with Toppan printing people, so we believe this behavior might be sufficient for lots of printing situation.
upsuper commentedon Jun 2, 2016
Interaction between decoration lines and emphasis marks could be complex (mostly because decoration line is complex). Text could be vertical aligned to some other place, which could be very far from the decoration line, and the relative position of the text and decoration line could even be reversed. There could also be multiple decoration lines, and they could be much further from the text as well.
Those kinds of cases may not be as important as the main usecases, but I think they should still be considered when specing the behavior, so that they would at least have a reasonable result.
upsuper commentedon Jun 7, 2016
@realskk Could you provide more information about what rule are you using to archive that result? What would the behavior be for the cases I mentioned in the comment above?
upsuper commentedon Jun 7, 2016
For example what behavior would be for this code?
realskk commentedon Jun 7, 2016
@upsuper
In Blink, the underline is drawn in InlineTextBox. It means "CO" and "2" correspondingly in your example. We moved the drawing functionality to InlineFlowBox. Then the line is drawn over "CO2", as the attached file shows.
Did I answer what you asked??
upsuper commentedon Jun 7, 2016
My question was, where should the emphasis marks be?
realskk commentedon Jun 7, 2016
Sorry, I missed the mark. (I forgot prefixing.) At least our implementation, the mark is drawn on top of underline.
realskk commentedon Jun 7, 2016
I wonder that the current editor's draft of 'text-underline-position' says in note that the line can be drawn line-through (as attached).
But in case of the example below, where the emphasis mark can be drawn? If the line is drawn on top of the line as spec describes and emphasis mark is drawn on top of the line as shown by me, then the emphasis mark can be put on the character "2".
CO2
fantasai commentedon Dec 27, 2016
That example is showing a bad result. :) The UA should ideally not do that, is what it's saying. Maybe I should make the example clearer...
Underline/overline should be between the text and the ruby/emphasis marks. It's a bit complicated as you note in cases with varying font size or vertical alignment. I think maybe we need to add something like “The position of ruby and of text-emphasis dots may be adjusted in order to avoid text decoration lines.”
upsuper commentedon Dec 27, 2016
@realskk Another question, is the position of emphasis marks affected by presence of decoration lines? I mean, in the CO2 example, if there is no overline, should the emphasis marks be placed differently?
[css-text-decor] Clarify note to avoid confusion such as <#160 (comment)
[css-text-decor][css-ruby] Allow UA to shift ruby/emphasis marks if t…
fantasai commentedon Dec 28, 2016
OK, I checked in two sets of changes. First to clarify the note to address @realskk's confusion about the behavior in the note--you can see the new text and a new image in the editor's draft.
Second set of changes adds the following text to CSS Ruby and references it from the definition of
text-emphasis-position:I'm open to additional suggestions/improvements, this is just a first pass. Let me know what you think.
Also, @realskk is it OK if I use your image in the spec?
Also, it seems to me that the variation in the emphasis marks' position and size in those examples is awkward, shall I open an issue on that for Text Decoration Level 4?
realskk commentedon Jan 12, 2017
(At F2F, I told to fantasai, that using image is OK, of course. Let me have more time for replying actually.)
fantasai commentedon Oct 19, 2017
Filed #1892 on maintaining size and position, which is also relevant to @upsuper's question.
Still need some feedback on whether the changes in #160 (comment) are enough or if there are further clarifications we'd like to make!
Redefine animation effect phases to reflect playback rate
fantasai commentedon Feb 10, 2018
Note: @upsuper filed #1918 for discussion of further details in css-ruby. If everyone's OK with the current allowances, I would like to close this issue. For reference again, the added text is
CSS Ruby Level 1:
CSS Text Decoration Level 3:
upsuper commentedon Feb 10, 2018
I don't really think #1918 covers some of the issues (specifically that what happens when font size changes in the piece of text). #1918 was merely for that ruby can conflict with decoration lines even if all text has the same size and position.
The interaction between them with changed font size and vertical position feels more complicated.
I think I have a question to @realskk not answered that: is the position of emphasis marks affected by presence of decoration lines? I mean, in the CO2 example, if there is no overline, should the emphasis marks be placed differently?
It is not clear to me what the answer should be, and I think that would affect how the spec should work.
upsuper commentedon Feb 10, 2018
This question can apply to ruby as well. Is the position of ruby annotation of text which has different size / vertical position affected by decoration lines?