Diego, thanks for taking the time to check this out. Appreciate it.
I will play around and see what I can do, but I'll only have a chance after exams. I'll also take a look at the Evince/GNOME/Pango situation as well. Dotan - it's not strictly a bug. Diego has pointed out that qt (the underlying library used by KDE and hence Okular) has exactly the function we need - one that can convert logical Hebrew to visual Hebrew. The "bug" is that this is probably a private function (accessible only from within qt, and not from within applications that are based on qt) - although there's a chance we can still use it. If not we can file a bug report and try get the function made public in the next big qt update. In short - I will play around after exams, and file the relevant bug report when I know what's going on. Thanks guys... this has been quite productive, it will be really nice if we can have open source Hebrew searching in PDFs :)) Gadi Dotan Cohen wrote: > 2010/1/19 Diego Iastrubni <[email protected]>: > >> This is really, really bad.... from qt/src/gui/painting/qpainter.cpp, inside >> void QPainter::drawText(const QPointF &p, const QString &str, int tf, int >> justificationPadding) >> >> I see this code: >> QStackTextEngine engine(str, d->state->font); >> engine.option.setTextDirection(d->state->layoutDirection); >> engine.itemize(); >> QScriptLine line; >> line.length = str.length(); >> engine.shapeLine(line); >> int nItems = engine.layoutData->items.size(); >> QVarLengthArray<int> visualOrder(nItems); >> QVarLengthArray<uchar> levels(nItems); >> for (int i = 0; i < nItems; ++i) >> levels[i] = engine.layoutData->items[i].analysis.bidiLevel; >> QTextEngine::bidiReorder(nItems, levels.data(), visualOrder.data()); >> >> Now... it seems like QTextEngine::bidiReorder() does exactly what you want >> logical->visual. However... this class is defined inside qtextengine_p.h... >> which means this is not official API. >> >> But, IMHO, even if it's not marked, you can open a bug report on this at >> Nokia's bug tracker, and they will handle it for Qt 4.8, maybe 4.7. >> Meanwhile, >> if the header is installed - abuse it. If it's not included - hack it inside >> your application >> >> (*) I know that this will not be accepted at KDE's svn ... >> >> > > Could you file that bug, Diego? It is far above my understanding or > level. Thanks! > > Here is the Qt bug tracker: > http://bugreports.qt.nokia.com/secure/CreateIssue!default.jspa > > > -- Gadi Cohen aka Kinslayer <[email protected]> www.wastelands.net Freelance admin/coding/design HABONIM DROR linux/fantasy enthusiast KeyID 0x93F26EF5: 256A 1FC7 AA2B 6A8F 1D9B 6A5A 4403 F34B 93F2 6EF5
_______________________________________________ Linux-il mailing list [email protected] http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
