tags:

views:

693

answers:

2

We develop an embedded QT application for linux on MS Windows. The target platform is linux without X-windows (framebuffer) . Unfortunallety, the screens on windows look rather different (better) than the same screens on linux because windows has better fonts. Is there a way to force QT on windows to use the linux fonts? I would like to achieve binary compatibility i.e. CRCs of the screenshots will be the same in linux and in windows.

Thanks in advance

+5  A: 

You can use QFontDatabase::addApplicationFont to load a font from a file or from memory (QByteArray). The returned id can be used to retrieve a list of font families (see QFontDatabase::applicationFontFamilies) that can be passed to QFontDatabase::font to create a QFont object for use in your application.

Only TrueType fonts are supported.

Judge Maygarden
+1  A: 

I suspect this is going to be difficult to do. Windows is using it's own font renderer to draw the fonts, and so the hinting and such is going to be off no matter what you do. You can use the same fonts, but they will still look different. Subtly different, likely, but still different.

It is possible that you can avoid that by using bitmap fonts. I am not sure, though.

Arcane