summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--src/fl_font_win32.cxx4
-rw-r--r--src/fl_set_font.cxx2
3 files changed, 7 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 5ba307945..39e312ed9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.8
+ - Fixed font caching issue (STR #1415)
- Fixed crash in fl_file_chooser (STR #1410)
- Fixed Fluid hotspot bug (STR #1416)
- Fixed image copy code (STR #1412)
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx
index 13b361e83..7f42f3eb9 100644
--- a/src/fl_font_win32.cxx
+++ b/src/fl_font_win32.cxx
@@ -126,6 +126,10 @@ int fl_size_ = 0;
//static HDC font_gc;
void fl_font(int fnum, int size) {
+ if (fnum==-1) { // just make sure that we will load a new font next time
+ fl_font_ = 0; fl_size_ = 0;
+ return;
+ }
if (fnum == fl_font_ && size == fl_size_) return;
fl_font_ = fnum; fl_size_ = size;
fl_fontsize = find(fnum, size);
diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx
index 4cabe5e4c..f069f909d 100644
--- a/src/fl_set_font.cxx
+++ b/src/fl_set_font.cxx
@@ -30,6 +30,7 @@
#include <FL/Fl.H>
#include <FL/x.H>
+#include <FL/fl_draw.H>
#include "flstring.h"
#include "Fl_Font.H"
#include <stdlib.h>
@@ -75,6 +76,7 @@ void Fl::set_font(Fl_Font fnum, const char* name) {
s->xlist = 0;
#endif
s->first = 0;
+ fl_font(-1, 0);
}
void Fl::set_font(Fl_Font fnum, Fl_Font from) {