diff options
| author | Manolo Gouy <Manolo> | 2016-04-02 13:22:48 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-02 13:22:48 +0000 |
| commit | d011d5b4f060166f87fc44594f7f31ddf6b652e9 (patch) | |
| tree | 45d6edbcd0dcad0abf71a76a146be36716b0a927 /src/fl_set_font.cxx | |
| parent | c03f3d8946c3a68aea2c8c11705e04eeff0e02c9 (diff) | |
Replace src/Fl_Font.H by one file for each platform.
This file contained nearly only platform-specific code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_set_font.cxx')
| -rw-r--r-- | src/fl_set_font.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx index 0c53e75af..3917f80f3 100644 --- a/src/fl_set_font.cxx +++ b/src/fl_set_font.cxx @@ -22,8 +22,15 @@ #include <FL/Fl.H> #include <FL/x.H> #include <FL/fl_draw.H> +#include <FL/Fl_Screen_Driver.H> #include "flstring.h" -#include "Fl_Font.H" +#if defined(__APPLE__) +#include "drivers/Quartz/Fl_Font.H" +#elif defined(WIN32) +#include "drivers/GDI/Fl_Font.H" +#elif USE_X11 +#include "drivers/Xlib/Fl_Font.H" +#endif #include <stdlib.h> static int table_size; @@ -32,9 +39,7 @@ static int table_size; the string is not copied, so the string must be in static memory. */ void Fl::set_font(Fl_Font fnum, const char* name) { -#ifdef __APPLE__ // PORTME: Fl_Graphics_Driver - platform fonts - if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts(); -#endif + if (!fl_fonts) fl_fonts = Fl_Screen_Driver::calc_fl_fonts(); while (fnum >= table_size) { int i = table_size; if (!i) { // don't realloc the built-in table @@ -85,9 +90,7 @@ void Fl::set_font(Fl_Font fnum, Fl_Font from) { of this face. */ const char* Fl::get_font(Fl_Font fnum) { -#ifdef __APPLE__ // PORTME: Fl_Graphics_Driver - platform fonts - if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts(); -#endif + if (!fl_fonts) fl_fonts = Fl_Screen_Driver::calc_fl_fonts(); return fl_fonts[fnum].name; } |
