nanogui: Fonts in nano-X, nxlib, FLTK


Previous by date: 28 Nov 2006 08:02:23 +0000 Re: Close box problem with nano-x + nanowm + nxlib + fltk, Greg Haerr
Next by date: 28 Nov 2006 08:02:23 +0000 Re: memory usage, Junior
Previous in thread: 28 Nov 2006 08:02:23 +0000 Re: Fonts in nano-X, nxlib, FLTK, Greg Haerr
Next in thread:

Subject: Re: [nanogui] Fonts in nano-X, nxlib, FLTK
From: albrecht ellinger ####@####.####
Date: 28 Nov 2006 08:02:23 +0000
Message-Id: <1164701053.5177.21.camel@albrechtLinux.site>

Hello,

> ... font names coded in the FLTK source. NXLIB uses fonts.dir...

Yes in Enumerations.H font names are specified. But they are useless
when the fonts are not found.

There are no font paths hardcoded in FLTK.
I have to scan the font names provided by nxlib.
The function Fl::set_fonts(...) receives all the fonts
and the number of fonts found is returned.
Then catch the number of the font I want to use
by comparing the font names with the font I like
to use.
The function get_font_name(...) is handy:

Fl::get_font_name((Fl_Font)i);

at last 

o->labelfont(i); is used to set the font.

There _should_ be a direct way, but that did not 
work for me: 

// find the next free slot in the font table (1.1.x)
 Fl_Font myFont = Fl_Font(FL_FREE_FONT + 1);
// load the required font in this slot
 Fl::set_font(myFont, "tahomaRus12.pcf.gz");
// use the font
o->labelfont(myFont);

Does someone know how to get the direct way to work?
(This is a little bit off topic here I know)

Thank you for your time

Albrecht



Previous by date: 28 Nov 2006 08:02:23 +0000 Re: Close box problem with nano-x + nanowm + nxlib + fltk, Greg Haerr
Next by date: 28 Nov 2006 08:02:23 +0000 Re: memory usage, Junior
Previous in thread: 28 Nov 2006 08:02:23 +0000 Re: Fonts in nano-X, nxlib, FLTK, Greg Haerr
Next in thread:


Powered by ezmlm-browse 0.20.