diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-14 15:28:38 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-14 15:28:38 +0100 |
| commit | 2d833a54fd1147b0d5942c2798940038b7536a9a (patch) | |
| tree | 4a864bbe7c7f82a78897c29beab3b49278de0aa1 /src/drivers/X11 | |
| parent | 496610723882602053cfb6912bca0b0dbfced84f (diff) | |
Move initialisation of X11 and Wayland built-in font names to fl_???_platform_init.cxx
Diffstat (limited to 'src/drivers/X11')
| -rw-r--r-- | src/drivers/X11/fl_X11_platform_init.cxx | 98 |
1 files changed, 97 insertions, 1 deletions
diff --git a/src/drivers/X11/fl_X11_platform_init.cxx b/src/drivers/X11/fl_X11_platform_init.cxx index 6c528a7cb..3bcf21370 100644 --- a/src/drivers/X11/fl_X11_platform_init.cxx +++ b/src/drivers/X11/fl_X11_platform_init.cxx @@ -14,13 +14,14 @@ // https://www.fltk.org/bugs.php // - +#include <FL/platform.H> #include "../Xlib/Fl_Xlib_Copy_Surface_Driver.H" #include "../Xlib/Fl_Xlib_Graphics_Driver.H" #include "Fl_X11_Screen_Driver.H" #include "Fl_X11_System_Driver.H" #include "Fl_X11_Window_Driver.H" #include "../Xlib/Fl_Xlib_Image_Surface_Driver.H" +#include "../Xlib/Fl_Font.H" Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int h) @@ -29,6 +30,101 @@ Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int } +#if !USE_XFT + +// WARNING: if you add to this table, you must redefine FL_FREE_FONT +// in Enumerations.H & recompile!! +static Fl_Xlib_Fontdesc built_in_table[] = { +{"-*-helvetica-medium-r-normal--*"}, +{"-*-helvetica-bold-r-normal--*"}, +{"-*-helvetica-medium-o-normal--*"}, +{"-*-helvetica-bold-o-normal--*"}, +{"-*-courier-medium-r-normal--*"}, +{"-*-courier-bold-r-normal--*"}, +{"-*-courier-medium-o-normal--*"}, +{"-*-courier-bold-o-normal--*"}, +{"-*-times-medium-r-normal--*"}, +{"-*-times-bold-r-normal--*"}, +{"-*-times-medium-i-normal--*"}, +{"-*-times-bold-i-normal--*"}, +{"-*-symbol-*"}, +{"-*-lucidatypewriter-medium-r-normal-sans-*"}, +{"-*-lucidatypewriter-bold-r-normal-sans-*"}, +{"-*-*zapf dingbats-*"} +}; + +#else // USE_XFT + +#if ! USE_PANGO + +// The predefined fonts that FLTK has: +static Fl_Fontdesc built_in_table[] = { +#if 1 + {" sans"}, + {"Bsans"}, + {"Isans"}, + {"Psans"}, + {" mono"}, + {"Bmono"}, + {"Imono"}, + {"Pmono"}, + {" serif"}, + {"Bserif"}, + {"Iserif"}, + {"Pserif"}, + {" symbol"}, + {" screen"}, + {"Bscreen"}, + {" zapf dingbats"}, +#else + {" helvetica"}, + {"Bhelvetica"}, + {"Ihelvetica"}, + {"Phelvetica"}, + {" courier"}, + {"Bcourier"}, + {"Icourier"}, + {"Pcourier"}, + {" times"}, + {"Btimes"}, + {"Itimes"}, + {"Ptimes"}, + {" symbol"}, + {" lucidatypewriter"}, + {"Blucidatypewriter"}, + {" zapf dingbats"}, +#endif +}; + +#else + +// The predefined fonts that FLTK has with Pango: +static Fl_Fontdesc built_in_table[] = { + {"Sans"}, + {"Sans Bold"}, + {"Sans Italic"}, + {"Sans Bold Italic"}, + {"Monospace"}, + {"Monospace Bold"}, + {"Monospace Italic"}, + {"Monospace Bold Italic"}, + {"Serif"}, + {"Serif Bold"}, + {"Serif Italic"}, + {"Serif Bold Italic"}, + {"Sans"}, + {"Monospace"}, + {"Monospace Bold"}, + {"Sans"}, +}; + +#endif // USE_PANGO + +#endif // USE_XFT + +FL_EXPORT Fl_Fontdesc* fl_fonts = (Fl_Fontdesc*)built_in_table; + + Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() { return new Fl_Xlib_Graphics_Driver(); |
