Open BMagnu opened 7 months ago
Also, it would seem that you don't have to do the splitting, because it shouldn't occur. You just have to prevent the splitting of the base characters.
Yes, the ideal solution would be to push everything in the ruby block (which should be always the entirety of the InlineMaterial::Text
) into a single ParagraphElement::Text
. I wasn't entirely sure how the renderer deals with that though, in case that this element gets too wide for the remaining line, or in the worst case, wider than an entire line.
Is it sensible to have an if at the start of the InlineMaterial::Text
handler, and say that if it has ruby, then just ignore everything and push the entirety of the text as a ParagraphElement::Text
?
Edit: Testing it, this seems to work. If you agree that this is the way to do it, I'll push that change
Closes #283.
Properly handles
<ruby>
and underlying<rt>
tags. This is accomplished by putting parsed overset data into the rendering style of the main text. When splitting the main text into individual boxes, ruby characters are distributed as well as possible. The boxes being rendered can potentially expand in width if the overset text is wider as the main text.Example:
Of which, for the first phase, the epub looked as follows: