[scribus-dev] RTL dropCap

Fahad Al-Saidi fahad.alsaidi at gmail.com
Tue Aug 9 06:15:16 UTC 2016


Hi All,

Right now I am working on fixing RTL dropcap bug, the details here:
https://github.com/HOST-Oman/scribus/issues/64

My finding as following:
I find from debugging in pageitem_textframe::layout():
in line 2741 when it adds a new line, it increase current.xPos with maximum
DropCap X (maxDX) if any. This applies only to lines after the line that
has DropCap letter.
This doesn't work for RTL text because dropcap letter is in the end of line
not in beginning ( The drawing text starts form left to right ). When we
break lines, we need to count (EndX - maxDX ) to set space for DropCap
letter.
However, I do that by adding:
if (style.direction() == ParagraphStyle::RTL &&  DropLinesCount >= 1)
                            EndX = current.endOfLine(m_availableRegion,
current.rightMargin + maxDX, regionMinY, regionMaxY);

and here a screen shot how the result looks like:
https://www.dropbox.com/s/fsuofyllmbmxilj/dropcap-rtl.jpg?dl=0

Now, there is a problem in DropLinesCount bigger than 1, unlike with mono
fonts, the characters are cramping and I didn't find why or how to fix it.
please see second text frame.

Any suggestion ?

/Fahad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20160809/679d2038/attachment.html>


More information about the scribus-dev mailing list