Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Okay, no crash now with the latest code. What does it take to be an "open window"? Does that mean that I need to wait until Fl::run()? I have window->show(), then fl_font(), then fl_text_extent(), all before Fl::run(), and that gives height 0. I'm guessing that I can throw this stuff behind some Fl::add_timeout()s if necessary and all will be well? Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #1596: can'y built library with certain configuration
[STR Closed w/Resolution] Link: http://www.fltk.org/str.php?L1596 Version: 2.0-current Fix Version: 2.0-current (r5785) Fixed in Subversion repository. Link: http://www.fltk.org/str.php?L1596 Version: 2.0-current Fix Version: 2.0-current (r5785) ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #2545: SEGV caused by fltk generated code. Fl_Browser::item_height
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2545 Version: 1.3.0 Please send us a small program that we can compile and that shows this crash. Also, please make sure that your Fluid file does not contain any non-ASCII characters, or the UTF-8 functions will fail. They should not crash, but I don't know how your screen driver reacts to wrong UTF8 sequences (MicroWindows?) Link: http://www.fltk.org/str.php?L2545 Version: 1.3.0 ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #2531: Fl_Text_Display proportional text wobbles when selected on OS X
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2531 Version: 1.4-feature This can be improved only when we decide to change the entire graphics API to floating point coordinats. Link: http://www.fltk.org/str.php?L2531 Version: 1.4-feature ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2558: FL_NORMAL_SIZE isn't respected everywhere
[STR Closed w/Resolution] Link: http://www.fltk.org/str.php?L2558 Version: 1.3.0 Fix Version: 1.3.0 (r8405) Fixed in Subversion repository. Thanks for the patch. Link: http://www.fltk.org/str.php?L2558 Version: 1.3.0 Fix Version: 1.3.0 (r8405) ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #826: VC++ chokes on fluid-generated strings of encoded image data
[STR Closed w/Resolution] Link: http://www.fltk.org/str.php?L826 Version: 2.0-feature Fix Version: 1.1.7 It *has* been fixed in 1.3, just in a different way. Only fields that write large amounts of data call write_cdata instead of write_cstring. Link: http://www.fltk.org/str.php?L826 Version: 2.0-feature Fix Version: 1.1.7 ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current The reported crashes in fl_text_extents() are fixed in r.8404 both for X11 and Xft. Recent changes to remove global variables had created derefencing of a NULL pointer when this function is called without open windows. Now, there's no crash, but it's not possible to have a meaningful text extents computation under X11 without an open window because the system function used require a valid graphics context. The reported text extent is 0. With Xft, it seems to be possible to compute text extents without an open window but it's necessary to call fl_font() before. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Note that many of the Xlib font handling calls will choke like this if there's no valid drawing context, not just the changes I have made to fl_text_extents under Xlib. Indeed, the basic text drawing will also fail, in much the same way - and I deliberately derived the new fl_text_extents from the draw code in the hope of computing the "correct" metrics... Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Yep, I get a similar debug: (gdb) where #0 0xb7cb6022 in XSetFont () from /usr/lib/libX11.so.6 #1 0x080755b3 in XUtf8_measure_extents (display=0x80c20f0, d=0, font_set=0x80ca230, gc=0x0, xx=0xbfd10d8c, yy=0xbfd10d88, ww=0xbfd10d84, hh=0xbfd10d80, string=0x807ec29 "", num_bytes=0) at xutf8/utf8Wrap.c:698 #2 0x08062d4d in fl_text_extents (c=0x807ec28 "x", n=1, dx=@0xbfd10dec, dy=@0xbfd10de8, W=@0xbfd10de4, H=@0xbfd10de0) at fl_font_x.cxx:311 #3 0x08062db8 in fl_text_extents (c=0x807ec28 "x", dx=@0xbfd10dec, dy=@0xbfd10de8, w=@0xbfd10de4, h=@0xbfd10de0) at fl_font.cxx:76 #4 0x0804b722 in main () I'd guess that d=0 (drawable) and gc=0x0 (graphics context) is probably a bad thing. And probably understandable given no window has been opened yet. But apparently XUtf8_measure_extents() needs these in order to operate correctly, since it calls XSetFont() with the gc, and that seems to be where it's crashing. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Ah, but if I update to svn current (I had a release from last week cached), I can now replicate the crash with --disable-xft. Must be something added recently. I can only get the crash with --disable-xft; it doesn't crash if I build with xft enabled (the default). Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Hmm, using your test program and adding an fl_font() setting at the top, I can't replicate a crash with or without xft enabled on my linux (ubuntu 8.04/32bit) system (below). Try putting the following 'foo.cxx' file in the fltk "examples" directory and run 'make foo', and see if it runs OK, to rule out a possible makefile issue. $ cat foo.cxx #include #include #include int main(int argc, char **argv) { int xx, xy, xw, xh; fl_font(FL_HELVETICA, 14); fl_text_extents("x", xx, xy, xw, xh); printf("Values: %d,%d,%d,%d\n",xx,xy,xw,xh); return Fl::run(); } $ make foo *** Compile foo.cxx... *** Linking foo... $ ./foo Values: 0,-13,7,16 Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Hmm, both the minimal program and dillo still crash for me after adding in a fl_font() call. I was hoping that was it because there is some font-initialization code earlier on that is just currently commented out because we haven't 1.3-ized it yet. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Try putting fl_font(FL_HELVETICA, 14); above the fl_text_extents() call so that it knows what font to use to measure the text. I'm not sure if that will solve the crash, but it would be required in order for fl_text_extents() to know what font you want to measure with. I believe fl_text_extents(), fl_draw() etc. all require you to have set a font face and font size first, otherwise it will crash. Without any other initialization, the font and font size is completely undefined. (so that an application that doesn't draw any text doesn't need the overhead of loading the font library). The docs should probably cover that fl_text_extents() depends on the 'current font' being set with fl_font(). Perhaps too, a reference to fl_text_extents() should be added to the documentation/src/drawing.dox file. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Note: the same test returns 4x 0 on Windows, so this should probably be taken as the "correct" result. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current You can't measure text w/o setting a font first. The example crashes with and w/o Xft, BTW. Setting a font fixes it. The question is: should we set a default font, if none has been set? What results would we expect? IMHO the best would probably be to return 0 (or -1?) for all values if no font has been set, but not to crash. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current The unittest demo looks good. The case where it breaks is when Dillo is given an internal URL (about:splash) from the cmdline and can rush right off to start handling it earlier than usual. So I just tried some code with basically nothing in it: #include #include #include int main(int argc, char **argv) { int xx, xy, xw, xh; // Fl_Window *window = new Fl_Window(540,380); // window->begin(); // window->end(); // window->show(argc, argv); fl_text_extents("x", xx, xy, xw, xh); return Fl::run(); } ...and it breaks. The window lines didn't make a difference; I just wanted to see what would happen there. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
[fltk.bugs] [MOD] STR #2558: FL_NORMAL_SIZE isn't respected everywhere
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2558 Version: 1.3-current Some time ago, FL_NORMAL_SIZE was changed from a normal constant into a variable so that you could override the default font size (which you _really_ want as the default is a bit large compared to other toolkits). Unfortunately there were a few places that were overlooked. Prominently the fl_ask stuff and the tooltips. Attached patch fixes up those missing parts. Because of the way Fl_Tooltip is implemented, this involves an ABI change. So it would be nice if this could be fixed before 1.3.0 is released. Link: http://www.fltk.org/str.php?L2558 Version: 1.3-currentdiff -up fltk-1.3.x-r8365/FL/Fl_Tooltip.H.orig fltk-1.3.x-r8365/FL/Fl_Tooltip.H --- fltk-1.3.x-r8365/FL/Fl_Tooltip.H.orig 2011-02-08 17:17:36.569519069 +0100 +++ fltk-1.3.x-r8365/FL/Fl_Tooltip.H2011-02-08 17:17:40.790215898 +0100 @@ -72,7 +72,7 @@ public: /**Sets the typeface for the tooltip text. */ static void font(Fl_Font i) { font_ = i; } /**Gets the size of the tooltip text. */ - static Fl_Fontsize size() { return size_; } + static Fl_Fontsize size() { if (size_ == -1) return FL_NORMAL_SIZE; return size_; } /**Sets the size of the tooltip text. */ static void size(Fl_Fontsize s) { size_ = s; } /** Gets the background color for tooltips. The default background color is a pale yellow. */ diff -up fltk-1.3.x-r8365/src/fl_ask.cxx.orig fltk-1.3.x-r8365/src/fl_ask.cxx --- fltk-1.3.x-r8365/src/fl_ask.cxx.orig2011-02-08 17:02:42.042811694 +0100 +++ fltk-1.3.x-r8365/src/fl_ask.cxx 2011-02-08 17:09:10.436946779 +0100 @@ -55,7 +55,7 @@ static Fl_Input *input; static int ret_val; static const char *iconlabel = "?"; Fl_Font fl_message_font_ = FL_HELVETICA; -Fl_Fontsize fl_message_size_ = 14; +Fl_Fontsize fl_message_size_ = -1; #ifdef __APPLE__ extern "C" void NSBeep(void); #endif @@ -127,7 +127,7 @@ void resizeform() { int x, w, h, max_w, max_h; const int icon_size = 50; - fl_font(fl_message_font_, fl_message_size_); + fl_font(message->labelfont(), message->labelsize()); message_w = message_h = 0; fl_measure(message->label(), message_w, message_h); @@ -211,7 +211,10 @@ static int innards(const char* fmt, va_l } message->labelfont(fl_message_font_); - message->labelsize(fl_message_size_); + if (fl_message_size_ == -1) +message->labelsize(FL_NORMAL_SIZE); + else +message->labelsize(fl_message_size_); if (b0) {button[0]->show(); button[0]->label(b0); button[1]->position(210,70);} else {button[0]->hide(); button[1]->position(310,70);} if (b1) {button[1]->show(); button[1]->label(b1);} diff -up fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx.orig fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx --- fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx.orig 2011-02-08 17:11:05.696980005 +0100 +++ fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx 2011-02-08 17:11:09.121545514 +0100 @@ -1410,7 +1410,7 @@ Fl_File_Chooser::update_preview() // Show the first 1k of text... int size = previewBox->h() / 20; if (size < 6) size = 6; - else if (size > 14) size = 14; + else if (size > FL_NORMAL_SIZE) size = FL_NORMAL_SIZE; previewBox->label(preview_text_); previewBox->align((Fl_Align)(FL_ALIGN_CLIP | FL_ALIGN_INSIDE | diff -up fltk-1.3.x-r8365/src/fl_font_x.cxx.orig fltk-1.3.x-r8365/src/fl_font_x.cxx --- fltk-1.3.x-r8365/src/fl_font_x.cxx.orig 2011-02-08 17:13:13.214037502 +0100 +++ fltk-1.3.x-r8365/src/fl_font_x.cxx 2011-02-08 17:13:19.987155982 +0100 @@ -320,7 +320,7 @@ void fl_text_extents(const char *c, int void Fl_Xlib_Graphics_Driver::draw(const char* c, int n, int x, int y) { if (font_gc != fl_gc) { -if (!current_font) fl_font(FL_HELVETICA, 14); +if (!current_font) fl_font(FL_HELVETICA, FL_NORMAL_SIZE); font_gc = fl_gc; XSetFont(fl_display, fl_gc, current_font->fid); } diff -up fltk-1.3.x-r8365/src/fl_font_xft.cxx.orig fltk-1.3.x-r8365/src/fl_font_xft.cxx --- fltk-1.3.x-r8365/src/fl_font_xft.cxx.orig 2011-02-08 17:13:05.014683493 +0100 +++ fltk-1.3.x-r8365/src/fl_font_xft.cxx2011-02-08 17:13:06.734967573 +0100 @@ -588,7 +588,7 @@ void fl_destroy_xft_draw(Window id) { void Fl_Xlib_Graphics_Driver::draw(const char *str, int n, int x, int y) { if ( !current_font ) { -fl_font(FL_HELVETICA, 14); +fl_font(FL_HELVETICA, FL_NORMAL_SIZE); } #if USE_OVERLAY XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_; diff -up fltk-1.3.x-r8365/src/Fl_Tooltip.cxx.orig fltk-1.3.x-r8365/src/Fl_Tooltip.cxx --- fltk-1.3.x-r8365/src/Fl_Tooltip.cxx.orig2011-02-08 17:18:03.193914697 +0100 +++ fltk-1.3.x-r8365/src/Fl_Tooltip.cxx 2011-02-08 17:18:24.696464727 +0100 @@ -39,7 +39,7 @@ Fl_Color Fl_Tooltip::color_ = fl_color_c FL_NUM_BLUE - 2); Fl_Color Fl_Tooltip:
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current Correction: the PostScript printing of the unittests "Rendering text" window works also well under linux. (I had tested it previously under Darwin+X11 where the 30-pt Helvetica font is lacking.) Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current @manolo - thanks for the feedback. Yes, the unittests demo seems OK and ny other basic testing also seems fine. Though we need more feedback from users with non-LGC languages too, I guess! @corvid - can you post a minimal compileable expample that exhibits the fail? My testing seemed to be OK, and the unittests demo seems to run OK. Does the unittests demo run OK on your system (pull up the unitests demo then select the "rendering text" page to see fl_text_extents and fl_measure in action.) In your backtrace it looks as if the gc is NULL? That's probably a clue, but I don't know what your code was doing so can't be sure. Might be a good idea to do a clean and rebuild too, just in case there's some odd dependencies thing goig on...! Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
[fltk.bugs] 1.3 re Fl_Positioner & fluid (needs a better "generic" widget for custom classes)
to greg, michael and ben.(c/o fltk-bugs) [Ben, if you pass me a better email address I won't have to pass these things the forums. Thanx.] re Fl_Positioner. Fl_Positioner should probably check if the box type fills the area and if it doesn't it should fill the area with the background color. That's should be in the draw(int, int, int, int) function. There's a note in the header that the default box type is FL_NO_BOX. Here's what NO_BOX does. [fl_positioner.png] re. fluid In addition, the "box" in fluid fills in too many defaults to be useful as a modeler or place holder for custom classes like an fl_positioner. We can change the class in fluid but we don't have a good generic widget for producing them in fluid, one that has better defaults. (I commented out almost all of the Box defaults in the ui.fl file.) For example, Box sets the fg (select color?) and bg both to the same color. My first shot at creating a Positioner didn't show the cross hairs at all due to this. Any custom widget that does graphics is likely to use the select color I think, because we don't have fields specifically for line and area colors. [01-positioner-test.tar.gz attached] Change the box to down_box and change the colors (selection color does the cross hairs, I think) using fluid and see what I mean. You may also have to move the #include up in the tab order. I think I forgot to 'save' the fl file with that changed.) 01-positioner-test.tar.gz Description: GNU Zip compressed data ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [MOD] STR #2550: Xlib fl_text_extents
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Pending] Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current The unittests demo that exercizes fl_text_extents now works nicely without Xft. Excellent. The printing of this window isn't correct, though, and I just realize it was not correct either before the r.8399 commit. I'll try and look into that when time permits. Link: http://www.fltk.org/str.php?L2550 Version: 1.3-current ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs