w3c / ttml2

Timed Text Markup Language 2 (TTML2)
https://w3c.github.io/ttml2/
Other
41 stars 16 forks source link

<emphasis-position> vs CSS text-emphasis-position + Mongolian #240

Closed palemieux closed 7 years ago

palemieux commented 7 years ago

TTML2 uses 'before' and 'after' whereas CSS text-emphasis-position already defines 'over' and 'under'. According to the discussion at https://lists.w3.org/Archives/Public/www-style/2017Feb/0030.html , the CSS approach is preferable since "before" side and the "over" side do not coincide in Mongolian writing.

Two issues:

skynavga commented 7 years ago

Please indicate which mode of writing you are discussion w.r.t. use of the Mongolian script. Are you speaking about entire vertical lines of Mongolian in a vertical writing mode, or are you referring to fragments of vertical lines in Mongolian embedded in horizontal lines in a horizontal writing mode?

In addition, could you provide examples of use of text emphasis with Mongolian script in both of the modes indicated above?

Finally, can you point at any browsers that currently support Mongolian script in either of the above modes?

As for before/after, these keywords have a well defined meaning in both XSL-FO and TTML2 with respect to text emphasis. The before edge of a line area is the first edge encountered when moving along a line parallel to the block progression dimension that intersects the line area, while the after edge is the second edge encountered. This definition holds irrespective of the script, and is only related to the writing mode. Further, this definition is not affected by text orientation. For example, regardless of whether a character is set in upright or sideways orientation, a before text emphasis mark, appears on the right side of a vertical line in tbrl mode, and appears on the left side of a vertical line in tblr mode.

I see no barrier to mapping these semantics to appropriate CSS keywords.

The current TTML2 approach is consistent with use of the before/after keywords in both XSL-FO and existing TTML1 and TTML2 usage.

If you can find something technically incorrect about the use of before/after, then we can consider changes as needed, but I'm not aware of any. It is also worth noting that the Mongolian language is still primarily written using the Cyrillic script in the modern era. However, you may wish to check among Mongolian as well as mainland Chinese subtitle agencies about their actual practices w.r.t. Mongolian script. Absent of definite input from such sources, I would be reluctant to make any change unless a real technical issue can be demonstrated.

P.S. Although I'm not an expert on Mongolian writing, I've studied it very carefully and closely read a number of monographs on this subject, and based on my understanding, I don't see any problem. But I'm open to new input.

skynavga commented 7 years ago

I'm closing this since no technical problem has been articulated, and as far as I know, there is none. If an actual technical issue is discovered, then this can be reopened.

palemieux commented 7 years ago

I am reopening pending my in-depth study of the mapping of the TTML feature to the CSS feature, including of the keyword "outside", and potential fallback approaches.

skynavga commented 7 years ago

If a technical issue can't be articulated by the end of month, I will re-close this. Note that a one-to-one mapping to HTML/CSS features is not a requirement for TTML2.

Regarding fallback mechanisms, we already have one in use, namely, to designate profile features that cover a subset of semantics. For example, we have #textOutline, #textOutline-blurred, and #textOutline-unblurred. We can define similar subsets for other features, such as #textEmphasis-no-outside, etc., to allow interoperation with implementations that support a semantic subset.

palemieux commented 7 years ago

Note that a one-to-one mapping to HTML/CSS features is not a requirement for TTML2.

It is to the extent that the objective is for IMSC2 to be a subset of TTML2, and that textEmphasis has been identified as a desirable feature for IMSC2.

We can define similar subsets for other features, such as #textEmphasis-no-outside, etc., to allow interoperation with implementations that support a semantic subset.

That is one option. Another option could be to specify that "outside" is equal to "before" if "outside" is not supported.

skynavga commented 7 years ago

Note that a one-to-one mapping to HTML/CSS features is not a requirement for TTML2.

It is to the extent that the objective is for IMSC2 to be a subset of TTML2, and that textEmphasis has been identified as a desirable feature for IMSC2.

IMSC1 does not state that such a mapping is a requirement, so unless it is articulated in a yet to be drafted IMSC2, IMSC2 also does not have such a requirement.

We can define similar subsets for other features, such as #textEmphasis-no-outside, etc., to allow interoperation with implementations that support a semantic subset.

That is one option. Another option could be to specify that "outside" is equal to "before" if "outside" is not supported.

Agreed. There is already language about using auto as the fallback, but since that is defined in terms of outside, then more language may be added to have before be the fallback for outside.

palemieux commented 7 years ago

