[Qt-interest] Picking default fonts
Nikos Chantziaras
realnc at arcor.de
Mon Mar 22 20:53:49 CET 2010
On 03/22/2010 09:39 PM, Nikos Chantziaras wrote:
> On 03/22/2010 09:28 PM, Arnold Krille wrote:
>> On Monday 22 March 2010 20:18:10 Nikos Chantziaras wrote:
>>> On 03/22/2010 04:30 PM, Arnold Krille wrote:
>>>> On Monday 22 March 2010 15:13:26 Nikos Chantziaras wrote:
>>>>> On 03/21/2010 11:49 PM, Thiago Macieira wrote:
>>>>>> Em Domingo 21. Março 2010, às 21.45.16, Nikos Chantziaras escreveu:
>>>>>>> On Gnome and KDE, there are default "general" and "fixed width"
>>>>>>> fonts.
>>>>>>> That way, all applications that need to display fixed-width fonts
>>>>>>> (like a text editor) always use the font the user set globally. Is
>>>>>>> there any way I can get those fonts from within a Qt application?
>>>>>>> [...]
>>>>>> Use these generic font names:
>>>>>> Sans
>>>>>> Serif
>>>>>> Monospace
>>>>> Thanks. This works. Is this something that Qt takes care of and makes
>>>>> it work on all platforms, or this a Linux-only thingy?
>>>> If Qt is only half as good in "lightening your burden" it does this on
>>>> all platforms supported. Together with picking the right colours
>>>> from the
>>>> palette, selecting the right style, following the toolbar preferences,
>>>> following the right-handed/left-handed mouse settings and selecting the
>>>> users language for translations (if they exist for the app).
>>>> PS: Yes, Qt is lightening your burden in that it does all the named
>>>> things for you:-)
>>> While we're at it, are there any other "special" font names I should be
>>> aware of, or are the above three the complete list of them?
>>
>> Hehe, I would love a special "no freaking ms-fonts" name:-)
>
> Well, here I would love something like "Cursive" or "Fantasy". Right
> now, I simply pick the first font I find that contains "Chancery" in its
> family() name (to match fonts like "URW Chancery L", "Apple Chancery").
>
> I guess what we're asking here for is CSS-like generic font names
> (serif, sans-serif, monospace, cursive and fantasy):
>
> http://www.w3.org/Style/Examples/007/fonts
Hey wait a minute. This actually *does* work, lol.
I just tested these:
serif: DejaVu Serif (the default in KDE settings)
sans-serif: DejaVu Sans (ditto)
monospace: DejaVu Sans Mono (also correct)
Now these:
cursive: Comic Sans
fantasy: Impact
AFAICT, there's no configuration option in KDE for "cursive" and
"fantasy" fonts, yet "Comic Sans" and "Impact" were chosen. That's
pretty neat, but where does that come from? Is it Qt doing this or is
it something along the path of KDE/FreeType/Fontconfig?
I should probably test this on a Mac and Windows when I get the chance.
More information about the Qt-interest-old
mailing list