summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-28 11:31:48 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-28 11:31:48 +0000
commitf1a03fb538f56f295d65ea56d4760089764e7655 (patch)
tree5f23a29dc7c764d1d1ba8590b8763364a0dedb6a /vcl
parent8714a1b5e9b9ee46fb1175a4edcc64cdc42469ce (diff)
INTEGRATION: CWS vcl09 (1.89.4); FILE MERGED
2003/05/09 15:02:59 ssa 1.89.4.2: #109280# improve external leading computation 2003/05/09 09:53:52 ssa 1.89.4.1: #109280# expand descent for korean fonts
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index eff03d1ba499..e08e5d7eb407 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -2,8 +2,8 @@
*
* $RCSfile: gcach_ftyp.cxx,v $
*
- * $Revision: 1.90 $
- * last change: $Author: rt $ $Date: 2003-04-24 10:29:11 $
+ * $Revision: 1.91 $
+ * last change: $Author: vg $ $Date: 2003-05-28 12:31:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -675,6 +675,7 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
rTo.mbDevice = FALSE;
const TT_OS2* pOS2 = (const TT_OS2*)FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 );
+ const TT_HoriHeader* pHHEA = (const TT_HoriHeader*)FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_hhea );
if( pOS2 && (~pOS2->version != 0) )
{
// #108862# sanity check, some fonts treat descent as signed !!!
@@ -690,10 +691,20 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
// Check for CJK capabilities of the current font
// #107888# workaround for Asian...
BOOL bCJKCapable = ((( pOS2->ulUnicodeRange2 & 0x2fff0000 ) | ( pOS2->ulUnicodeRange3 & 0x00000001 )) != 0 );
- if ( bCJKCapable )
+ BOOL bHasKoreanRange = ((( pOS2->ulUnicodeRange1 & 0x10000000 ) | ( pOS2->ulUnicodeRange2 & 0x00100000 ) |
+ ( pOS2->ulUnicodeRange2 & 0x01000000 )) != 0 );
+
+ if ( bCJKCapable && pHHEA )
{
- rTo.mnAscent += (long)(+pOS2->sTypoLineGap * fScale + 0.5 );
- rTo.mnLeading += (long)(+pOS2->sTypoLineGap * fScale + 0.5 );
+ // formula taken from www.microsoft.com/typography/otspec/recom.htm
+ long externalLeading = std::max(0, +pHHEA->Line_Gap - ((+pOS2->usWinAscent + +pOS2->usWinDescent)
+ - (+pHHEA->Ascender - +pHHEA->Descender)));
+
+ rTo.mnAscent += (long)(+externalLeading * fScale + 0.5 );
+ rTo.mnLeading += (long)(+externalLeading * fScale + 0.5 );
+ // #109280# korean only: increase descent for wavelines and improved line space
+ if( bHasKoreanRange )
+ rTo.mnDescent += (long)(+externalLeading * fScale + 0.5 );
}
rTo.mnFirstChar = pOS2->usFirstCharIndex;