@skynavga I had the opportunity to dig some more into the differences between over/under and before/after.

Per CSS Writing Modes 3, over/under are defined based on the ascender/descender of the line (instead of the block progression direction):

Is the acender side in vertical writing always to the right? This is what figure 15 in CSS Writing Modes 3 suggests.

skynavga commented 7 years ago

On Thu, Mar 2, 2017 at 12:18 AM, Pierre-Anthony Lemieux < notifications@github.com> wrote:

@skynavga https://github.com/skynavga I had the opportunity to dig some more into the differences between over/under and before/after.

Per CSS Writing Modes 3 https://www.w3.org/TR/css-writing-modes-3/#line-orientation, over/under are defined based on the ascender/descender of the line (instead of the block progression direction):

  • under: nominally the side that corresponds to the ascender side or “top” side of a line box
  • over: the line-relative “bottom” or descender side

Is the acender side in vertical writing always to the right? This is what figure 15 in CSS Writing Modes 3 suggests.

Firstly, in vertical writing with upright orientation, i.e., the typical case for CJK, then the ascender of the upright glyphs is towards the top of the screen, and not right or left. While the descender of upright glyphs is towards the bottom of the screen. Actually, the notion of ascender/descender doesn't make much sense in CJK, except when European scripts are mixed in with CJK.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-283576116, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCb4qcywsfzyWo2DlUGis8MavBDiYJks5rhm1IgaJpZM4L287q .

palemieux commented 7 years ago

Ok. That was my take as well. I think we can close this for now.

r12a commented 7 years ago

Not so fast. I agree with the original problem statement.

CSS writing modes 4 makes a distinction between before and over/line-over in the case of vertical-lr, such that the over means on the right of a vertical line (which happens to be where the ascenders for Latin text usually appear in vertical Mongolian writing), (and under for vertical-lr means to the left, as opposed to after).

If you still want examples of browsers that support traditional mongolian text in vertical writing mode see the notes in the right column at http://w3c.github.io/i18n-drafts/articles/vertical-text.en#writing-mode (Basically all major browsers do, though Safari has a bug that affects the orientation of the mongolian characters.)

There is a related issue at https://github.com/w3c/ttml2/issues/254 for the default position of ruby. See an example of ruby with vertical text provided by a mongolian expert at https://github.com/w3c/type-samples/issues/5

I don't have an example of text emphasis in Traditional Mongolian script to hand, but i can ask the Mongolian experts to provide examples if you need.

kojiishi commented 7 years ago

I agree with @r12a.

The ascender of the upright glyphs being the top is true when the font does not have proper vertical metrics and thus the rendering engine synthesizes upright glyphs by rotating them, but not the case for the real vertical metrics. OpenType for instance defines the ascender on right and the descender on left in their vertical metrics for upright glyphs. I know this looks strange though.

palemieux commented 7 years ago

CSS writing modes 4 makes a distinction between before and over/line-over in the case of vertical-lr, such that the over means on the right of a vertical line (which happens to be where the ascenders for Latin text usually appear in vertical Mongolian writing), (and under for vertical-lr means to the left, as opposed to after).

@r12a Do you mean the table at Section 6.4? If so, I think there are inconsistencies between:

Assuming the table at Section 6.4 is correct, then isn't there a one-to-one mapping between over/under and before/after, independently of the font metrics:

CSS Value horizontal-tb vertical-rl, sideways-rl vertical-lr sideways-lr
over ttml.before ttml.before ttml.after ttml.before
under ttml.after ttml.after ttml.before ttml.after
r12a commented 7 years ago

@palemieux I don't really understand why you think there's an inconsistency. Over is the same as top for horizontally set text. It is the 'ascender' side, ie. the right, for normal vertically set text in Mongolian as well as CJK.

I don't understand your point about one-to-one mapping either, especially since your table doesn't show a 1-1 mapping.

The problem is that http://w3c.github.io/ttml2/spec/ttml2.html#style-value-emphasis-position says that if you use 'before' in TTML to indicate the position of text-emphasis in TTML:

If a vertical writing mode applies, then this is either towards the right or left of the glyph areas, according to whether tts:writingMode resolves to tbrl or tblr, respectively.

whereas actually, in normal vertical text it should only appear to the right. We want the before value to mean above the line for Mongolian text when it is set horizontally, but to the right of the line, not the left, when it is set vertically.

palemieux commented 7 years ago

We want the before value to mean above the line for Mongolian text when it is set horizontally, but to the right of the line, not the left, when it is set vertically.

For mongolian text,

