Abdelrazak Younes wrote:
Georg Baum wrote:
Am Montag, 1. Januar 2007 19:48 schrieb Abdelrazak Younes:
Georg Baum wrote:
I finally found a way to do the encoding change for LaTeX output
without
the ugly hack that I did earlier (following the long comment). The
drawback is that a) I am not sure whether the new code is standard
conformant and works with MSVC
The code compile and I can load the example file. Please find
attached the generated latex (pdflatex) file as well as a screenshot.
The generated file is correct, so the setEncoding modifier works. I am
glad to see that.
The screenshot looks different than here (but the patch did not change
anything drawing related). Obviously your version is correct, while
mine is not. I have no idea why,
In QLPainter::text(), we pass the string to draw to Qt on a word by word
basis and the Layout direction is explicitly set to LTR:
// We need to draw the text as LTR as we use our own bidi code.
setLayoutDirection(Qt::LeftToRight);
if (isDrawingEnabled()) {
drawText(x, y, str);
}
Could it be that your Qt settings somewhat override the layout direction?
Qt (4.1) documentation say that we should not use this drawText() method
but rather the one that uses QRect instead:
QPainter::drawText(int x, int y, const QString &str) will always draw
the string with its left edge at the position specified with the x, y
parameters. This will usually give you left aligned strings. Arabic and
Hebrew application strings are usually right aligned, so for these
languages use the version of drawText() that takes a QRect since this
will align in accordance with the language.
I am going to play a bit with that.
Abdel.