Re: [css3-text-layout] New editor's draft - margin-before/after/start/end etc.

Håkon Wium Lie wrote:

> In general, I do not believe one can simply switch writing direction
> and reuse the same style sheet; there are more properties that
> should be adjusted when the writing direction is changed. As such, I
> believe your :rtl, :lrt, :ttb proposal has the potential for
> producing better typography as you can add more declarations.

Well said.

Can someone summarize what the advantages of the proposed
margin-start, etc. properties are for internationalized text?  Is the
idea simply that one can flip the writing-mode or direction and
margins "just work"?

      body { margin-start: 3%; } /* works for either LTR or RTL text */

Doesn't this assume that the stylization is naturally symmetric?  In
other words, that the layout of English text has a certain aesthetic
balance that is *precisely* mirrored when laying out Arabic for
example?  I don't have a deep knowledge of Arabic but I'm somewhat
skeptical, the cursive nature of Arabic seems to suggest that the
balance of lines of text with margins is going to need to be tweaked
for the Arabic case.  In which case, this syntactic sugar buys the
author very little.

I see a similar problem with the vertical layout of Japanese text, I
don't think vertical text is typically laid out symmetrically to the
way horizontal text is laid out.  A top margin for horizontal layout
is not necessarily going to be the correct right margin for vertical

Additionally, I think many stylizations within vertical text are
unique to vertical text and don't make sense for horizontal text. For
example, consider the description of tate-chu-yoko in section 4.4 of
the draft CSS3 Text Layout spec:

    "In East Asian documents, it is often preferred to
     display certain Latin-based strings, such as
     numerals in a year, always in a horizontal layout
     orientation regardless of the flow orientation of
     the line of text these strings appear in..."
The example uses the 'block-flow' property to implement horizontal display of
the string 1996 in vertical text.

  .date {block-flow: tb;}
  <span class="date">1996</span>
The problem here is that this is presented as a layout style when it's
generally really a font style and the styles are in some cases unique
to vertical layout contexts.  The particular example is relatively
unusual, tate-chu-yoko styling is more frequently used for two
numerals in sequence, such as the day of the month, and half-width
glyphs are used so that the two numbers fit nicely within the space of
a single Kanji character.  Japanese fonts typically have full-width
glyphs for Latin letters and numerals that match the width of Kanji
characters, along with additional half-width glyph versions.  

Three numerals in sequence can either be displayed with third-width
glyphs, such that the three numerals fit within the space of a single
Kanji character, or they can use half-width forms that appear centered
as in the example above.  OpenType includes support for full-width,
half-width, third-width, and quarter-width variations.  Allowing for
these vertical-specific styles requires something more than just
switching the block-flow property.  Lots of interesting questions
about what should be automatic and how to deal with
full-width/half-width codepoint issues (weeee...).

I think I agree with Håkon, the :rtl, :lrt, :ttb proposal seems better
suited to language-sensitive design.  With these an author could
specify the exact desired styling for tate-chu-yoko numbers without
affecting horizontal display.

For supporting Japanese layouts with a mixture of horizontal and
vertical text, I think it would be more interesting to consider a
better grid model and how to do "multi-column" vertical layout
rather than convoluting the box model.

I would also note that vertical layout has been presented as a "CJK
requirement" but my understanding is that modern Korean text is almost
always laid out horizontally, vertical layout of Korean is generally
restricted to situations like signage.  The work of the Japanese
Language Task Force has provided an absolutely fantastic document for
understanding the complexities of Japanese text layout [1].  But I
don't think we have an equivalent resource for Chinese, my guess is
that upon closer examination there will be additional requirements for
commonly used stylizations unique to Chinese vertical text. 

John Daggett
Mozilla Japan

[1] Requirements for Japanese Text Layout

Received on Friday, 4 June 2010 03:08:12 UTC