diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index 73618a55050f..89c6bce36a11 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -1967,17 +1967,13 @@ nsCanvasRenderingContext2D::SetFont(const nsAString& font) // un-zoom the font size to avoid being affected by text-only zoom const nscoord fontSize = nsStyleFont::UnZoomText(parentContext->PresContext(), fontStyle->mFont.size); - PRBool printerFont = (presShell->GetPresContext()->Type() == nsPresContext::eContext_PrintPreview || - presShell->GetPresContext()->Type() == nsPresContext::eContext_Print); - gfxFontStyle style(fontStyle->mFont.style, fontStyle->mFont.weight, NSAppUnitsToFloatPixels(fontSize, aupcp), langGroup, fontStyle->mFont.sizeAdjust, fontStyle->mFont.systemFont, - fontStyle->mFont.familyNameQuirks, - printerFont); + fontStyle->mFont.familyNameQuirks); CurrentState().fontGroup = gfxPlatform::GetPlatform()->CreateFontGroup(fontStyle->mFont.name, &style, presShell->GetPresContext()->GetUserFontSet()); NS_ASSERTION(CurrentState().fontGroup, "Could not get font group"); diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp index 19803875ba44..f0b945876562 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -148,12 +148,6 @@ nsThebesDeviceContext::Shutdown() gSystemFonts = nsnull; } -PRBool -nsThebesDeviceContext::IsPrinterSurface() -{ - return(mPrintingSurface != NULL); -} - nsresult nsThebesDeviceContext::SetDPI() { diff --git a/gfx/src/thebes/nsThebesDeviceContext.h b/gfx/src/thebes/nsThebesDeviceContext.h index e6bdc8274596..629c2ac6c03c 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.h +++ b/gfx/src/thebes/nsThebesDeviceContext.h @@ -118,8 +118,6 @@ public: virtual PRBool SetPixelScale(float aScale); - PRBool IsPrinterSurface(void); - nsNativeWidget GetWidget() { return mWidget; } #if defined(XP_WIN) || defined(XP_OS2) HDC GetPrintHDC(); diff --git a/gfx/src/thebes/nsThebesFontMetrics.cpp b/gfx/src/thebes/nsThebesFontMetrics.cpp index e2b5a70be7ae..ce6a494eeebf 100644 --- a/gfx/src/thebes/nsThebesFontMetrics.cpp +++ b/gfx/src/thebes/nsThebesFontMetrics.cpp @@ -83,11 +83,9 @@ nsThebesFontMetrics::Init(const nsFont& aFont, nsIAtom* aLangGroup, langGroup.Assign(lg); } - PRBool printerFont = mDeviceContext->IsPrinterSurface(); mFontStyle = new gfxFontStyle(aFont.style, aFont.weight, size, langGroup, aFont.sizeAdjust, aFont.systemFont, - aFont.familyNameQuirks, - printerFont); + aFont.familyNameQuirks); mFontGroup = gfxPlatform::GetPlatform()->CreateFontGroup(aFont.name, mFontStyle, diff --git a/gfx/thebes/public/gfxFont.h b/gfx/thebes/public/gfxFont.h index 2b7de9b3a1a1..f4b10be6af64 100644 --- a/gfx/thebes/public/gfxFont.h +++ b/gfx/thebes/public/gfxFont.h @@ -78,8 +78,7 @@ struct THEBES_API gfxFontStyle { gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, gfxFloat aSize, const nsACString& aLangGroup, float aSizeAdjust, PRPackedBool aSystemFont, - PRPackedBool aFamilyNameQuirks, - PRPackedBool aPrinterFont); + PRPackedBool aFamilyNameQuirks); gfxFontStyle(const gfxFontStyle& aStyle); // The style of font (normal, italic, oblique) @@ -90,9 +89,6 @@ struct THEBES_API gfxFontStyle { // sources. PRPackedBool systemFont : 1; - // Say that this font is used for print or print preview. - PRPackedBool printerFont : 1; - // True if the character set quirks (for treatment of "Symbol", // "Wingdings", etc.) should be applied. PRPackedBool familyNameQuirks : 1; @@ -137,7 +133,6 @@ struct THEBES_API gfxFontStyle { return (size == other.size) && (style == other.style) && (systemFont == other.systemFont) && - (printerFont == other.printerFont) && (familyNameQuirks == other.familyNameQuirks) && (weight == other.weight) && (langGroup.Equals(other.langGroup)) && diff --git a/gfx/thebes/src/gfxFont.cpp b/gfx/thebes/src/gfxFont.cpp index b5ec902a92da..9d80e2175c2a 100644 --- a/gfx/thebes/src/gfxFont.cpp +++ b/gfx/thebes/src/gfxFont.cpp @@ -1227,8 +1227,8 @@ gfxFontGroup::GetGeneration() #define DEFAULT_PIXEL_FONT_SIZE 16.0f gfxFontStyle::gfxFontStyle() : - style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), printerFont(PR_FALSE), - familyNameQuirks(PR_FALSE), weight(FONT_WEIGHT_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE), + style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), familyNameQuirks(PR_FALSE), + weight(FONT_WEIGHT_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE), langGroup(NS_LITERAL_CSTRING("x-western")), sizeAdjust(0.0f) { } @@ -1236,9 +1236,8 @@ gfxFontStyle::gfxFontStyle() : gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, gfxFloat aSize, const nsACString& aLangGroup, float aSizeAdjust, PRPackedBool aSystemFont, - PRPackedBool aFamilyNameQuirks, - PRPackedBool aPrinterFont): - style(aStyle), systemFont(aSystemFont), printerFont(aPrinterFont), + PRPackedBool aFamilyNameQuirks) : + style(aStyle), systemFont(aSystemFont), familyNameQuirks(aFamilyNameQuirks), weight(aWeight), size(aSize), langGroup(aLangGroup), sizeAdjust(aSizeAdjust) { @@ -1262,7 +1261,7 @@ gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, gfxFloat aSize, } gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) : - style(aStyle.style), systemFont(aStyle.systemFont), printerFont(aStyle.printerFont), + style(aStyle.style), systemFont(aStyle.systemFont), familyNameQuirks(aStyle.familyNameQuirks), weight(aStyle.weight), size(aStyle.size), langGroup(aStyle.langGroup), sizeAdjust(aStyle.sizeAdjust) diff --git a/gfx/thebes/src/gfxPangoFonts.cpp b/gfx/thebes/src/gfxPangoFonts.cpp index 41ceb8edcb4c..bfafb65b8bb0 100644 --- a/gfx/thebes/src/gfxPangoFonts.cpp +++ b/gfx/thebes/src/gfxPangoFonts.cpp @@ -1712,7 +1712,7 @@ static void ApplyGdkScreenFontOptions(FcPattern *aPattern); // Apply user settings and defaults to pattern in preparation for matching. static void PrepareSortPattern(FcPattern *aPattern, double aFallbackSize, - double aSizeAdjustFactor, PRBool aIsPrinterFont) + double aSizeAdjustFactor) { FcConfigSubstitute(NULL, aPattern, FcMatchPattern); @@ -1728,17 +1728,8 @@ PrepareSortPattern(FcPattern *aPattern, double aFallbackSize, // Using an xlib surface would also be an option to get Screen font // options for non-GTK X11 toolkits, but less efficient than using GDK to // pick up dynamic changes. - if(aIsPrinterFont) { - cairo_font_options_t *options = cairo_font_options_create(); - cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY); - cairo_ft_font_options_substitute(options, aPattern); - cairo_font_options_destroy(options); - } #ifdef MOZ_WIDGET_GTK2 - else { - ApplyGdkScreenFontOptions(aPattern); - } + ApplyGdkScreenFontOptions(aPattern); #endif // Protect against any fontconfig settings that may have incorrectly @@ -1761,9 +1752,7 @@ gfx_pango_font_map_context_substitute(PangoFcFontMap *fontmap, // owned by the context PangoFontDescription *desc = pango_context_get_font_description(context); double size = pango_font_description_get_size(desc) / FLOAT_PANGO_SCALE; - gfxPangoFontGroup *fontGroup = GetFontGroup(context); - PRBool usePrinterFont = fontGroup && fontGroup->GetStyle()->printerFont; - PrepareSortPattern(pattern, size, 1.0, usePrinterFont); + PrepareSortPattern(pattern, size, 1.0); } static PangoFcFont * @@ -1979,7 +1968,7 @@ gfxPangoFontGroup::MakeFontSet(PangoLanguage *aLang, gfxFloat aSizeAdjustFactor, nsAutoRef pattern (gfxFontconfigUtils::NewPattern(fcFamilyList, mStyle, lang)); - PrepareSortPattern(pattern, mStyle.size, aSizeAdjustFactor, mStyle.printerFont); + PrepareSortPattern(pattern, mStyle.size, aSizeAdjustFactor); nsRefPtr fontset = new gfxFcPangoFontSet(pattern, mUserFontSet); @@ -2155,7 +2144,7 @@ gfxFcFont::GetOrMakeFont(FcPattern *aPattern) // string through FcNameUnparse() is more trouble than it's worth. NS_NAMED_LITERAL_CSTRING(langGroup, "x-unicode"); gfxFontStyle fontStyle(style, weight, size, langGroup, 0.0, - PR_TRUE, PR_FALSE, PR_FALSE); + PR_TRUE, PR_FALSE); nsRefPtr fe; FcChar8 *fc_file; diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp index 42656353a23a..f1c5b9e3b868 100644 --- a/layout/svg/base/src/nsSVGGlyphFrame.cpp +++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp @@ -1263,12 +1263,9 @@ nsSVGGlyphFrame::EnsureTextRun(float *aDrawScale, float *aMetricsScale, } const nsFont& font = fontData->mFont; - PRBool printerFont = (presContext->Type() == nsPresContext::eContext_PrintPreview || - presContext->Type() == nsPresContext::eContext_Print); gfxFontStyle fontStyle(font.style, font.weight, textRunSize, langGroup, font.sizeAdjust, font.systemFont, - font.familyNameQuirks, - printerFont); + font.familyNameQuirks); nsRefPtr fontGroup = gfxPlatform::GetPlatform()->CreateFontGroup(font.name, &fontStyle, presContext->GetUserFontSet());