From 8c94b011422e6ac7f27dfe8159d13a843b84fe83 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 5 Sep 2006 11:26:41 +0000 Subject: 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 --- src/fl_font_mac.cxx | 5 +++++ src/fl_font_x.cxx | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src') 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); -- cgit v1.2.3