Kaydet (Commit) 0ee12449 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i124823# fix the calculation of leading metrics for CoreText

üst aa12ecb5
......@@ -176,10 +176,13 @@ void CTTextStyle::GetFontMetric( float fDPIY, ImplFontMetricData& rMetric ) cons
CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName );
const double fPixelSize = (mfFontScale * fDPIY);
rMetric.mnAscent = lrint( CTFontGetAscent( aCTFontRef ) * fPixelSize);
const CGFloat fAscent = CTFontGetAscent( aCTFontRef );
const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef );
rMetric.mnAscent = lrint( fAscent * fPixelSize);
rMetric.mnDescent = lrint( CTFontGetDescent( aCTFontRef ) * fPixelSize);
rMetric.mnIntLeading = lrint( CTFontGetLeading( aCTFontRef ) * fPixelSize);
rMetric.mnExtLeading = 0;
rMetric.mnExtLeading = lrint( CTFontGetLeading( aCTFontRef ) * fPixelSize);
rMetric.mnIntLeading = lrint( (fAscent - fCapHeight) * fPixelSize);
// since ImplFontMetricData::mnWidth is only used for stretching/squeezing fonts
// setting this width to the pixel height of the fontsize is good enough
// it also makes the calculation of the stretch factor simple
......
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