On 11 Apr 2010, at 22:00, Domingo Alvarez Duarte wrote:
> I want to use the "Verdana" font on windows, there is an easy way
> to do
> that ?
Assuming you have verdana installed on your windows box, then it
should be straight forward.
> ------
> int k = Fl::set_fonts("verdana*");
> if(k) my_widget->textfont(k);
> ------
>
> Font names case sensitive ?
No.
> Can be something like the above ?
Something like that.
But not that.
The set_fonts() method causes the system to enumerate the installed
fonts. It is *not* used to load a specific font.
To load a specific font you want the set_font() method instead.
Similar, but importantly different...
Say you wanted to replace one of the default fltk fonts with verdana,
then something like this would work:
Fl::set_font(FL_TIMES_BOLD_ITALIC, "verdana");
This would mean that, subsequently, any widget that asked for the
font enumerated as FL_TIMES_BOLD_ITALIC, it would actually get
verdana instead. That sort of thing.
Also, note that if using the Fl::set_fonts() method on win32 or OSX
to enumerate the system fonts, the only value to pass that makes any
sense is "*". Under X11 it *might* make sense to ask for something
else, but probably not...
Oh - and it might be better (though not strictly necessary) to
enumerate the system fonts before asking for a specific one.
So your code might do:
Fl::set_fonts("*");
:
Fl::set_font(FL_TIMES_BOLD_ITALIC, "verdana");
If you run the test/utf8.exe demo from a shell (e.g. Msys - not the
cmd shell since it is brain dead) or on OSX or unix, then it will
print to stdout all sorts of details about the fonts that you select
as you run through the demo.
Might be helpful in understanding what is going on in there!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk