mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Approximate the leading with 0.2em since uisng nsIFontMetrics::GetLeading() gives unreliable results on suspicious fonts
This commit is contained in:
parent
b9e6fe91ae
commit
8887badac5
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user