Bad font rendering in Firefox

I have bad font rendering in web pages with Firefox. In Chrome everything is OK. I am using plasma.

Any ideas what can i do?

It’s not only Firefox though, but any program using fontconfig…

  1. Close browser

  2. Enable LCD filter

    sudo ln -fs /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/
    
  3. Rebuild font cache

    fc-cache --force
    

Why it happened?

Starting from FreeType 2.10.3, Arch Linux enables ClearType subpixel rendering by default [4] .

When using ClearType subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing.

(c) https://wiki.archlinux.org/index.php/Font_configuration

4 Likes

I have done this. Still the same. Take a look
Screenshot_2021-04-08 DistroWatch com Put the fun back into computing Use Linux, BSD

It’s not clear what exactly you mean by bad rendering, clarify please…
And can you make side by side screenshot of same page between Firefox and Chrome?

Chrome
Screenshot_20210408_195202

Firefox
Screenshot_20210408_195328

Well it seems normal to me from the screenshot. But I’m interested in this because since I don’t see any issue I might be with that problem since forever :slight_smile:

I just dont like the rendering of fonts in Firefox compared to Chrome

TO ME, the screenshots look like the fonts are rendered the same…

There are some differences in how engines render text Chrome’s engine by default renders fonts visually “bolder”, especially on some specific font sizes (some webdevs might choose to mitigate this, most don’t) effect also depends on specific font in use

I’m afraid if that’s what you mean you can’t really “solve” it…

For a test, can you screenshots this page (with hardcoded different fonts than default Liberation sans at least for headings), i’d like to see how it renders for you side by side

https://developer.mozilla.org/en-US/

Firefox
Screenshot_20210408_200454

Chrome
Screenshot_20210408_200516

What is your fonts settings in Firefox by the way? In each category

Looks to me like you have zoomed to something other thatn 100% in one of your browsers, that’s not fair…avoid zoom at all costs for quality typographic btw, especially when posting comparison :upside_down_face:

image

But it doesn’t really matter, because most pages are set to something like Arial and stuff, so it will reset to some values like Liberation sans, if you want to override it, do it with fontconfig:

To know your current values for popular ones, run this in terminal / script:

for family in serif sans-serif monospace Arial Helvetica Verdana "Times New Roman" "Courier New";
do
    echo -n "$family: "
    fc-match "$family"
done

and here’s some relevant info on how to override web’s favorite defaults from Win / Mac, if you want

2 Likes

I try all this. I guess maybe i was a chrome user for to long. Thanks a lot my friend

2 Likes

This worked for me too, thanks (worthwile putting in FAQ?).

1 Like

Certainly, it’s FAQ indeed…I’ll make it

2 Likes

It seems the “conf.avail” directory no longer exists:

ls /etc/fonts
conf.d fonts.conf

…and I found this entry in the Arch-Wiki wich is new to me:

Note: For some desktop environments (such as GNOME and KDE) using the Font Control Panel will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior. Also ensure that the desktop locale settings or Regional Settings are supported by the configured fonts, if not the font configuration could be overidden.

…and further this one

Note: Configuration files and directories: ~/.fonts.conf/ , ~/.fonts.conf.d/ and ~/.fontconfig/*.cache-* are deprecated and will not be read by default in the future versions of the package. New paths are $XDG_CONFIG_HOME/fontconfig/fonts.conf , $XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf and $XDG_CACHE_HOME/fontconfig/*.cache-* respectively. If using the second location, make sure the naming is valid (where NN is a two digit number like 00 , 10 , or 99 ).

After deleting the (now broken) link @keybreak suggests my font rendering is OK again.

Again there must have been something modified in this fontconfig mess :confused:

Ooops! I forgot to mention that I had created a file “$XDG_CONFIG_HOME/fontconfig/fonts.conf”
with this content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>
 <dir>~/.fonts</dir>
</fontconfig>

This is the solution to my problem.

I don’t think that’s normal, have just tested latest :enos: .iso with XFCE and KDE in VM - it’s still there :thinking:

Yep, that’s the thing - however sometimes de fails to fix all that fontconfig crap :laughing:

P.S. @Tinymeat Dammit, you’re right some update killz /etc/fonts/conf.avail/ :exploding_head:

1 Like

Are any of the problems here related to the use of bitmap fonts? I’ve previously found that the solution in the following link has solved issues around MS founds rendering badly for me:

https://wiki.archlinux.org/index.php/Font_configuration#Disable_bitmap_fonts

nano ~/.config/fontconfig/conf.d/20-no-embedded.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>

@Tinymeat

Updated link now…
It’s hard to keep up with fontconfig changes :rofl:
Thx :+1:

@AndreasDimo
Try to run new link from FAQ, perhaps it will improve your Firefox situation a bit :upside_down_face:

1 Like

Can you paste here exactly what to try? I have a little difficult to translate and i am afraid of doing something wrong and mess mt system