2 We have to use Xft's hard-coded idea of the dpi first, and use
3 the builtin toDouble to avoid l10n issues.
5 --- vcl/unx/source/app/saldisp.cxx 8 Aug 2002 02:49:59 -0000 1.31.2.3
6 +++ vcl/unx/source/app/saldisp.cxx 14 Jan 2003 20:17:05 -0000
8 pVisual_ = new SalVisual( pXVI );
9 aSize_ = Size( DisplayWidth ( pDisp_, nScreen_ ),
10 DisplayHeight( pDisp_, nScreen_ ) );
15 + if ((value = XGetDefault (pDisp_, "Xft", "dpi"))) {
16 + ::rtl::OString str (value);
17 + dpi = (long) str.toDouble();
20 + aResolution_ = Pair( dpi, dpi );
23 Pair( DPI( aSize_.Width(), DisplayWidthMM ( pDisp_, nScreen_ ) ),
24 DPI( aSize_.Height(), DisplayHeightMM( pDisp_, nScreen_ ) ) );
27 nMaxRequestSize_ = XExtendedMaxRequestSize( pDisp_ ) * 4;
28 if( !nMaxRequestSize_ )
32 Index: vcl/source/window/window.cxx
33 ===================================================================
34 RCS file: /cvs/gsl/vcl/source/window/window.cxx,v
35 retrieving revision 1.176
36 diff -u -3 -p -r1.176 window.cxx
37 --- vcl/source/window/window.cxx 1 Jul 2003 14:48:37 -0000 1.176
38 +++ vcl/source/window/window.cxx 7 Nov 2003 16:01:31 -0000
39 @@ -1659,6 +1659,7 @@ void Window::ImplInitResolutionSettings(
42 // -----------------------------------------------------------------------
45 void Window::ImplPointToLogic( Font& rFont ) const
47 @@ -1667,17 +1668,21 @@ void Window::ImplPointToLogic( Font& rFo
51 - aSize.Width() *= mpFrameData->mnFontDPIX;
52 - aSize.Width() += 72/2;
53 - aSize.Width() /= 72;
54 - aSize.Width() *= nScreenFontZoom;
55 - aSize.Width() /= 100;
57 - aSize.Height() *= mpFrameData->mnFontDPIY;
58 - aSize.Height() += 72/2;
59 - aSize.Height() /= 72;
60 - aSize.Height() *= nScreenFontZoom;
61 - aSize.Height() /= 100;
62 + double t = aSize.Width();
63 + t *= nScreenFontZoom;
65 + t *= mpFrameData->mnFontDPIX;
68 + aSize.Width() = (long) t;
70 + double t = aSize.Height();
71 + t *= nScreenFontZoom;
73 + t *= mpFrameData->mnFontDPIY;
76 + aSize.Height() = (long) t;
78 if ( IsMapModeEnabled() )
79 aSize = PixelToLogic( aSize );
80 @@ -1697,17 +1702,22 @@ void Window::ImplLogicToPoint( Font& rFo
84 - aSize.Width() *= 100;
85 - aSize.Width() /= nScreenFontZoom;
86 - aSize.Width() *= 72;
87 - aSize.Width() += mpFrameData->mnFontDPIX/2;
88 - aSize.Width() /= mpFrameData->mnFontDPIX;
90 - aSize.Height() *= 100;
91 - aSize.Height() /= nScreenFontZoom;
92 - aSize.Height() *= 72;
93 - aSize.Height() += mpFrameData->mnFontDPIY/2;
94 - aSize.Height() /= mpFrameData->mnFontDPIY;
95 + double t = aSize.Width();
98 + t /= mpFrameData->mnFontDPIX;
100 + t /= nScreenFontZoom;
101 + aSize.Width() = (long) t;
104 + double t = aSize.Height();
107 + t /= mpFrameData->mnFontDPIY;
109 + t /= nScreenFontZoom;
110 + aSize.Height() = (long) t;
112 rFont.SetSize( aSize );
114 --- vcl/unx/source/gdi/salgdi.cxx.orig 2004-03-30 01:30:52.000000000 +0000
115 +++ vcl/unx/source/gdi/salgdi.cxx 2004-03-30 01:31:05.000000000 +0000
118 rDPIX = pDisplay->GetResolution().A();
119 rDPIY = pDisplay->GetResolution().B();
122 - rDPIX = Divide( rDPIX * 96, rDPIY );
125 - else if ( rDPIY > 200 )
127 - rDPIX = Divide( rDPIX * 200, rDPIY );
131 #ifndef _USE_PRINT_EXTENSION_
133 Index: vcl/unx/source/app/saldisp.cxx
134 ===================================================================
135 RCS file: /cvs/gsl/vcl/unx/source/app/saldisp.cxx,v
136 retrieving revision 1.41
137 diff -u -p -u -r1.41 saldisp.cxx
138 --- vcl/unx/source/app/saldisp.cxx 28 May 2003 12:33:35 -0000 1.41
139 +++ vcl/unx/source/app/saldisp.cxx 4 Jun 2003 08:57:54 -0000
140 @@ -2948,11 +2948,13 @@ void SalDisplay::GetScreenFontResolution
141 rDPIX = aResolution_.A();
142 rDPIY = aResolution_.B();
145 if( rDPIY < nThreshold )
147 rDPIX = Divide( rDPIX * nThreshold, rDPIY );
152 // #i12705# equalize x- and y-resolution if they are close enough