diff options
| author | Manolo Gouy <Manolo> | 2016-09-23 13:56:07 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-09-23 13:56:07 +0000 |
| commit | 0250c5a98af506f2f107f8bd2e9e2c2c87a10c10 (patch) | |
| tree | 161771fa546b05f2d7fad1f5d67d831e00c6425c /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | |
| parent | 63e33b1be3e2af253cd8adf10a5eac7e72a5fc7e (diff) | |
Move font-related member functions from Fl_Screen_Driver to Fl_Graphics_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx index d1f28e831..60ee51d28 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx @@ -19,7 +19,6 @@ // Select fonts from the FLTK font table. #include "../../flstring.h" #include "Fl_Xlib_Graphics_Driver.H" -#include "../X11/Fl_X11_Screen_Driver.H" #include <FL/Fl.H> #include <FL/fl_draw.H> #include <FL/x.H> @@ -94,7 +93,7 @@ static int use_registry(const char *p) { #define ENDOFBUFFER 127 // sizeof(Fl_Font.fontname)-1 // turn a stored (with *'s) X font name into a pretty name: -const char* Fl_X11_Screen_Driver::get_font_name(Fl_Font fnum, int* ap) { +const char* Fl_Xlib_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { Fl_Fontdesc *f = fl_fonts + fnum; if (!f->fontname[0]) { int type = 0; @@ -265,7 +264,12 @@ static int to_canonical(char *to, const char *from, size_t tolen) { static unsigned int fl_free_font = FL_FREE_FONT; -Fl_Font Fl_X11_Screen_Driver::set_fonts(const char* xstarname) { + +// This function fills in the fltk font table with all the fonts that +// are found on the X server. It tries to place the fonts into families +// and to sort them so the first 4 in a family are normal, bold, italic, +// and bold italic. +Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* xstarname) { if (fl_free_font > (unsigned)FL_FREE_FONT) // already been here return (Fl_Font)fl_free_font; fl_open_display(); @@ -318,7 +322,7 @@ Fl_Font Fl_X11_Screen_Driver::set_fonts(const char* xstarname) { return (Fl_Font)fl_free_font; } -int Fl_X11_Screen_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { +int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { Fl_Fontdesc *s = fl_fonts+fnum; if (!s->name) s = fl_fonts; // empty slot in table, use entry 0 if (!s->xlist) { |
