PDA

View Full Version : Qt Platform Abstraction support for truetype fonts



Wotsgreen
3rd September 2012, 15:08
Hi

I'm porting Qt 4.8.2 to a new embedded linux platform using QPA. I have configured, built, implemented QPlatformIntegration and other classes and things appear to work.

However: I can't get TTF fonts to work, only QPF2. My understanding is that I should instantiate the class "QBasicUnixFontDatabase()" and return it from "QPlatformIntegration::fontDatabase()". But freetype and QBasicUnixFontDatabase is not compiled into the project and I cannot find a configure option to do so. I currently configure as follows:

./configure -qpa -arch mips -xplatform qpa/linux-pnp4200-mips-uclibc-g++ -big-endian -host-big-endian -depths 32 -no-sse2 -nomake demos -nomake examples -no-largefile -no-accessibility -system-freetype -opensource -verbose -no-opengl -make libs -no-xmlpatterns -no-exceptions -no-qt3support -no-script -no-scripttools -no-webkit -release -prefix ../qt-install -confirm-license "$@"

Does anyone have experience with getting TTF font support whilst using QPA?

wysota
8th September 2012, 07:10
Try -fontconfig (provided you have fontconfig available, of course).

Also read this:

http://labs.qt.nokia.com/2010/09/02/fonts-in-lighthouse/

Wotsgreen
9th September 2012, 15:48
Thanks for the reply.

I found the problem was that I'm doing the integration code in the main application (i.e. the code which only links with the Qt .so files). QBasicUnixFontDatabase is not an exported class, so I could not instantiate the class from integration code.