> Right now, I have been trying to find in the examples/sources 
> as to how to
> set a font by name - for example, a simple setFont("Arial") call and
> fontSize(fontSizeValue) but without any luck. Can you help?

I'm having a bit of trouble reconciling the subject line "Window
callback" with the question about font selection? Were you going to ask
something else and...?

Anyway; font selection - what context are we talking about here?
Actually during a draw() method, or just setting fonts generally for
widgets?

What I'd do is probably something like this.

(NOTE: If you really just want Arial, then on a MS system it will have
been pre-loaded in the FL_HELVETICA stock font anyway, so just use
that...)

- Assuming I know the name of the font I want to load, and it is
available on the system (both of these things can be determined at
runtime, but that's a bit more code...)

- Re-use one of the stock fltk font names that I'm not going to use, and
fill it with my selected font:

       Fl::set_font(FL_SYMBOL, " Arial Unicode MS");

- Now, for any widget, I can set it's font and size as:

       widget->labelfont(FL_SYMBOL);
       widget->labelsize(20);

- Or, from within a draw() method I might do:

       fl_font(FL_SYMBOL, 20);
       fl_color(FL_BLACK);
       fl_draw(msg, .... Etc...





SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to