diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 2ba1282ff668323aa07bc35884f877348cdf97c1..fa910342e20c60cc81871716551650cd13157d3d 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -563,8 +563,8 @@ StringXNumber GeneralOptions_Number[] = { "Horizontal position (in pixels) of the upper left corner of the file chooser windows" }, { F|S, "FileChooserPositionY" , opt_general_file_chooser_position1 , 200. , "Vertical position (in pixels) of the upper left corner of the file chooser windows" }, - { F|O, "FontSize" , opt_general_fontsize , 13. , - "Size of the font in the user interface" }, + { F|O, "FontSize" , opt_general_fontsize , -1. , + "Size of the font in the user interface (-1=automatic)" }, { F|O, "GraphicsFontSize" , opt_general_graphics_fontsize , 16. , "Size of the font in the graphic window" }, diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 9279a894c26c7e4c368fc99f44c7f21a55e8c9ab..02e7ef2ffb3cc4fd001d10841a9ef9638acb224d 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.621 2007-05-25 21:58:11 geuzaine Exp $ +// $Id: GUI.cpp,v 1.622 2007-06-06 07:27:35 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -855,7 +855,18 @@ GUI::GUI(int argc, char **argv) // store fontsize now: we don't want any subsequent change // (e.g. when doing a 'restore options') to be taken into account // in the dynamic GUI features (set_context, plugin, etc.) - fontsize = CTX.fontsize; + if(CTX.fontsize > 0){ + fontsize = CTX.fontsize; + } + else{ + int x, y, w, h; + Fl::screen_xywh(x, y, w, h); + if(w <= 860) fontsize = 11; + else if(w <= 1024) fontsize = 12; + else if(w <= 1440) fontsize = 13; + else if(w <= 1600) fontsize = 14; + else fontsize = 15; + } // set default font size FL_NORMAL_SIZE = fontsize;