From 5adb562d622e6467cd335211af4459592cc4d64b Mon Sep 17 00:00:00 2001 From: John Daggett Date: Tue, 2 Jun 2015 17:20:15 +0900 Subject: [PATCH] Bug 1170421 - return first font suggested by fontconfig as the default font. r=karlt --- gfx/thebes/gfxFcPlatformFontList.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index a015845cde9..003dce59d96 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -1145,7 +1145,10 @@ gfxFcPlatformFontList::GetFontList(nsIAtom *aLangGroup, gfxFontFamily* gfxFcPlatformFontList::GetDefaultFont(const gfxFontStyle* aStyle) { - return FindGenericFamily(NS_LITERAL_STRING("serif"), nsGkAtoms::x_western); + // Get the default font by using a fake name to retrieve the first + // scalable font that fontconfig suggests for the given language. + return FindGenericFamily(NS_LITERAL_STRING("-moz-default"), + aStyle->language); } gfxFontEntry*