diff options
| author | Manolo Gouy <Manolo> | 2011-02-07 13:49:34 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-02-07 13:49:34 +0000 |
| commit | cb902eebe3b419e77599fe669bc0cbeb3bce104a (patch) | |
| tree | 97724c741db795181108c27c7db583af7ebf6123 /src/fl_font_x.cxx | |
| parent | db3e5716372f6118f07c1b9dfed380258bb9e722 (diff) | |
Replaced global variable fl_fontsize by fl_graphics_driver->font_descriptor().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8395 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_font_x.cxx')
| -rw-r--r-- | src/fl_font_x.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/fl_font_x.cxx b/src/fl_font_x.cxx index 6983aff1e..c55b97734 100644 --- a/src/fl_font_x.cxx +++ b/src/fl_font_x.cxx @@ -3,7 +3,7 @@ // // Standard X11 font selection code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2011 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -38,7 +38,6 @@ Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name) { # endif } -Fl_Font_Descriptor* fl_fontsize; Fl_XFont_On_Demand fl_xfont; Fl_Font_Descriptor::~Fl_Font_Descriptor() { @@ -53,8 +52,8 @@ Fl_Font_Descriptor::~Fl_Font_Descriptor() { // glDeleteLists(listbase+base,size); // } # endif - if (this == fl_fontsize) { - fl_fontsize = 0; + if (this == fl_graphics_driver->font_descriptor()) { + fl_graphics_driver->font_descriptor(NULL); fl_xfont = 0; } XFreeUtf8FontStruct(fl_display, font); @@ -87,7 +86,7 @@ Fl_Fontdesc* fl_fonts = built_in_table; #define MAXSIZE 32767 -#define current_font (fl_fontsize->font) +#define current_font (fl_graphics_driver->font_descriptor()->font) // return dash number N, or pointer to ending null if none: const char* fl_font_word(const char* p, int n) { @@ -243,13 +242,12 @@ static Fl_Font_Descriptor* find(int fnum, int size) { if (!s->name) s = fl_fonts; // use font 0 if still undefined Fl_Font_Descriptor* f; for (f = s->first; f; f = f->next) - if (f->minsize <= size && f->maxsize >= size) return f; + if (f->size == size) return f; fl_open_display(); name = put_font_size(s->name, size); f = new Fl_Font_Descriptor(name); - f->minsize = size; - f->maxsize = size; + f->size = size; f->next = s->first; s->first = f; free(name); @@ -275,8 +273,8 @@ void Fl_Xlib_Graphics_Driver::font(Fl_Font fnum, Fl_Fontsize size) { if (fnum == Fl_Graphics_Driver::font() && size == Fl_Graphics_Driver::size()) return; Fl_Graphics_Driver::font(fnum, size); Fl_Font_Descriptor* f = find(fnum, size); - if (f != fl_fontsize) { - fl_fontsize = f; + if (f != fl_graphics_driver->font_descriptor()) { + fl_graphics_driver->font_descriptor(f); fl_xfont = current_font->fonts[0]; font_gc = 0; } |
