On Mon, Oct 14, 2002 at 01:54:29PM +0100, Jos? Ab?lio Oliveira Matos wrote: > On Monday 14 October 2002 13:24, Kornel Benko wrote: > > > > So I am not supposed to patch the code each time I use new cvs? > > Despite the fonts-size-problem (and missing preferences) is this a very > > agreeable version. > > I have been able to have an working version only with redhat 8.0. And yes I > also have the font size problem. So this looks more than some weird > configuration. :-)
I think that the font size problem is due to the fact that qt2/lyx_gui.C does not read the DPI from the screen but assumes instead that dpi = 95. The following patch fixes this. I'm not sure that I'm using the correct method to read the DPI, but it works. Comments ?
Index: lyx_gui.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v retrieving revision 1.19 diff -u -p -r1.19 lyx_gui.C --- lyx_gui.C 26 Sep 2002 08:57:43 -0000 1.19 +++ lyx_gui.C 14 Oct 2002 16:21:44 -0000 @@ -48,6 +48,8 @@ #include "io_callback.h" #include <qapplication.h> +#include <qwidget.h> +#include <qpaintdevicemetrics.h> #ifndef CXX_GLOBAL_CSTD using std::exit; @@ -60,8 +62,14 @@ using std::endl; extern BufferList bufferlist; namespace { - /// good ol' "easy to use" Qt again - float getDPI() { return 95; } + +float getDPI() +{ + QWidget w; + QPaintDeviceMetrics pdm(&w); + return pdm.logicalDpiY(); +} + } // FIXME: wrong place !