I do not see a major difference... or is the idea that text-emphasis-position: over is not necessary because the default value of text-emphasis-position is over? In other words, are you arguing that the default value should be different in TTML?

I don't really understand why you think there's an inconsistency.

Oh. I was referring to the fact that the definition of over refers to the “top” side of a line box, which does not correspond to the green "top" shown in the figure underneath. Moreover, the table states that over means right if writing-mode: vertical-lr, and makes no reference to either ascender side or the “top” side of a line box.

I have assumed that the table is the ultimate normative text. Let me know if I have it wrong.

especially since your table doesn't show a 1-1 mapping.

For every combination of CSS writing-mode, direction and text-emphasis-position, only ever one of TTML 'before' or 'after' applies, right?

r12a commented 7 years ago

In other words, are you arguing that the default value should be different in TTML?

Yes.

The default value for CSS text-emphasis-position is actually over right. This means that, whether the writing-mode is set to vertical-lr or vertical-rl, emphasis marks appear by default to the right of the vertical line (which is what you'd expect).

As i understand it, TTML2 says that for tblr the default is to put text emphasis marks, overlines, ruby, etc. on the left. Which means that EVERY time someone creates any content in Mongolian, or related languages using the traditional script, they have to add a style property in TTML to override the default. Imagine how annoying that would be if you had to do it every time you wanted to write something in English, especially if it were possible for the spec to simply fix the default so that it doesn't do such wierd things.

So i'm saying, let's define the default behaviour in TTML2 so that these things automatically end up on the right-hand side of these vertical text lines, whether the line progression direction is ltr or rtl.

Is that any clearer?

palemieux commented 7 years ago

Is that any clearer?

Completely! Thanks for clarifying.

Do you agree that there is otherwise an unambiguous mapping between the TTML and CSS emphasis position values?

skynavga commented 7 years ago

On Wed, Mar 15, 2017 at 9:26 AM, r12a notifications@github.com wrote:

In other words, are you arguing that the default value should be different in TTML?

Yes.

The default value for CSS text-emphasis-position is actually over right. This means that, whether the writing-mode is set to vertical-lr or vertical-rl, emphasis marks appear by default to the right of the vertical line (which is what you'd expect).

As i understand it, TTML2 says that for tblr the default is to put text emphasis marks, overlines, ruby, etc. on the left. Which means that EVERY time someone creates any content in Mongolian, or related languages using the traditional script, they have to add a style property in TTML to override the default. Imagine how annoying that would be if you had to do it every time you wanted to write something in English, especially if it were possible for the spec to simply fix the default so that it doesn't do such wierd things.

So i'm saying, let's define the default behaviour in TTML2 so that these things automatically end up on the right-hand side of these vertical text lines, whether the line progression direction is ltr or rtl.

The problem is that vertical left to right lines is much more common in Chinese than Mongolian is. We need to pick a default, and the default works well with Chinese.

If an author of Mongolian text wants to reset the default, then that is easily accommodated in TTML2, which, unlike CSS, has a mechanism to redefine the default initial value; namely,

If we changed the default initial value in the spec as you suggest, then it complicates the semantics of text emphasis, and would then requires authors of Chinese to specify

In conclusion, I disagree that it is inconvenient for authors of Mongolian to add a single element to change the behavior, and I assert that it is much more common to find Chinese tblr than Mongolian tblr.

Is that any clearer?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-286777684, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCb-6SnK2IrZXci63NtnrIPI8hDqssks5rmAMrgaJpZM4L287q .

r12a commented 7 years ago

@skynavga Leaving aside the <initial/> element for now, i want to make sure that i understand what you're saying about the direction of text.

I assert that it is much more common to find Chinese tblr than Mongolian tblr.

When you say tblr i believe you mean vertical lines of text where one starts reading in the top left corner. Is that correct? If so, i don't think i can recall ever seeing modern Chinese text in that configuration. It's usually tbrl, ie. start reading at the top right, and progress leftwards across the page.

Mongolian traditional script, on the other hand, is primarily set vertically, and then the lines are read starting in the top left, ie. tblr.

Or did you mean that it's more common for text decoration to appear on the left side of lines in Chinese than in, say, Japanese?

Or did you mean to say it's much more common to find Chinese tbrl than Mongolian tblr?

skynavga commented 7 years ago

On Wed, Mar 15, 2017 at 1:48 PM, r12a notifications@github.com wrote:

@skynavga https://github.com/skynavga Leaving aside the element for now, i want to make sure that i understand what you're saying about the direction of text.

I assert that it is much more common to find Chinese tblr than Mongolian tblr.

When you say tblr i believe you mean vertical lines of text where one starts reading in the top left corner.

Yes.

Is that correct? If so, i don't think i can recall ever seeing modern Chinese text in that configuration.

I see this all the time in Hong Kong and Taiwan. It is less common in Beijing. Usually when one finds tblr on a page (or sign) you will also find tbrl on the same page (or sign).

It's usually tbrl, ie. start reading at the top right, and progress leftwards across the page.

In this case, it is as I say, tblr, reading vertical progressing rightwards.

Mongolian traditional script, on the other hand, is primarily set vertically, and then the lines are read starting in the top left, ie. tblr.

I've seen many manuscripts going the other way, tbrl, that unroll to the left. While tblr are for manuscripts unrolling to the right.

Or did you mean that it's more common for text decoration to appear on the left side of lines in Chinese than in, say, Japanese?

No, see above.

Or did you mean to say it's much more common to find Chinese tbrl than Mongolian tblr?

No, I mean it is much more common to find Chinese tblr than Mongolian tblr, at least in my experience.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-286857970, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCb9zM8ikt8oPUNahtdSkEz-swnZBcks5rmECGgaJpZM4L287q .

r12a commented 7 years ago

Are you arguing that ruby, text emphasis marks, overline, etc should by default appear on the left side of the vertical lines in Chinese that proceed from left to right?

[updated to change 'underline' to 'overline']

skynavga commented 7 years ago

yes; however, I am open to reconsideration of there is a preponderance of evidence to the contrary

On Thu, Mar 16, 2017 at 11:56 AM, r12a notifications@github.com wrote:

Are you arguing that ruby, text emphasis marks, underline, etc should by default appear on the left side of the vertical lines in Chinese that proceed from left to right?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-287140442, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCb16OKkQCXYUMTW6yuZ_0RvSrbhT3ks5rmXezgaJpZM4L287q .

r12a commented 7 years ago

I pinged two chairs of the Chinese layout requirements task force (who are both originally from Taiwan). They both confirmed that you can see vertical chinese text with lines that run left to right, but added the following comments:

[@ethantw] But wherever you see a left-to-right vertical alignment typesetting layout in Chinese (no matter in China, HK or Taiwan), it’d be considered a wrong approach. It’s become only common for the past few decades since everyone’s writing everything on their computers. It’s better we correct such thing rather than go with the flow, especially it all started with desktop typesetting.

and

[@bobbytung] I agree with Ethan that lots of graphic designers do not know the layout rule. It happens in poster and graphic works, but never for books.

This confirms to me my view that a default for tblr text that is based on Chinese text would be inappropriate, and that if someone wants to produce tblr layout for Chinese it would be perfectly normal to treat it as an exceptional case rather than the rule. On the other hand, Mongolian and other languages using the traditional script are clearly a primary use case for tblr, since this is not just an option for them, it's the way the script works, and i therefore believe that it is appropriate and correct to define the tblr defaults for that and related scripts.

As to your concern @skynavga that you have seen more tbrl Chinese than Mongolian, i guess i'd reply that, based on your comments near the start of this thread, i may have seen a lot more Mongolian than you. But furthermore, i've seen the Mongolian's struggling a great deal to get applications to provide adequate support for their script, and that is currently holding them back a good deal.

I wll now ask the chinese experts to confirm whether ruby, overline, and text emphasis marks appear to the left or right of the vertical line when Chinese runs tblr.

skynavga commented 7 years ago

OK, however, as Yijun says, this (tblr) is now a common practice; further, I believe it is incorrect to simply say that that practice should not exist, so we will ignore it

as I've pointed out previously, some default initial value must be chosen, and TTML provides a way to change that default initial value; so it would be incorrect to infer that TTML does not support Mongolian usage patterns, as it would also be incorrect to say that TTML imposes any sort of significant burden on authors of Mongolian content by giving preference to a default based on Chinese practice;

I believe we have sufficient input now for the WG to make a decision.

On Mon, Mar 20, 2017 at 4:14 AM, r12a notifications@github.com wrote:

I pinged two chairs of the Chinese layout requirements task force (who are both originally from Taiwan). They both confirmed that you can see vertical chinese text with lines that run left to right, but added the following comments:

[Yijun Chen] But wherever you see a left-to-right vertical alignment typesetting layout in Chinese (no matter in China, HK or Taiwan), it’d be considered a wrong approach. It’s become only common for the past few decades since everyone’s writing everything on their computers. It’s better we correct such thing rather than go with the flow, especially it all started with desktop typesetting.

and

[Bobby Tung] I agree with Ethan that lots of graphic designers do not know the layout rule. It happens in poster and graphic works, but never for books.

This confirms to me my view that a default for tblr text that is based on Chinese text would be inappropriate, and that if someone wants to produce tblr layout for Chinese it would be perfectly normal to treat it as an exceptional case rather than the rule. On the other hand, Mongolian and other languages using the traditional script are clearly a primary use case for tblr, since this is not just an option for them, it's the way the script works, and i therefore believe that it is appropriate and correct to define the tblr defaults for that and related scripts.

As to your concern @skynavga https://github.com/skynavga that you have seen more tbrl Chinese than Mongolian, i guess i'd reply that, based on your comments near the start of this thread, i've seen a lot more Mongolian than you. But furthermore, i've seen the Mongolian's struggling a great deal to get applications to provide adequate support for their script, and that is currently holding them back a good deal.

Wrt to the placement of text emphasis, the CSS spec says that it is common to see Chinese text emphasis on the 'under' side, which would be to the left in vertical text, but

I wll now ask the chinese experts to confirm whether ruby, overline, and text emphasis marks appear to the left or right of the vertical line when Chinese runs rblr.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-287719436, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCbw0BBpSoD3zvmFUd0NhuNZpiIhceks5rnlGXgaJpZM4L287q .

r12a commented 7 years ago

I believe we have sufficient input now for the WG to make a decision.

Actually, i'm not sure you do. The main question here is where things should appear relative to the vertical line, be it Chinese or Mongolian text, when writing mode is set to tblr. It's not clear to me that ruby and underlines in either case would appear on the side indicated by before and after. I will ask the Chinese folks for advice.

badaa commented 7 years ago

I totally agree with r12a. tblr (top to bottom left to right) is default behaviour of Mongolian not Chinese. @skynavga Are you sure, that you have not switched tblr to tbrl?

skynavga commented 7 years ago

On Mon, Mar 20, 2017 at 11:41 AM, Badral notifications@github.com wrote:

I totally agree with r12a. tblr (top to bottom left to right) is default behaviour of Mongolian not Chinese. @skynavga https://github.com/skynavga Are you sure, that you have not switched tblr to tbrl?

You misunderstand the discussion. We are not discussing the default writing mode to use with Mongolian vs Chinese. The default writing mode in TTML is always lrtb, and if a different mode is required, the author must specify it. If a vertical writing mode is desired, then the author would explicitly specify either tblr or tbrl as they desire.

What we are discussing is the default initial value of the emphasis position for use with the tts:textEmphasis style property, which is defined as "auto", and which is interpreted as "outside" if there are exactly two line areas, otherwise, as "before", where before means the first edge of a line area intersecting with a vector whose direction is the block progression direction, i.e., before means right (by default) when block progress direction is right to left, and it means left (by default) when block progression direction is left to right.

This is a very simple, easily understood model, and serves well as a default for all vertical text usage except when using Mongolian in tblr mode, in which case, an author can easily change the default by adding a single element:

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-287839502, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCb2bbx1ATaWhLcM_L_OOFIxrbBVb2ks5rnrpVgaJpZM4L287q .

skynavga commented 7 years ago

Please note that we are discussing tts:textEmhasis positioning here, and not tts:rubyPosition or tts:textDecoration.

On Mon, Mar 20, 2017 at 11:06 AM, r12a notifications@github.com wrote:

I believe we have sufficient input now for the WG to make a decision.

Actually, i'm not sure you do. The main question here is where things should appear relative to the vertical line, be it Chinese or Mongolian text, when writing mode is set to tblr. It's not clear to me that ruby and underlines in either case would appear on the side indicated by before and after. I will ask the Chinese folks for advice.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/240#issuecomment-287827947, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXCbyvZ-WdZq06_kuffbp9dWKIN5NX_ks5rnrIZgaJpZM4L287q .

r12a commented 7 years ago

Please note that we are discussing tts:textEmhasis positioning here, and not tts:rubyPosition or tts:textDecoration.

Note, however, that https://github.com/w3c/ttml2/issues/254 defers a decision on ruby to this issue.

nigelmegitt commented 7 years ago

Scheduled for discussion 2017-03-23.

nigelmegitt commented 7 years ago

Meeting 2017-03-23: Agreed as a first step to add a Note indicating that where a different default value is preferred it can be set using the initial element in the head of the document, and that this could be useful for example when the majority writing mode is tblr.