Bug 1148330 - Remove Linux system generic fonts that collide with CSS generic fonts from preferences; r=mkmelin, a=rkent
authorJorg K <mozilla@jorgk.com>
Sun, 19 Apr 2015 06:47:00 +0200
changeset 22301 49615525b791c363d64e74e1e273296ff5638807
parent 22300 a74742812d519a6dc151f131b91ca1d90a54b5af
child 22302 e0fa5f7f42889ca73cd704f56f4dffbb0e52d820
push idunknown
push userunknown
push dateunknown
reviewersmkmelin, rkent
bugs1148330
Bug 1148330 - Remove Linux system generic fonts that collide with CSS generic fonts from preferences; r=mkmelin, a=rkent
mail/components/preferences/compose.js
--- a/mail/components/preferences/compose.js
+++ b/mail/components/preferences/compose.js
@@ -210,17 +210,19 @@ var gComposePane = {
     try
     {
       var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
                                  .getService(Components.interfaces.nsIFontEnumerator);
       var localFontCount = { value: 0 }
       var localFonts = enumerator.EnumerateAllFonts(localFontCount);
       for (var i = 0; i < localFonts.length; ++i)
       {
-        if (localFonts[i] != "")
+        // Remove Linux system generic fonts that collide with CSS generic fonts.
+        if (localFonts[i] != "" && localFonts[i] != "serif" &&
+            localFonts[i] != "sans-serif" && localFonts[i] != "monospace")
           fontsList.appendItem(localFonts[i], localFonts[i]);
       }
     }
     catch(e) { }
     // Choose the item after the list is completely generated.
     var preference = document.getElementById(fontsList.getAttribute("preference"));
     fontsList.value = preference.value;
    },