Hi,

My question is: how to determine the default font and fontsize in FLTK ?
(1.1.7)

Background: it seems that the font must be set before using e.g. fl_width.
E.g. look at the little program below:
//-------------------------------------
#include <stdio.h>
#include <FL/fl_draw.H>

int main(int argc, char *argv[])
{
  float lf;

  lf = fl_width(argv[1]);
  printf("Text: %s lf: %f\n", argv[1], lf);

  fl_font(FL_HELVETICA, 10);
  lf = fl_width(argv[1]);
  printf("\tlf: %f\n", lf);

  return 0;
}
//-------------------------------------

If invoked with the sting "abcd", it will print the following:
Text: abcd lf: -1.000000
        lf: 23.000000

So before setting the font, fl_width will return garbage.
But how to find out the default font & size to set it to ?

/Zoltan


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

Reply via email to