Approximate the leading with 0.2em since uisng nsIFontMetrics::GetLeading() gives unreliable results on suspicious fonts

This commit is contained in:
rbs%maths.uq.edu.au 2001-05-09 04:50:34 +00:00
parent b9e6fe91ae
commit 8887badac5
3 changed files with 15 additions and 4 deletions

View File

@ -572,7 +572,6 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
aRenderingContext.GetFontMetrics(*getter_AddRefs(fm));
nscoord leading, axisHeight, height;
GetAxisHeight(aRenderingContext, fm, axisHeight);
fm->GetLeading(leading);
// Operators that exist in the dictionary, or those that are to be centered
// to cater for fonts that are not math-aware, are handled by the MathMLChar
@ -730,7 +729,11 @@ nsMathMLmoFrame::Stretch(nsIPresContext* aPresContext,
mBoundingMetrics.ascent = height - mBoundingMetrics.descent;
}
// leave a leading at the top and the bottom of the stretched char
// get the leading to be left at the top and the bottom of the stretched char
// this seems more reliable than using fm->GetLeading() on suspicious fonts
float em = float(font.mFont.size);
leading = nscoord(0.2f * em);
aDesiredStretchSize.ascent = mBoundingMetrics.ascent + leading;
aDesiredStretchSize.descent = mBoundingMetrics.descent + leading;
}

View File

@ -225,7 +225,11 @@ nsMathMLmrootFrame::Reflow(nsIPresContext* aPresContext,
nscoord ruleThickness, leading;
GetRuleThickness(renderingContext, fm, ruleThickness);
fm->GetLeading(leading);
// get the leading to be left at the top of the resulting frame
// this seems more reliable than using fm->GetLeading() on suspicious fonts
float em = float(font.mFont.size);
leading = nscoord(0.2f * em);
// Rule 11, App. G, TeXbook
// psi = clearance between rule and content

View File

@ -190,7 +190,11 @@ nsMathMLmsqrtFrame::Reflow(nsIPresContext* aPresContext,
nscoord ruleThickness, leading;
GetRuleThickness(renderingContext, fm, ruleThickness);
fm->GetLeading(leading);
// get the leading to be left at the top of the resulting frame
// this seems more reliable than using fm->GetLeading() on suspicious fonts
float em = float(font.mFont.size);
leading = nscoord(0.2f * em);
// Rule 11, App. G, TeXbook
// psi = clearance between rule and content