Aliases in 2.2.x



The aliases for gnome-print in 2.2.x are:

Monospace Bold
Monospace Bold Italic
Monospace Italic
Monospace Regular

Sans Bold
Sans Bold Italic
Sans Italic
Sans Regular

Serif Bold
Serif Bold Italic
Serif Italic
Serif Regular

for fonts (gnome_font_find) and:

Monospace
Sans
Serif

for families (gnome_font_family_new).

This are part of the API, are not properly documented (mia culpa) and
they changed with the move to fontconfig.

I've seen a number of people use "Times", "sans", etc. and then asking
me why the first font in the list is chosen (again, mia culpa).

So ... I was thinking that gnome_font_find_closest could ask fontconfig
for a font, then map that result (by fc_file?) to an entry in the
gnome-print fontmap and return that. _find_closest is not very smart
right now and rarely does the right thing.

The benefit of this is that strings like "Times", "Sans" will work,
since fontconfig will match them and we'll return our alias "Sans
Regular", the downside is that the API is now not well defined and every
piece of code is going to use different defaults, which might not be
reliable since we depend on the contents of /etc/fonts/fonts.conf for it
to work.

Or maybe just proper documentation will do.

Font families will still need to be strict to get the right aliases.

Just at thought at this point ;-). Comments?

Chema




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]