Browse Source

Fl::set_fonts() on WIN32 fixed to work before the first window is shown.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1313 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
branch-1.0
Bill Spitzak 25 years ago
parent
commit
b56f14d91c
  1. 2
      src/fl_line_style.cxx
  2. 8
      src/fl_set_fonts_win32.cxx

2
src/fl_line_style.cxx

@ -18,7 +18,7 @@ void fl_line_style(int style, int width, char* dashes) { @@ -18,7 +18,7 @@ void fl_line_style(int style, int width, char* dashes) {
s1 |= style & 0xff; // allow them to pass any low 8 bits for style
}
if ((style || n) && !width) width = 1; // fix cards that do nothing for 0?
static LOGBRUSH penbrush = {BS_SOLID,fl_RGB(),0}; // can this be fl_brush()?
LOGBRUSH penbrush = {BS_SOLID,fl_RGB(),0}; // can this be fl_brush()?
HPEN newpen = ExtCreatePen(s1, width, &penbrush, n, n ? a : 0);
if (!newpen) {
// CET - FIXME - remove this debug fprintf()?

8
src/fl_set_fonts_win32.cxx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// "$Id: fl_set_fonts_win32.cxx,v 1.5.2.3 2000/06/05 21:21:10 mike Exp $"
// "$Id: fl_set_fonts_win32.cxx,v 1.5.2.4 2000/10/17 07:03:41 spitzak Exp $"
//
// WIN32 font utilities for the Fast Light Tool Kit (FLTK).
//
@ -74,8 +74,10 @@ static int CALLBACK enumcb(ENUMLOGFONT FAR *lpelf, @@ -74,8 +74,10 @@ static int CALLBACK enumcb(ENUMLOGFONT FAR *lpelf,
}
Fl_Font Fl::set_fonts(const char* xstarname) {
if (fl_free_font == FL_FREE_FONT) // if not already been called
if (fl_free_font == FL_FREE_FONT) {// if not already been called
if (!fl_gc) fl_GetDC(0);
EnumFontFamilies(fl_gc, NULL, (FONTENUMPROC)enumcb, xstarname != 0);
}
return (Fl_Font)fl_free_font;
}
@ -88,5 +90,5 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) { @@ -88,5 +90,5 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
}
//
// End of "$Id: fl_set_fonts_win32.cxx,v 1.5.2.3 2000/06/05 21:21:10 mike Exp $".
// End of "$Id: fl_set_fonts_win32.cxx,v 1.5.2.4 2000/10/17 07:03:41 spitzak Exp $".
//

Loading…
Cancel
Save