Firefox font fallback

Perhaps I'm just misunderstanding something, but it seems like Firefox doesn't handle font fallback the way that I would consider to be correct.
Instead of respecting the font-family list defined in CSS, it appears to just take the first font from that list and use whatever fontconfig returns as the best match. In most cases, this is fine, but sometimes the first font listed in the CSS is one that I don't have, and in that case fontconfig returns something bogus, completely unlike the requested font. I understand why it does this, but in the specific case of rendering web pages, it would be preferable for the browser to just try the next font in the CSS list instead of blindly going with fontconfig's "best match".
Chromium seems to do the "right thing" in this case, so I know that it must be possible for Firefox as well. But it seems that no matter what I try, Firefox simply refuses to use anything other than the first font listed in the font-family list. This kind of defeats the whole purpose of having that list, doesn't it? Web designers shouldn't have to worry about specifying obscure fonts in CSS as long as they provide sane fallbacks.
I know about adding alias rules in fontconfig's config files so that fonts that I don't have will render using some other, similar font. But my /etc/fonts/local.conf is getting very large with all of my special case rules, and yet I still run into webpages, on nearly a daily basis, where the fonts are clearly wrong. If Firefox would just respect the way that CSS is supposed to work in this case, this wouldn't be necessary.
Am I the only one that sees this problem? Is there some configuration setting that I'm just stupidly overlooking here? Or am I stuck forever adding zillions of special rules to fontconfig for all the obscure fonts that web designers decide to use?
Last edited by tmhedberg (2011-07-31 07:08:59)

brebs wrote:Please provide some examples of bad web pages, and the fontconfig tweaks you're using.
Actually, I think I explained the problem poorly, and I omitted some relevant information from the original post.
To illustrate:
$ fc-match 'DejaVu Sans'
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match Century
DejaVuSans.ttf: "DejaVu Sans" "Book"
I don't have a font called "Century" installed, so fontconfig just falls back to its default, which happens to be DejaVu Sans. That's fine in the general case.
Here's a webpage with `font-family: Century, serif` in its CSS: http://goertzel.org/dynapsyc/yamaguchi.htm. So if Century is not available, Firefox should fall back to the default "serif" font set in the Firefox preferenes, which in my case is Times New Roman.
Instead, I get this ugliness: http://tmh.cc/img/ff_ugly.png
If I use Firebug to change the first font in the CSS font-family list to "DejaVu Sans", it looks good: http://tmh.cc/img/ff_dejavu.png. Or, if I just remove Century from the list entirely, so that it just says "serif", the I get Times New Roman, as expected: http://tmh.cc/img/ff_times.png.
So it seems that Firefox is consulting fontconfig for the first font in the CSS list, as I said before. But when fontconfig just returns its default font (or more likely, if the fontconfig value is too far off from what Firefox wants), then it's not using fontconfig's font, nor is it falling back to the second font in the CSS list. It just uses something completely different, and quite ugly.
My custom rules in /etc/fonts/local.conf are just a bunch of these:
<!-- Replace Times with Times New Roman -->
<match target="pattern" name="family">
<test name="family" qual="any">
<string>Times</string>
</test>
<edit name="family" mode="assign">
<string>Times New Roman</string>
</edit>
</match>
Each of which maps a font name that fontconfig doesn't match properly to a font that I actually have. But having to add so many of these rules specifically for Firefox when other applications, even other web browsers, seem to have no problem is very irritating and seems unneccesary. I suspect that I'm missing something obvious, hence this thread.

