[ODFPlugtest] right-to-left writing styles etc

robert_weir at us.ibm.com robert_weir at us.ibm.com
Sun Nov 15 19:43:41 CET 2009


plugtest-bounces at opendocsociety.org wrote on 11/15/2009 01:01:17 PM:


> Now, reading the non-normative appendix F of the ODF 1.1 spec gives some 
clues
> 
> "Section 15.2.19 describes the style:writing-mode attribute for page
> styles. It may, among other values, take the the values lr-tb (left-
> to-right, top-to-bottom) and rl-tb (right-to-left, top-to-bottom). 
> The writing-mode attribute of a page style specifies the layout 
> direction of page columns (left-to-right or right-to-left) for pages
> that are formatted using the page style.
> 
> Section 15.5.36 describes the style:writing-mode attribute for 
> paragraph styles. It specifies the paragraph direction as defined in
> BD5 of [UAX9] for all paragraphs that have the paragraph style 
> assigned. For paragraphs that are contained in lists, it further 
> specifies whether the list numbers and bullets are displayed on the 
> left or on the right of the paragraph.
> 
> The writing mode attribute for paragraph styles takes the same 
> values as the writing mode attribute for page styles, but may also 
> take the value page. This value specifies that the paragraph 
> direction is inherited from the layout direction of the closest 
> layout object (section, table or text-box) in which the paragraph is
> contained, and which has a layout direction other than page. If the 
> paragraph is not contained in any of these layout objects, the 
> paragraph direction is inherited from the page on which the 
> paragraph appears."
> 
> 
> IIRC, the interop issue is basically that writing-mode isn't always 
> written, but
> based upon locale / language, which is all fine when everyone is working 
with
> the same application and/or settings, but fails when exchanging 
documents in
> our globalized world...
> 

But don't forget the Unicode Bidi Algorithm and the additional level of 
control permitted by embedded bidi control characters.

In any case I don't see a problem with assuming a default writing 
direction based on language.  It works in most cases.  In the cases where 
it does not work you might recommend that the authoring tool be explicit. 
But there would be little benefit to having LTR written out in English 
documents.

A couple use cases where you do not want text direction to be explicitly 
in the document.

1) Consider an language-independent ODF document template, where you do 
not know in advance what the direction direction will be for each of your 
pre-defined styles.  If you require the text direction to be explicit in 
ODF documents, then you could not have language-independent templates.

2) Also look at document translator. You see this with the Google and 
Altavista web page translators.  All the formatting remains intact while 
the text is translated.  If you did that with ODF and you explicitly wrote 
out the text direction, then this would break under automatic translation, 
say when translating a document from Arabic into English, unless you 
treated text direction as a special case.  But if you took a heuristic 
approach using Bidi algorithm and Appendix F, then the text direction 
automatically adapts based on the new language post translation. 

So the concept of a "default" text direction based on language is 
important.  However, we probably need more consistency in how apps apply 
these heuristics. 


> 
> So, I think it makes sense to
> 
> - *always* write out a value for the style:writing-mode on page 
> styles (even for
> Latin scripts)
> 

I disagree.  I think we need consistency.  But that doesn't mean we need 
to have it be explicit in the document itself. Defaults are useful and 
allow a document to adapt to different users.

> - assume a default value of "page" for paragraph styles
> 
> - make sure to write out the writing-mode when a paragraph is 
> created that uses
> a different writing-mode (so in this case, not only write out the 
> language, but also
> writing-mode)
> 
> - when reading an ODF document, only use a language value (fo:language) 
to
> guess the writing mode as a last resort
> 
> 
> Would this work, or am I missing something here ?
> 
> 

It comes down to author's intent.  If you expect translation, or expect 
your document to be a template, then the expectation is that text 
direction will need to adapt.  But you raise a fair point, and one that 
concerns defaults in general, not just Bidi.  And the point is that a good 
feature for applications to have is the ability to write out a document 
with all defaults made explicit, at the user's request.  Such a document 
will be less adaptable, but will be more likely to be interpreted in a 
single way.  So it is a tradeoff, and there are times when either approach 
is appropriate.  My preference in such cases is to give the user the 
option of either approach.

-Rob



More information about the Plugtest mailing list