Bug 698652: Ignore the user's minimum font size when drawing to canvas. r=dbaron

This commit is contained in:
Chris Jones 2012-01-27 22:00:35 -08:00
parent f4872369b6
commit 74a7f7497d
2 changed files with 12 additions and 2 deletions

View File

@ -2548,7 +2548,12 @@ nsCanvasRenderingContext2D::SetFont(const nsAString& font)
// use CSS pixels instead of dev pixels to avoid being affected by page zoom
const PRUint32 aupcp = nsPresContext::AppUnitsPerCSSPixel();
// un-zoom the font size to avoid being affected by text-only zoom
const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mFont.size);
//
// Purposely ignore the font size that respects the user's minimum
// font preference (fontStyle->mFont.size) in favor of the
// computed size (fontStyle->mSize). See
// https://bugzilla.mozilla.org/show_bug.cgi?id=698652.
const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mSize);
bool printerFont = (presShell->GetPresContext()->Type() == nsPresContext::eContext_PrintPreview ||
presShell->GetPresContext()->Type() == nsPresContext::eContext_Print);

View File

@ -2759,7 +2759,12 @@ nsCanvasRenderingContext2DAzure::SetFont(const nsAString& font)
// use CSS pixels instead of dev pixels to avoid being affected by page zoom
const PRUint32 aupcp = nsPresContext::AppUnitsPerCSSPixel();
// un-zoom the font size to avoid being affected by text-only zoom
const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mFont.size);
//
// Purposely ignore the font size that respects the user's minimum
// font preference (fontStyle->mFont.size) in favor of the computed
// size (fontStyle->mSize). See
// https://bugzilla.mozilla.org/show_bug.cgi?id=698652.
const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mSize);
bool printerFont = (presShell->GetPresContext()->Type() == nsPresContext::eContext_PrintPreview ||
presShell->GetPresContext()->Type() == nsPresContext::eContext_Print);