Similar Messages

  • I used IE first time in 3 years. I was able to READ the screen without my glasses. Didn't realize Firefox FONTS were so 'weak' Tried most everything to get Firefox fonts to look as bold and clean. Failed. Ideas please.

    I used IE first time in 3 years. When I did I was able to READ the screen without my glasses. Didn't realize Firefox FONTS were so 'weak' Tried most everything to get Firefox fonts to look as bold and clean. No luck.
    How do I get Firefox to DISPLAY a font as clear and clean as Word? I choose different fonts in Firefox and sizes and nothing really happens.

    You can use an extension to set a default font size and page zoom on web pages:
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *Anti-Aliasing Tuner: https://addons.mozilla.org/firefox/addon/anti-aliasing-tuner/

  • Firefox fonts in KDE extremely tiny

    I'm experiencing what seems to be a pretty common problem with the firefox fonts appearing really small in KDE.  I've tried several things:  Installed gtk-qt-engine --> That makes gtk apps look better in kde, but doesn't solve the firefox font problem.  I've also tried altering the fonts and dpi in the firefox setttings as well.  When I start x with
    startx -- -dpi 96
      That seems to blow up the fonts and firefox does appear much better.  However, is there a cleaner way to do this?  My dpi is listing at 72 right now.

    Yes, that's because of pango.
    I used to experience the small fonts, but after I set MOZ_DISABLE_PANGO to 1 the fonts were bigger. In addition, I think the small fonts are better.

  • Firefox fonts look different from Chromiums

    Hi, my Firefox fonts look different than the ones Chromium uses:
    Left is Firefox, right is chrome. As you can see, the placement of characters is somewhat different.
    This is NOT the issue mentioned on the Firefox Wiki page, at least it is not fixed with the fontconfig.
    What happens here?
    Thank you,
    Jan Oliver

    I have "serif" , "sans serif" and "monospace" in the selections, "serif" being the default.
    I applied the fix from here, and it did smoothen the fonts, but the letter placing is still bad as in the screenshot.

  • Since I updated to the new Firefox, fonts are defaulting incorrectly on some websites. Instead of pulling a web font or something like Arial, it's pulling specialty fonts from my fontbook. Is this a Firefox or Mac problem?

    Here is a screenshot of what I'm talking about [http://cl.ly/1P0O0U1s0K0W0r142N22 http://cl.ly/1P0O0U1s0K0W0r142N22]
    This is not happening in other browsers on my computer, and just started when I updated to the latest version of Firefox.

    You can do a check for corrupted fonts and other font issues:
    * http://www.creativetechs.com/iq/garbled_fonts_troubleshooting_guide.html - CreativeTechs Tips: Garbled Fonts Troubleshooting Guide
    * http://www.thexlab.com/faqs/multipleappsquit.html - Font Book 2.0 Help: Checking for damaged fonts

  • Font embedding and font fallback

    I am attemping to use Myriad Pro as an embedded font in my
    Flex application. Unfortunately, this application must support
    international input and Myriad Pro does not have the necessary
    glyphs to display, e.g. Japanese. Text using glyphs not in the font
    appears as simply blank. I've tried to add a fallback for these
    glyphs, e.g. 'fontFamily: "Myriad Pro", "Arial Unicode MS"' but if
    I do that the embedded font is ignored and it always uses Arial
    Unicode MS. Is there any way I can support i18n and use the
    embedded font simultaneously?

    And I just found this...
    "Beginning with Flash Professional CS5, Flash automatically embeds all characters used by any text objects that contain text."
    So basically I don't need to build out the embedded font.

  • The Firefox font is too small on the homepage and all websites. How do I change it?

    I loaded the latest version of Firefox. The font is so small that I can't read websites, etc. I looked through all of the help suggestions and nothing worked. Zooming doesn't hold; changing the font size makes web content overlap, changing the scale didn't help. The Firefox Help page has the perfect font size. Why can't that be used for everything else. This is a make or break for me and many others whether we use Firefox. I have a network of 68 people and we are all experiencing the same thing. Even with glasses, it is too difficult to read.

    There are some add-ons that can be used to change the zoom level on all sites, for example:
    * NoSquint - https://addons.mozilla.org/firefox/addon/nosquint
    * Default FullZoom Level - https://addons.mozilla.org/firefox/addon/default-fullzoom-level

  • Firefox font issues

    System: eMac G3 running 10.3.9
    Firefox: current (2.0.0.14), but affected prior versions also
    Classic installed? yes
    User-specific? yes
    User has unique language preferences as international options? Yes. All languages, however, require an essentially Latin characterset. (Not Central European, Cyrillic, Chinese etc.) Same settings cause Firefox no issues on a machine running Tiger.
    Persists on restart, after verifying/repairing disk, after repairing permissions etc.
    Have tried trashing ~/Caches/Firefox and ~/Application Support/Firefox. Have also tried doing this, switching language order (so an English is top) in System Preferences and restarting Firefox with no effect.
    Have tried trashing /Library/Caches/com.apple.ATS/uid.*, ~/Caches/Firefox, ~/Application Support/Firefox and logging out and back in.
    Symptoms: fonts in location bar, dialog boxes etc. are small, wobbly and generally peculiar-looking as if they have been written in a cramped, wobbly hand. Errors in console.log are roughly as follows (sorry, I'm having to do this from memory):
    ... cannot map file /Applications/Firefox.app/Contents/MacOS/plugins/Default Plugin.plugin ...
    ... cannot map file /Applications/Firefox.app/Contents/MacOS/plugins/JavaEmbeddingPlugin.bundle ...
    ... cannot map file /Applications/Firefox.app/Contents/MacOS/plugins/MRJPlugin.plugin ...
    three lines of errors specifically about the MRJPlugin
    ... cannot map file /Library/Internet Plug-Ins/QuickTime Plugin.plugin ...
    and similar lines for all entries in this directory (QT given as example)
    Fonts in actual web pages appear OK.
    Firefox -> Preferences -> Content shows nothing for Default Font. Under the advanced options, I have:
    Fonts for: Western
    proportional: serif
    serif: <blank>
    non-serif: <blank>
    monospace: <blank>
    Allow pages to choose own fonts is checked.
    Default encoding: Western (ISO-something-I-forget-but-looked-normal)
    Attempting to change a font yields an oddly restrictive list of options. For example, I might get "Times CY" or "Times CE" but not Times. All fonts seem to be non-English/non-Latin options.
    No non-default fonts are installed at either user or system level other than any installed with applications such as Adobe Reader, AppleWorks etc. ~/Library/Fonts/ is empty.
    Any suggestions would be welcome.
    - cfr

    jsd2 wrote:
    Maybe browsing to about:config and filtering on "font" would show something of interest .
    Hmm... Yes. I'll try that next time I'm on the machine in question. I'm pretty sure it is profile specific so would have thought a clean profile would solve issues that would show up here, but definitely worth checking.
    Might be worth asking or searching at Mozilla's Firefox support forum-
    http://forums.mozillazine.org/viewforum.php?f=38
    That was to be my next port of call. I posted here first because it seems to be specific to a particular Mac/version of the OS and to be specific to a user account but not a profile. Mainly, though, I posted here first because I'm already registered here and hate the proliferation of accounts I seem to need online these days! (I know I can post on the Mozilla forums anonymously but I'm fussy and like to know if anybody answers without having to keep checking. There's just no pleasing some of us...)
    Thanks,
    cfr

  • Certain special characters do not display correctly in Firefox ( font COLOR="#1f1a17" FACE="Symbol" SIZE="3" ¬ /font ). Is there a fix?

    Certain special characters which display correctly in Explorer do not display correctly in Firefox. Example: <font COLOR="#1f1a17" FACE="Symbol" SIZE="3">¬</font>
    Is there a fix?

    The symbol font usually doesn't work in Firefox, a website needs to use an Unicode replacement or an HTML entity to specify such a character.
    See:
    *[https://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ#Why_aren.e2.80.99t_symbol.2fdingbat_fonts_working.3f Why aren’t symbol/dingbat fonts working? - MDC FAQ]
    *http://en.wikipedia.org/wiki/Unicode_symbols
    *http://en.wikibooks.org/wiki/Unicode/Character_reference/2000-2FFF

  • Firefox font too small in google website

    I have the dpi set to 96 in gnome, dpi in about:config is at 0. But the odd thing is that google's search results website is very small. The rest of the websites(as far as I know) have good font size.
    I've set "Allow pages to choose their own fonts..." in Firefox as well. But didn't set a minimum font size. It worked in my last install without needed to increase the minimum size.
    How do I fix this?

    I had the same Problem after my installation. Setting gtk-font-name in .gtkrc-2.0 may help. I think that's the way I solved this problem. My .gtkrc-2.0 looks like this:
    gtk-font-name="Nimbus Sans L 10"
    Fill in your favorite font and have a try. If the file .gtkrc-2.0 doesn't exist in your home directory, create it.
    Last edited by gaucho (2009-05-09 09:35:22)

  • [SOLVED] Gnome & Firefox: Fonts are too small

    Hi,
    I am really used to using firefox in Windows XP where fonts are readable out-of-the-box. By this I mean I didn't have to fiddle with firefox when I installed it, the fonts looked great.
    Now that I'm using Gnome, I see that firefox's fonts are really too small. The glyphs are smashed together too. How can I get the fonts to look decent in firefox? I'm not sure if this is an OS-level setting or a firefox-level setting.
    Last edited by void.pointer (2009-02-04 04:57:55)

    If you have an LCD monitor, try this:
    Copy & paste the code below into a file called
    .fonts.conf
    [NOTE: It's a hidden file ! ]
    and save it in your home directory. Log out & in again and fire up The Fox !
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- the cathectic LCD tweaks, from linuxquestions.org,
    http://www.linuxquestions.org/questions/showthread.php?postid=1361098#post1361098 -->
    <fontconfig>
    <!-- Disable sub-pixel rendering. X detects it anyway, and if you set this as well, it just looks really horrible -->
    <match target="font" >
    <edit mode="assign" name="rgba" >
    <const>none</const>
    </edit>
    </match>
    <match target="font" >
    <edit mode="assign" name="hinting">
    <bool>true</bool>
    </edit>
    </match>
    <match target="font" >
    <edit mode="assign" name="hintstyle">
    <const>hintfull</const>
    </edit>
    </match>
    <!-- The first part of the 'magic.' This makes the fonts start to look nice, but some of the shapes will be distorted, so hinting is
    needed still -->
    <match target="font" >
    <edit mode="assign" name="antialias">
    <bool>true</bool>
    </edit>
    </match>
    <!-- Autohinter is not turned on automatically. Only disable this if you have recompiled Freetype with the bytecode interpreter, which
    is run automatically. Although to be honest, Freetype are right, there isn't much difference between the two. Note that OpenOffice is
    built against the bytecode interpreter, so even if you have compiled it and override it with the autohinter, OOo will still use the
    bytecode interpreter -->
    <match target="pattern" >
    <edit mode="assign" name="autohint">
    <bool>true</bool>
    </edit>
    </match>
    <!-- Helvetica is a non true type font, and will look bad. This replaces it with whatever is the default sans-serif font -->
    <match target="pattern" name="family" >
    <test name="family" qual="any" >
    <string>Helvetica</string>
    </test>
    <edit mode="assign" name="family" >
    <string>sans-serif</string>
    </edit>
    </match>
    <dir>~/.fonts</dir>
    </fontconfig>
    All credit to LinuxQuestions for this conf file.
    Deej

  • How do I change language-specific font fallback preferences?

    My MacBook's default fonts for viewing content in the Malayalam script/language seem to be Malayalam MN and Malayalam Sangam MN -- not surprisingly, since those are the default Malayalam fonts that come with the OS.  However, both of those fonts are missing a lot of conjuncts/ligatures.  There are some free fonts that do have the missing characters, so I'd like to put them at the top of whatever preference list the OS is using to decide which fonts to choose.  Does anybody know how I can do that?

    Amazing: Someone with knowledge of both OSX and Malayalam orthography  answers my question within hours of my posting it.  Thank you, Tom!
    I tried your suggestions.  Disabling the Apple-provided fonts didn't seem to do anything, and moving them to the trash transformed the Thiruvananthapuram page I linked above into a sea of placeholder characters.  So I put them back and tried editing the preference list.  I inserted Anjali Old Lipi above Malayalam Sangam MN, and I also inserted Rachana (another free font available from the Kerala government site above) above Malayalam MN.  Then I restarted.
    At first I thought it hadn't worked, because the body of the Thiruvananthapuram page looked exactly the same.  But then I noticed that the page title, up in the top edge of the window, was displaying the characters I wanted.  And when I tried copying some text and pasting it into TextEdit, it appeared in either Anjali (when I pasted into a plain text document) or Rachana (in rich text).  Finally it dawned on me that I needed to adjust my Firefox preferences too, and that did the trick.  Probably I wouldn't have needed to edit the preference list if I'd thought of changing my Firefox preferences earlier, but I'm glad to have learned how to make the change systemwide.
    Slightly off-topic: I've read that acceptance of the 1970s reforms has been less than universal, and in the process of finding those alternate fonts I noticed that a different fork of Anjali has actually had some of the conjuncts removed.  If you happen to know, I'd be curious:  Just how much of a free-for-all is Malayalam spelling today?

  • Konqueror-Firefox-Fonts

    Hi!
    I use same fonts in Firefox and Konqueror but Firefox for example show me:
    [mu:.krum.pus], [frum.pus]
    and Konqueror:
    [muː.krum.pus], [frum.pus]
    Thanks.

    lumiwa wrote:
    FrankVaLi wrote:
    I had that problem as well, and after trying to figure out exactly what the problem is I lost my patience and reinstalled...
    pacman -S pango fontconfig freetype1 freetype2 libfontenc libxfont libxft
    I still don't know what worked...
    Thanks
    I reinstalled fontconfig libfontenc libxfont and libxft and now is okay.
    I was to fast...
    It is not okay. When I again changed no-bitmats-fonts to yes-bitmats-fonts I hava a problem again....

  • Firefox font problem

    Hello,
    I've been experiencing a lot of problems lately regarding Firefox and font rendering. I keep seeing the problem displayed in this image:
    http://img61.imageshack.us/img61/5748/firefoxfontap1.png
    It appears to happen whenever a font changes on a webpage (such as going from normal text to a url, or going from one font to another). It only appears in Firefox (and sometimes Mozilla Thunderbird). Has anyone else experienced this problem? Any advice on what I should do to fix it?

    Hello,
    This might be a simple solution. Try trashing this file and see if it makes a difference.
    org.mozilla.firefox.plist It's here: /Home/Library/Preferences. Open the Preferences folder, scroll almost down to the bottom of the list, locate that file, drag it to the Trash, empty the Trash and reboot. See if that makes a diff with your fonts in Firefox.
    If that doesn't do the trick... launch Firefox. Click Firefox from the Menu, then click Preferences. In the Preferences window click the Content button. At the bottom where it says: Fonts and Colors click the Advanced button. Click the box where it says: Allow pages to choose their own fonts, instead of my selections above. See if that helps...
    Carolyn

  • Firefox fonts keep changing colors.

    When I go to a webpage and try to start reading.......the text starts changing colors and the font changes to weird looking symbols, like an alien font and can not be read. If I highlight the text.....it will correct....but will return to alien within a min. But the biggest problem with firefox is it's inability to scroll smoothly. I have used firefox for about six yrs. now and this problem has never been fixed. I have used firefox on many hardware platforms and many windows operating systems.....firefox has always had a horrible scroll. I appreciate any help...but have tried the option settings for yrs. now to no avail. I'm afraid my frustration will take me to a different browser.

    Thank you very much. That seems to work very well. I really do appreciate it. The same thing has been going on with my girlfriend's rig. I also found this...."I was trying to get the same impression of ease and speed Chrome scroll has from Firefox 17 @ Linux, AMD64 and after trying several setups here is how to make your Firefox to give even better feel than Chrome:
    1. Set mousewheel.min_line_scroll_amount to 40 (WAS 5)
    That was a great start though Firefox scroll will still appeared jerky. (Chrome has that value lower, but I liked it at 40)
    2. Set general.smoothScroll and general.smoothScroll.pages to false
    Smooth scrolling is bad for the IT professionals giving extra pressure to the eyes and Chrome doesn't use it in the same way as Firefox does. Now we're close but still all the pages in tabs are a bit jerky.
    3. And now the final ingredient. It appears that all the hieratic scroll was caused by image discard check routine. Do not turn it off just set image.mem.min_discard_timeout_ms to something really large, I set mine to 2100000000 (WAS 10000)
    After that increase image.mem.max_decoded_image_kb to at least 512K (WAS 256000)
    Done. In my case (Gentoo, amd64) this setup changed how the page within tab scrolls (very smooth now), how FF switches between tabs (it's now very smooth too, chrome like) and overall impression of how all the opened tabs are performing was increased. May be the change is not same within different systems but it's worth a try if you want to improve FF responsiveness. "
    I tried that and it seems to tame the scrolling down quite a bit. Not sure what it all does....but it allows me to keep firefox and I do thank you.
    earl

Maybe you are looking for