Kaydet (Commit) dd5b15eb authored tarafından Khaled Hosny's avatar Khaled Hosny

Handle fonts without hhea or OS/2 table e.g. Type1

Change-Id: Ib7245e9f8b7874087966cb1098e63d1f83acaa6a
üst 3c480196
...@@ -945,8 +945,10 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const ...@@ -945,8 +945,10 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
// Calculating ascender and descender: // Calculating ascender and descender:
// FreeType >= 2.4.6 does the right thing, so we just use what it gives us, // FreeType >= 2.4.6 does the right thing, so we just use what it gives us,
// for earlier versions we emulate its behaviour; take them from 'hhea' // for earlier versions we emulate its behaviour;
// table, if zero take them from 'OS/2' table. // take them from 'hhea' table,
// if zero take them from 'OS/2' table,
// if zero take them from FreeType's font metrics
if (nFTVERSION >= 2406) if (nFTVERSION >= 2406)
{ {
const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics; const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
...@@ -982,6 +984,14 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const ...@@ -982,6 +984,14 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
} }
} }
} }
if (!(rTo.mnAscent || rTo.mnDescent))
{
const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
rTo.mnAscent = (rMetrics.ascender + 32) >> 6;
rTo.mnDescent = (-rMetrics.descender + 32) >> 6;
rTo.mnExtLeading = ((rMetrics.height + 32) >> 6) - (rTo.mnAscent + rTo.mnDescent);
}
} }
if( pOS2 && (pOS2->version != 0xFFFF) ) if( pOS2 && (pOS2->version != 0xFFFF) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment