PDA

View Full Version : Logical fonts?



sdfisher
16th February 2007, 00:31
I've been playing around with Qt on the Mac and Windows, porting windows from our earlier non-Qt solutions. But I've been running into a "How do I do this?"-type problem.

The problem I'm having is that Mac applications should use the standard system font. This is a larger system font than on Windows. A smaller version is available, for hint text, descriptions and such.

So in Qt, I'm trying to lay out most of my windows using the default font (which is the system font). Where I need to add some hint text, I tried to use the smaller font size. When I took this over to Windows, I found my hint text was larger than the controls, because even the Mac small system font is larger than the Windows system font.

What I'd like to do is use two different fonts on Mac, and the same font on Windows. Actually, you could probably extend this to three:

System Large Bold (for titles, section headers)
System Large (for most controls)
System Small (for hint/explanation text)

I'm at a loss on what approach to take on this. I define all my forms in Designer, and would like to continue to do so, but I don't especially care if Designer doesn't recognize these fonts, as long as I can work around it somehow.

Style sheets looked interesting, but they seem to not be supported in Qt/Mac 4.2. Does anyone have any tips?

wysota
1st March 2007, 14:01
Under Linux Qt has font substitution capabilities that can be configured using qtconfig. I think the Windows edition doesn't have that tool, but it is possible one can still do such substitutions using the general Qt config file.

It looks like so (a regular QSettings "ini" file):

[Qt]
Font%20Substitutions\A.D.%20MONO=
Font%20Substitutions\MS%20Shell%20Dlg=arial
Font%20Substitutions\arial=helvetica
Font%20Substitutions\courier%20new=courier
Font%20Substitutions\helv=helvetica
Font%20Substitutions\sans%20serif=helvetica
Font%20Substitutions\times%20new%20roman=times
Font%20Substitutions\tms%20rmn=times