diff options
| author | Manolo Gouy <Manolo> | 2015-04-28 22:02:48 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-04-28 22:02:48 +0000 |
| commit | f9fa74e3af0b53102ade659a7a2aa12ddf9ee9a3 (patch) | |
| tree | 01b108a2daa98f5caa6dc3aa15c9067b95ae76fd /src/fl_font_mac.cxx | |
| parent | 1c7daeca631f6bbf88b99f9ecd79a5cedd64f550 (diff) | |
Restored the possibility to call Fl::set_font()
in a global initializer (before main() starts).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_font_mac.cxx')
| -rw-r--r-- | src/fl_font_mac.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx index 0a741a7de..1b2eba1ae 100644 --- a/src/fl_font_mac.cxx +++ b/src/fl_font_mac.cxx @@ -19,6 +19,8 @@ #include <config.h> #include <math.h> +Fl_Fontdesc* fl_fonts = Fl_X::calc_fl_fonts(); + /* from fl_utf.c */ extern unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned short* dst, unsigned dstlen); @@ -235,6 +237,8 @@ static UniChar *mac_Utf8_to_Utf16(const char *txt, int len, int *new_len) Fl_Fontdesc* Fl_X::calc_fl_fonts(void) { + if (fl_fonts) return fl_fonts; + if (!fl_mac_os_version) fl_mac_os_version = calc_mac_os_version(); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 return (fl_mac_os_version >= Fl_X::CoreText_threshold ? built_in_table_PS : built_in_table_full); #else |
