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
This commit is contained in:
Matthias Melcher 2006-09-05 11:26:41 +00:00
parent caa6fd1ff2
commit 8c94b01142
2 changed files with 9 additions and 0 deletions

View File

@ -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));

View File

@ -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);