News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Fonts in murgaLua (or FLTK)
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: Fonts in murgaLua (or FLTK)

Both of those examples are in murgaLua syntax, so should work as is.
They both change the built-in courier font constant to your desired font (4 is equivalent to fltk.FL_COURIER). Then to use it, just use fltk.FL_COURIER (or 4) as your font:

Code:
Fl:set_font(fltk.FL_COURIER,"arial")
my_button=fltk:Fl_Button(10,10,120,25,"My Button")
my_button:labelfont(fltk.FL_COURIER)

Any place that would normally use a fixed-width font, such as following @f in Fl_Browser, will automatically use your customized FL_COURIER font without needing to specify what font to use.

Depending on what type of text you want to change, the actual method might not be "labelfont". For example, if my_button was an Input text field and you wanted to change the font of the typed-in text, it would be my_button:textfont(fltk.FL_COURIER). Consult the FLTK documentation for the method needed with the particular class you are using.

07-15-2007 09:05 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Fonts in murgaLua (or FLTK) - pdinoto - 06-24-2007, 02:37 PM
RE: Fonts in murgaLua (or FLTK) - mikshaw - 06-24-2007, 03:33 PM
RE: Fonts in murgaLua (or FLTK) - mikshaw - 07-09-2007, 02:36 PM
RE: Fonts in murgaLua (or FLTK) - mikshaw - 07-11-2007, 08:44 AM
RE: Fonts in murgaLua (or FLTK) - pdinoto - 07-15-2007, 08:07 AM
RE: Fonts in murgaLua (or FLTK) - mikshaw - 07-15-2007 09:05 AM
RE: Fonts in murgaLua (or FLTK) - pdinoto - 07-15-2007, 03:41 PM
RE: Fonts in murgaLua (or FLTK) - mikshaw - 07-15-2007, 04:33 PM
RE: Fonts in murgaLua (or FLTK) - pdinoto - 07-16-2007, 02:24 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: