I guess you are not aware Qt already uses FreeType...
I am aware of this, but my understanding was that this was only supported on platforms that already provide the FreeType library; i.e., X11 and some flavors of Linux.
Perhaps I have missed something here but I can't find anything in the documentation on how to enable this for Windows/other targets. Based on my tests, using FreeType makes a huge difference on Windows when rendering text in smaller size (see attachment, FreeType on the left with default settings).
ft.jpg
Added after 32 minutes:
Photoshop provides a more fine-grained control over the rendering
Using FreeType I can have exactly the same control over anti-aliasing, kerning and various typographic properties, obtaining and modifying individual glyphs of a font. I don't see how this is currently possible with Qt. My idea was to wrap this functionality in a high-level API: For example:
QFreeTypeEngine *engine = new QFreeTypeEngine(this);
QFreeTypeFont *font = new QFreeTypeEngine("myfont.ttf", engine);
QFreeTypeImage img = QFreeTypeImage::fromString("The lorem ipsum", font);
painter.drawImage(30, 70, img);
QFreeTypeEngine *engine = new QFreeTypeEngine(this);
QFreeTypeFont *font = new QFreeTypeEngine("myfont.ttf", engine);
QFreeTypeImage img = QFreeTypeImage::fromString("The lorem ipsum", font);
painter.drawImage(30, 70, img);
To copy to clipboard, switch view to plain text mode
Bookmarks