]> git.pld-linux.org Git - packages/libreoffice.git/blame - openoffice-gui-font-scale.patch
- font & font config patches.
[packages/libreoffice.git] / openoffice-gui-font-scale.patch
CommitLineData
5cc47c02 1
2 We have to use Xft's hard-coded idea of the dpi first, and use
3the builtin toDouble to avoid l10n issues.
4
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
7@@ -833,9 +833,20 @@
8 pVisual_ = new SalVisual( pXVI );
9 aSize_ = Size( DisplayWidth ( pDisp_, nScreen_ ),
10 DisplayHeight( pDisp_, nScreen_ ) );
11- aResolution_ =
12+ {
13+ const char *value;
14+ long dpi = 0;
15+ if ((value = XGetDefault (pDisp_, "Xft", "dpi"))) {
16+ ::rtl::OString str (value);
17+ dpi = (long) str.toDouble();
18+ }
19+ if (dpi > 0)
20+ aResolution_ = Pair( dpi, dpi );
21+ else
22+ aResolution_ =
23 Pair( DPI( aSize_.Width(), DisplayWidthMM ( pDisp_, nScreen_ ) ),
24 DPI( aSize_.Height(), DisplayHeightMM( pDisp_, nScreen_ ) ) );
25+ }
26
27 nMaxRequestSize_ = XExtendedMaxRequestSize( pDisp_ ) * 4;
28 if( !nMaxRequestSize_ )
29
30
31
32Index: vcl/source/window/window.cxx
33===================================================================
34RCS file: /cvs/gsl/vcl/source/window/window.cxx,v
35retrieving revision 1.176
36diff -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(
40 }
41
42 // -----------------------------------------------------------------------
43+#include <stdio.h>
44
45 void Window::ImplPointToLogic( Font& rFont ) const
46 {
47@@ -1667,17 +1668,21 @@ void Window::ImplPointToLogic( Font& rFo
48
49 if ( aSize.Width() )
50 {
51- aSize.Width() *= mpFrameData->mnFontDPIX;
52- aSize.Width() += 72/2;
53- aSize.Width() /= 72;
54- aSize.Width() *= nScreenFontZoom;
55- aSize.Width() /= 100;
56- }
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;
64+ t /= 100.0;
65+ t *= mpFrameData->mnFontDPIX;
66+ t /= 72.0;
67+ t += 0.5;
68+ aSize.Width() = (long) t;
69+ }
70+ double t = aSize.Height();
71+ t *= nScreenFontZoom;
72+ t /= 100.0;
73+ t *= mpFrameData->mnFontDPIY;
74+ t /= 72.0;
75+ t += 0.5;
76+ aSize.Height() = (long) t;
77
78 if ( IsMapModeEnabled() )
79 aSize = PixelToLogic( aSize );
80@@ -1697,17 +1702,22 @@ void Window::ImplLogicToPoint( Font& rFo
81
82 if ( aSize.Width() )
83 {
84- aSize.Width() *= 100;
85- aSize.Width() /= nScreenFontZoom;
86- aSize.Width() *= 72;
87- aSize.Width() += mpFrameData->mnFontDPIX/2;
88- aSize.Width() /= mpFrameData->mnFontDPIX;
89- }
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();
96+ t -= 0.5;
97+ t *= 72.0;
98+ t /= mpFrameData->mnFontDPIX;
99+ t *= 100.0;
100+ t /= nScreenFontZoom;
101+ aSize.Width() = (long) t;
102+ }
103+
104+ double t = aSize.Height();
105+ t -= 0.5;
106+ t *= 72.0;
107+ t /= mpFrameData->mnFontDPIY;
108+ t *= 100.0;
109+ t /= nScreenFontZoom;
110+ aSize.Height() = (long) t;
111
112 rFont.SetSize( aSize );
113 }
114Index: vcl/unx/source/gdi/salgdi.cxx
115===================================================================
116RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi.cxx,v
117retrieving revision 1.24
118diff -u -p -u -r1.24 salgdi.cxx
119--- vcl/unx/source/gdi/salgdi.cxx 15 Apr 2003 16:09:37 -0000 1.24
120+++ vcl/unx/source/gdi/salgdi.cxx 13 May 2003 12:24:22 -0000
121@@ -504,12 +504,6 @@ void SalGraphics::GetResolution( long &r
122
123 rDPIX = pDisplay->GetResolution().A();
124 rDPIY = pDisplay->GetResolution().B();
125- if ( rDPIY < 96 )
126- {
127- rDPIX = Divide( rDPIX * 96, rDPIY );
128- rDPIY = 96;
129- }
130-
131 #ifndef _USE_PRINT_EXTENSION_
132 }
133 #endif
134Index: vcl/unx/source/app/saldisp.cxx
135===================================================================
136RCS file: /cvs/gsl/vcl/unx/source/app/saldisp.cxx,v
137retrieving revision 1.41
138diff -u -p -u -r1.41 saldisp.cxx
139--- vcl/unx/source/app/saldisp.cxx 28 May 2003 12:33:35 -0000 1.41
140+++ vcl/unx/source/app/saldisp.cxx 4 Jun 2003 08:57:54 -0000
141@@ -2948,11 +2948,13 @@ void SalDisplay::GetScreenFontResolution
142 rDPIX = aResolution_.A();
143 rDPIY = aResolution_.B();
144
145+#if 0
146 if( rDPIY < nThreshold )
147 {
148 rDPIX = Divide( rDPIX * nThreshold, rDPIY );
149 rDPIY = nThreshold;
150 }
151+#endif
152
153 // #i12705# equalize x- and y-resolution if they are close enough
154 if( rDPIX != rDPIY )
This page took 0.18663 seconds and 4 git commands to generate.