bug 764805 - fix handling of src:local style properties in the GDI backend. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Thu, 28 Jun 2012 10:59:37 +0100
changeset 97845 2ab61c8b46d8f4b17303b04b7123699576cf521f
parent 97844 dcf8693ba5e159ae66de9a6548602a98650c04f9
child 97846 367d0809c8f919b6c5c9a9b12d51630c2a562398
push id11250
push userjkew@mozilla.com
push dateThu, 28 Jun 2012 10:00:21 +0000
treeherdermozilla-inbound@367d0809c8f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs764805
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 764805 - fix handling of src:local style properties in the GDI backend. r=jdaggett
gfx/thebes/gfxGDIFontList.cpp
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -744,34 +744,37 @@ gfxGDIFontList::LookupLocalFont(const gf
 
     // lookup in name lookup tables, return null if not found
     if (!(lookup = mPostscriptNames.GetWeak(aFullname)) &&
         !(lookup = mFullnames.GetWeak(aFullname))) 
     {
         return nsnull;
     }
 
-    // create a new font entry with the proxy entry style characteristics
-    PRUint16 w = (aProxyEntry->mWeight == 0 ? 400 : aProxyEntry->mWeight);
     bool isCFF = false; // jtdfix -- need to determine this
     
     // use the face name from the lookup font entry, which will be the localized
     // face name which GDI mapping tables use (e.g. with the system locale set to
     // Dutch, a fullname of 'Arial Bold' will find a font entry with the face name
     // 'Arial Vet' which can be used as a key in GDI font lookups).
-    gfxFontEntry *fe = GDIFontEntry::CreateFontEntry(lookup->Name(), 
+    GDIFontEntry *fe = GDIFontEntry::CreateFontEntry(lookup->Name(), 
         gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/, 
-        PRUint32(aProxyEntry->mItalic ? NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL), 
-        w, aProxyEntry->mStretch, nsnull);
+        lookup->mItalic ? NS_FONT_STYLE_ITALIC : NS_FONT_STYLE_NORMAL,
+        lookup->mWeight, aProxyEntry->mStretch, nsnull);
         
     if (!fe)
         return nsnull;
 
     fe->mIsUserFont = true;
     fe->mIsLocalUserFont = true;
+
+    // make the new font entry match the proxy entry style characteristics
+    fe->mWeight = (aProxyEntry->mWeight == 0 ? 400 : aProxyEntry->mWeight);
+    fe->mItalic = aProxyEntry->mItalic;
+
     return fe;
 }
 
 void gfxGDIFontList::InitializeFontEmbeddingProcs()
 {
     static HMODULE fontlib = LoadLibraryW(L"t2embed.dll");
     if (!fontlib)
         return;