Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fltk: fix undefined Fl_XFont_On_Demand #33

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/FL/x.H b/FL/x.H
index 85c6f6c..96f198a 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -132,6 +132,7 @@ private:
XFontStruct *ptr;
};
extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
+extern FL_EXPORT XFontStruct* fl_X_core_font();

// this object contains all X-specific stuff about a window:
// Warning: this object is highly subject to change!
diff --git a/src/fl_font.cxx b/src/fl_font.cxx
index 48a5bb5..3786ce7 100644
--- a/src/fl_font.cxx
+++ b/src/fl_font.cxx
@@ -55,6 +55,12 @@
# include "fl_font_x.cxx"
#endif // WIN32

+#if ! (defined(WIN32) || defined(__APPLE__))
+XFontStruct *fl_X_core_font()
+{
+ return fl_xfont.value();
+}
+#endif

double fl_width(const char* c) {
if (c) return fl_width(c, (int) strlen(c));
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 5f78902..8059254 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -84,7 +84,7 @@ void gl_font(int fontid, int size) {
* then sorting through them at draw time (for normal X rendering) to find which one can
* render the current glyph... But for now, just use the first font in the list for GL...
*/
- XFontStruct *font = fl_xfont;
+ XFontStruct *font = fl_X_core_font();
int base = font->min_char_or_byte2;
int count = font->max_char_or_byte2-base+1;
fl_fontsize->listbase = glGenLists(256);
1 change: 1 addition & 0 deletions meta-oe/recipes-support/fltk/fltk_1.3.3.bb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SRC_URI = "http://fltk.org/pub/fltk/${PV}/${BP}-source.tar.gz \
file://disable_test.patch \
file://fltk-no-freetype-config.patch \
file://fix-boolean-issue-with-jpeg9.patch \
file://fix-undefined-Fl-XFont-On-Demand.patch \
"

SRC_URI[md5sum] = "9ccdb0d19dc104b87179bd9fd10822e3"
Expand Down