backout b=403513 due to compile error in gfxFontSelectionTest.cpp

This commit is contained in:
Karl Tomlinson 2008-12-17 13:57:40 +13:00
Родитель 7d9de4223a
Коммит dea545b65e
8 изменённых файлов: 14 добавлений и 48 удалений

Просмотреть файл

@ -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");

Просмотреть файл

@ -148,12 +148,6 @@ nsThebesDeviceContext::Shutdown()
gSystemFonts = nsnull;
}
PRBool
nsThebesDeviceContext::IsPrinterSurface()
{
return(mPrintingSurface != NULL);
}
nsresult
nsThebesDeviceContext::SetDPI()
{

Просмотреть файл

@ -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();

Просмотреть файл

@ -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,

Просмотреть файл

@ -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)) &&

Просмотреть файл

@ -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)

Просмотреть файл

@ -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<FcPattern> pattern
(gfxFontconfigUtils::NewPattern(fcFamilyList, mStyle, lang));
PrepareSortPattern(pattern, mStyle.size, aSizeAdjustFactor, mStyle.printerFont);
PrepareSortPattern(pattern, mStyle.size, aSizeAdjustFactor);
nsRefPtr<gfxFcPangoFontSet> 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<gfxFontEntry> fe;
FcChar8 *fc_file;

Просмотреть файл

@ -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<gfxFontGroup> fontGroup =
gfxPlatform::GetPlatform()->CreateFontGroup(font.name, &fontStyle, presContext->GetUserFontSet());