[ODFPlugtest] right-to-left writing styles etc

Hanssens Bart Bart.Hanssens at fedict.be
Sun Nov 15 19:01:17 CET 2009


Hi,


As we noticed during the plugfest, implementations have a bit of homework to
do with regards to handling r-to-l writing scripts etc.

Apparently some implementations use the language setting to determine the
writing style, but this can easily fail, since (for instance) Asian languages can
be written either top-bottom or left-right

http://en.wikipedia.org/wiki/Horizontal_and_vertical_writing_in_East_Asian_scripts

And even in Latin scripts, I might want to create a banner like this

B
a
n
n
e
r


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...


So, I think it makes sense to

- *always* write out a value for the style:writing-mode on page styles (even for
Latin scripts)

- 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 ?


Best regards,

Bart



More information about the Plugtest mailing list