summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-09-05 11:26:41 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-09-05 11:26:41 +0000
commit8c94b011422e6ac7f27dfe8159d13a843b84fe83 (patch)
tree04ab746e443a70940a40a6b0dcd5be1fac4636ef /src
parentcaa6fd1ff2946592cc163618f2976a7192e68067 (diff)
Added code to clear the current font cache when the font face is changed. Now for OS X and X11 as well.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5421 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_font_mac.cxx5
-rw-r--r--src/fl_font_x.cxx4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx
index fb6e4422b..826207aad 100644
--- a/src/fl_font_mac.cxx
+++ b/src/fl_font_mac.cxx
@@ -264,6 +264,11 @@ int fl_font_ = 0;
int fl_size_ = 0;
void fl_font(int fnum, int size) {
+ if (fnum==-1) {
+ fl_font_ = 0;
+ fl_size_ = 0;
+ return;
+ }
fl_font_ = fnum;
fl_size_ = size;
fl_font(find(fnum, size));
diff --git a/src/fl_font_x.cxx b/src/fl_font_x.cxx
index 2723a2197..9d3b0c639 100644
--- a/src/fl_font_x.cxx
+++ b/src/fl_font_x.cxx
@@ -200,6 +200,10 @@ void *fl_xftfont = 0;
static GC font_gc;
void fl_font(int fnum, int size) {
+ if (fnum==-1) {
+ fl_font_ = 0; fl_size_ = 0;
+ return;
+ }
if (fnum == fl_font_ && size == fl_size_) return;
fl_font_ = fnum; fl_size_ = size;
Fl_FontSize* f = find(fnum, size);