3

As Ubuntu obtains its packages from Debian repositories, I would like to know if Ubuntu developers do some modification to the original Debian packages to improve font rendering.

I ask this because I just installed Debian 10 and the font rendering is worse than Ubuntu, even after downloading Ubuntu fonts and configuring Gnome Tweaks to use it with the same values of Ubuntu (including Subpixel and Hinting values).

Thank you!

1

1 Answer 1

9

Yes, there are a number of differences between the Debian and Ubuntu versions of the fontconfig package, which is the package which handles font rendering:

  • DejaVu is preferred to BitStream Vera;
  • the lcdlegacy filter is applied to DejaVu Sans Mono up to 12 pixels;
  • anti-aliasing is enabled in the engine.

You can replicate all this on your Debian system:

  • edit /etc/fonts/conf.d/60-latin.conf and swap the DejaVu and BitStream Vera entries;
  • add /etc/fonts/conf.d/53-monospace-lcd-filter.conf with the following contents:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- conf.d/monospace-lcd-filter.conf -->
    <fontconfig>
    <!--  Use legacy LCD filter on smaller Monospace fonts -->
      <match target="pattern">
        <test name="family">
          <string>DejaVu Sans Mono</string>
        </test>
        <test name="pixelsize" compare="less_eq">
          <double>12.0</double>
        </test>
    
        <edit name="lcd_filter" mode="append">
          <const>lcdlegacy</const>
        </edit>
        <edit name="hintstyle" mode="append">
          <const>hintfull</const>
        </edit>
      </match>
      <match target="pattern">
        <test name="family">
          <string>Bitstream Vera Sans Mono</string>
        </test>
        <test name="pixelsize" compare="less_eq">
          <double>12.0</double>
        </test>
    
        <edit name="lcd_filter" mode="append">
          <const>lcdlegacy</const>
        </edit>
        <edit name="hintstyle" mode="append">
          <const>hintfull</const>
        </edit>
      </match>
    </fontconfig>
    
  • add /etc/fonts/conf.d/10-antialias.conf with the following contents:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <!--  Use the Antialiasing -->
      <match target="pattern">
        <edit name="antialias" mode="append"><bool>true</bool></edit>
      </match>
    </fontconfig>
    
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .