Implementing a new type of ruby text alignment in Writer

Mark Hung marklh9 at gmail.com
Sat Feb 13 14:31:28 UTC 2016


Hi,

I had started to work on tdf#35301 to support aligning ruby text
vertically right to its base text. Despite  I've read OOo Writer core
documents, I still know too little to complete or justify my work.
I submitted my preliminary work[1] to ask for help. I also uploaded a
sample document[2] and a screenshot for how it looks[3] with my work.

Some background information if anyone feel interested:
In Taiwan, most people use Zhuyin symbols to mark the pronunciation of a
glyph.
Aligning ruby text to the top is valid but rarely used.
Most of people mark the symbols at the right side of each glyph, written
vertically
from top to bottom, no matter whether the direction of base text is
horizontal
or vertical[4].

Unlike OOXML that supports rightVertical[5], there isn't such type
of ruby text alignment in ODF yet. Storing it in odf document would be
another problem. I plan to handle layout issue first. In my work[1],
I change the behavior of aligning ruby text to the top, appending
the SwFieldPortion of the ruby text after the original SwRubyPortion
in BuildMultiPortion.

I got few questions:

a) With my work[2], the ruby text is shifted downward, doesn't match
    its shading area. How can I move it up?  I'm trying to
   change rInfo.Y() in SwFieldPortion::Pain() but it seems to be a const
   object.

b) When delete a portion with backspace, previous ruby text is deleted.
Cursor is placed between last ruby text and next glyph.
I know these situations have something to do with
SwTextFormatInfo::SetIdx(), and maybe SwTextFormatInfo::SeekAndChg(),
but how to do it properly?

c) My work reuse SwFieldPortion for ruby text, and append it in
BuildMultiPortion().
Does it break the semantic? Is it worthy to design a new kind of portion
for this?
Or should I change BuildMultiPortion and PaintMultiPortion?

d) What does the Rest of a SwTextFormatInfo mean?


The mail is quite lengthy. Thanks for anyone paying attention to this.


[1]https://gerrit.libreoffice.org/#/c/22343/1
[2]https://bugs.documentfoundation.org/attachment.cgi?id=122607
[3]http://imagebin.ca/v/2WoUQwMY8IQn
[4]https://www.w3.org/TR/clreq/#positioning_of_zhuyin
[5]http://www.datypic.com/sc/ooxml/t-w_ST_RubyAlign.html

Best Regards.

-- 
Mark Hung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160213/c67bd026/attachment.html>


More information about the LibreOffice mailing list