From c03f3d8946c3a68aea2c8c11705e04eeff0e02c9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 2 Apr 2016 11:58:13 +0000 Subject: Begin to rewrite src/Fl_Font.H in the driver model. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11506 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Font.H | 13 ------------- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | 8 ++++++-- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/Fl_Font.H b/src/Fl_Font.H index f5a576397..98ddccf9f 100644 --- a/src/Fl_Font.H +++ b/src/Fl_Font.H @@ -114,19 +114,6 @@ struct Fl_Fontdesc { extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table -#ifdef WIN32 -#elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform font stuff -// functions for parsing X font names: -FL_EXPORT const char* fl_font_word(const char *p, int n); -FL_EXPORT char *fl_find_fontsize(char *name); -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: do you need additional functions for font handling?" -#else -// functions for parsing X font names: -FL_EXPORT const char* fl_font_word(const char *p, int n); -FL_EXPORT char *fl_find_fontsize(char *name); -# endif - #endif // 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 25e28bc24..d364030e5 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx @@ -18,6 +18,7 @@ // Select fonts from the FLTK font table. #include "../../flstring.h" +#include "Fl_Xlib_Graphics_Driver.H" #include #include #include @@ -26,6 +27,9 @@ #include #include +static char* fl_find_fontsize(char* name); +static const char* fl_font_word(const char* p, int n); + // 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, @@ -429,13 +433,13 @@ Fl_Fontdesc* fl_fonts = built_in_table; #define MAXSIZE 32767 // return dash number N, or pointer to ending null if none: -const char* fl_font_word(const char* p, int n) { +static const char* fl_font_word(const char* p, int n) { while (*p) {if (*p=='-') {if (!--n) break;} p++;} return p; } // return a pointer to a number we think is "point size": -char* fl_find_fontsize(char* name) { +static char* fl_find_fontsize(char* name) { char* c = name; // for standard x font names, try after 7th dash: if (*c == '-') { -- cgit v1.2.3