Implementing a new type of ruby text alignment in Writer

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


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
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
from top to bottom, no matter whether the direction of base text is
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

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


Best Regards.

Mark Hung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list