Bug 1137588 - patch 2 - Use a better default vOrigin in fonts without real vertical metrics. r=jdaggett

This commit is contained in:
Jonathan Kew 2015-03-26 12:23:55 +00:00
parent 83393239d4
commit 2085929bcb

View File

@ -389,8 +389,11 @@ gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
reinterpret_cast<const MetricsHeader*>(hb_blob_get_data(hheaTable,
&len));
if (len >= sizeof(MetricsHeader)) {
*aY = -FloatToFixed(GetFont()->FUnitsToDevUnitsFactor() *
int16_t(hhea->ascender));
// divide up the default advance we're using (1em) in proportion
// to ascender:descender from the hhea table
int16_t a = int16_t(hhea->ascender);
int16_t d = int16_t(hhea->descender);
*aY = -FloatToFixed(GetFont()->GetAdjustedSize() * a / (a - d));
return;
}
}