# Fonts really ugly in Firefox, Webkit



## Carpetsmoker (Nov 9, 2012)

My fonts look great in Opera & just about every other program I've ever used on FreeBSD.

Except Firefox and webkit.

Here's a screenshot comparing Opera to webkit:
http://arp242.net/tmp/2012-11-08-224518_1680x1050_scrot.png

Installing the `webfonts' is not a solution IMHO. I'd prefer to just use the Bitstream fonts.

I also tried mucking about with my ~/.fonts.conf as suggested here, but I couldn't get it to look acceptable, not to mention it had the unfortunate side-effect of making every other font look ugly!

I don't understand why this can't `just work'â„¢ for Firefox and Webkit ...


----------



## jrm@ (Nov 9, 2012)

This guide worked for me.


----------



## Carpetsmoker (Nov 9, 2012)

Thanks, while this does improve things slightly, it's not really a `complete' solution.

http://arp242.net/tmp/2012-11-09-105607_3840x1080_scrot.png

- Notice how the text `DOCTYPE' and `1.0' look awkward compared to Opera. Almost like it's bold!
- Also notice how my xterm font has changed! The top is the font with the new settings. the `0' at the top looks like it's been in a car accident!


----------



## Carpetsmoker (Nov 12, 2012)

After some investigation it appears that Firefox/Webkit are using the `Lucida' and/or `Helvetica' fonts, other fonts look fine.
I don't know why these fonts are so ugly or why Opera skips these fonts. Perhaps this is a Opera feature to prevent your page from becoming really ugly?

In any case, removing the following ports fixed the problem for now:

x11-fonts/font-cronyx-cyrillic
x11-fonts/font-adobe-75dpi
x11-fonts/font-adobe-100dpi
x11-fonts/font-bh-lucidatypewriter-100dpi
x11-fonts/font-bh-100dpi
x11-fonts/font-bh-75dpi

Note that these are all installed as a dependency of x11/xorg, so this is not a `proper' solution ... Perhaps ~/.fonts.conf can be set to ignore certain fonts ...


----------



## wblock@ (Nov 12, 2012)

I just set the fonts in Firefox manually.  Install x11-fonts/bitstream-vera.  In Firefox, Edit/Preferences, Content, Advanced, Proportional: Sans Serif 14, Serif: sans-serif, Sans-serif: Bitstream Vera Sans, Monospace: monospace 13.  Then turn off the checkbox for "Allow pages to choose their own fonts".


----------



## graemeg (Feb 28, 2013)

I had the exact same problem as the original poster. I managed to fix it as follows.

Rebuild and Install print/freetype2

```
make WITH_LCD_FILTERING=yes
     make install clean
```

Install x11-fonts/webfonts
Install x11-fonts/liberation-fonts-ttf

Add symlinks to /usr/local/etc/fonts/conf.d/

```
10-autohint.conf
     10-sub-pixel-rgb.conf
     70-yes-bitmaps.conf
```

I have a ~/.fonts.conf file with the following.

```
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</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>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>

 <!-- Here comes the font substitution -->
 <match target="pattern" name="family">
  <test name="family" qual="any">
   <string>Times</string>
  </test>
  <edit binding="strong" mode="prepend" name="family">
   <string>Liberation Serif</string>
  </edit>
 </match>

</fontconfig>
```

Run: fc-cache -f
Then restart X11.

My fonts in my own developed applications (that use freetype), Firefox, Thunderbird etc all looked crisp and clear again. Finally!


----------



## graemeg (Feb 28, 2013)

Some more testing with my X11 setup... I like thin and crisp fonts, with rgb anti-aliasing for my LCD monitor. The previous setup I gave might sometime make some fonts look too bold looking. It seems the /usr/local/etc/fonts/conf.d/ and the ~/.fonts.conf settings could duplicate a font effect if an effect is specified in both configurations.

If so, then simply remove the following two symlinks [which I added myself before] from /usr/local/etc/fonts/conf.d/

```
10-autohint.conf
  10-sub-pixel-rgb.conf
```

Now my setup is perfect.


----------

