summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/outdev3.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2006-04-06 14:37:58 +0000
committerVladimir Glazounov <vg@openoffice.org>2006-04-06 14:37:58 +0000
commitae18118d95a2b7907465d0182c456cb28421b6ea (patch)
tree404c6d8fb64db7bd0e4ecb373873b71a4c037b30 /vcl/source/gdi/outdev3.cxx
parentd6074846c5f5664be04624528c43c19c7b9e554e (diff)
INTEGRATION: CWS vcl56 (1.213.74); FILE MERGED
2006/03/15 07:38:08 hdu 1.213.74.1: #i55341# workaround bad looking textline metrics for fonts with huge descent
Diffstat (limited to 'vcl/source/gdi/outdev3.cxx')
-rw-r--r--vcl/source/gdi/outdev3.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index d6357e194cd7..5629d9ed1f96 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: outdev3.cxx,v $
*
- * $Revision: 1.215 $
+ * $Revision: 1.216 $
*
- * last change: $Author: obo $ $Date: 2006-03-29 11:25:45 $
+ * last change: $Author: vg $ $Date: 2006-04-06 15:37:58 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -3713,13 +3713,19 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
{
long nDescent = mnDescent;
- if ( !nDescent )
+ if ( nDescent <= 0 )
{
- nDescent = mnAscent*100/1000;
+ nDescent = mnAscent / 10;
if ( !nDescent )
nDescent = 1;
}
+ // #i55341# for some fonts it is not a good idea to calculate
+ // their text line metrics from the real font descent
+ // => work around this problem just for these fonts
+ if( 3*nDescent > mnAscent )
+ nDescent = mnAscent / 3;
+
long nLineHeight = ((nDescent*25)+50) / 100;
if ( !nLineHeight )
nLineHeight = 1;
@@ -3748,7 +3754,7 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
if ( !n2LineDY2 )
n2LineDY2 = 1;
- long nUnderlineOffset = nDescent/2 + 1;
+ long nUnderlineOffset = mnDescent/2 + 1;
long nStrikeoutOffset = -((mnAscent - mnIntLeading) / 3);
mnUnderlineSize = nLineHeight;