[Qt-interest] Font size changes for each OS

Silas Silva silasdb at gmail.com
Thu Apr 22 16:41:28 CEST 2010


Hello all,

A badly designed application has fixed-sized widgets and fonts set on Qt
Designer.  In a machine (with Fedora 9), fonts fit ok, in others (with
Fedora 12 or Ubuntu) they get bigger.  What could be the cause of this
problem?  75dpi vs. 100dpi fonts?

I'm not going to discuss about the right and wrong ways of designing Qt
apps.  This applications is badly designed, yeah, but I inherited this
maintenance task.

So, I found several links on this list with several solutions:

- Set the application font: this works for the font family but doesn't
  work for the font size, because they are non-default set in designer.

- Set fonts size with QFont's setPixelSize(): not practical, since there
  are hundreds of widgets in UI files with hard-coded font sizes.

- Set the font path correctly, so it would pick 75dpi or 100dpi fonts:
  that is great and I got this idea reading this thread:

  http://lists.trolltech.com/qt-interest/1999-01/thread00076-0.html

  But it doesn't seem to work, even though I just let one path in the
  font path.  Is there anything I'm missing?

Any clue?  Any tips about how Qt font configuration works with X font
configuration?

Thanks!

-- 
Silas Silva



More information about the Qt-interest-old mailing list