Qt Embedded Linux and QPF2 fonts



  • Guys ... where anti-aliasing is done when using prerendered QPF2 fonts on Qt Linux Embedded (v.4.5.3)? I am not able to turn it off. I have tried disabling it in:

    @ QFont f;
    f.setStyleHint(QFont::AnyStyle, QFont::NoAntialias);
    f.setStyleStrategy(QFont::NoAntialias);
    ....->setFont(f); @

    and even inherited one of the styles and reimplemented drawItemText() method:

    @void CustomStyle::drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const
    {
    painter->setRenderHint(QPainter::TextAntialiasing, false);
    painter->setRenderHint(QPainter::Antialiasing, false);
    QPlastiqueStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole);
    }@

    But no success. I still get anti-aliased fonts. There is no much information about QPF2 internals on the internet but I suspect that anti-aliasing is done during transformation from TTF to QPF2. Am I right? Qt Embedded docs says "The format is designed to be mapped directly to memory"



  • I think you are correct in that the anti-aliasing is applied when the fonts are generated since they are a bitmapped font format.

    Have you tried playing around with the makeqpf2 app that ships with Qt (it's in the tools dir) to see if this has any options for turnign off anti-aliasing in the qpf2 font generation?



  • Yep, I tried ... Tried to turn off anti-aliasing style hint for the fonts before passing them to QPF2 generator but in that case font characters were becoming invisible in embedded application. So I had to leave it turned on. After that tried to dig into the code, but found it a bit complex and distributed between Qt framework itself and makeqpf2 so left it at least for nearest future ... now have no time for this. I reported this as a bug. I think either it must be documented clearly what to expect or an option for anti-aliasing should be introduced.



  • Ah OK. I don't have time to dig into the source of makeqpf2 right now. Can you post a link to the bug report please?




Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.