Как в Debian улучшить рендеринг шрифтов как в Ubuntu

Известно, что рендеринг шрифтов в Debian хуже, чем например в том же Ubuntu.  Через графический интерфейс исправить это нельзя.  Для того, чтобы исправить этот недостаток, установите пакет ttf-ubuntu-font-family, содержащий шрифты Ubuntu.

sudo apt-get install ttf-ubuntu-font-family

Далее создаем файл /etc/fonts/local.conf и копируем туда следующюю конфигурацию:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">

<!-- Font rasterization converts vector font data to bitmap data so that it
     can be displayed. The result can appear jagged due to aliasing.
     Anti-aliasing increases the apparent resolution of font edges. -->
        <edit mode="append" name="antialias">
            <bool>true</bool>
        </edit>

<!-- Using normal hinting, TrueType hinting instructions in the font are
     interpreted by freetype's Byte-Code Interpreter. This works best for
     fonts with good hinting instructions. -->
        <edit mode="append" name="hinting">
            <bool>true</bool>
        </edit>

<!-- Auto-discovery for hinting. This looks worse than normal hinting for
     fonts with good instructions, but better for those with poor or no
     instructions. The autohinter and subpixel rendering are not designed
     to work together and should not be used in combination. -->
        <edit mode="append" name="autohint">
            <bool>false</bool>
        </edit>

<!-- Hint style is the amount of influence the hinting mode has. Hinting
     can be set to: "hintfull", "hintmedium", "hintslight" and "hintnone".
     With BCI hinting, "hintfull" should work best for most fonts.
     With the autohinter, "hintslight" is recommended. -->
        <edit mode="append" name="hintstyle">
            <const>hintslight</const>
        </edit>

<!-- Subpixel rendering effectively triples the horizontal (or vertical)
     resolution for fonts by making use of subpixels. The autohinter and
     subpixel rendering are not designed to work together and should not
     be used in combination. Most monitors manufactured today use the
     Red, Green, Blue (RGB) specification. Fontconfig will need to know
     your monitor type to be able to display your fonts correctly.
     Values are "rgb" (most common), "bgr", "vrgb" (vertical), "vbgr",
     "unknown" or "none". -->
        <edit mode="append" name="rgba">
            <const>rgb</const>
        </edit>

<!-- When using subpixel rendering, you should enable the LCD filter,
     which is designed to reduce colour fringing. The "lcddefault" filter
     will work for most users. Other filters are available that can be
     used in special situations: "lcdlight"; a lighter filter ideal for
     fonts that look too bold or fuzzy; "lcdlegacy", the original Cairo
     filter; "lcdnone" to disable it entirely. -->
        <edit mode="append" name="lcdfilter">
            <const>lcddefault</const>
        </edit>

<!-- Fontconfig should be able to detect DPI parameters as discovered
     by the Xorg server. You can check Xorg's automatically discovered
     DPI with the command 'xdpyinfo | grep resolution'
     Uncomment the following to activate customized DPI -->
<!--
        <edit mode="append" name="dpi">
            <double>96</double>
        </edit>
-->

<!-- Some scalable fonts have embedded bitmap versions which are rendered
     instead, mainly at smaller sizes. Force using scalable fonts at all
     sizes by disabling embedded bitmap. -->
        <edit mode="append" name="embeddedbitmap">
            <bool>false</bool>
        </edit>

    </match>

<!-- Use font substitution to set your preferred fonts the default
     serif, sans-serif and monospace fonts. You can also substitute
     a specific font not installed on the system (e.g. Arial) with
     an installed one (e.g. FreeSans) by adding other aliases like
     these. This only works if the original font is not on the system. -->
    <alias>
        <family>serif</family>
        <prefer><family>DejaVu Serif</family></prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer><family>Ubuntu</family></prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer><family>Ubuntu Mono</family></prefer>
    </alias>
<!--
    <alias>
        <family>Arial</family>
        <prefer><family>FreeSans</family></prefer>
    </alias>
-->

<!-- Reject bitmap fonts in favour of Truetype, Postscript, etc. -->
    <selectfont><rejectfont><pattern>
        <patelt name="scalable"><bool>false</bool></patelt>
    </pattern></rejectfont></selectfont>

<!-- Patch to fix Ubuntu font family behavior. 'Medium'
     variant is used instead of 'Regular' on Qt apps. -->
    <match target="scan">
    <test name="family" compare="eq" ignore-blanks="true">
        <string>Ubuntu</string>
    </test>
    <test name="style">
        <string>Medium</string>
    </test>
    <edit name="weight">
        <const>demibold</const>
    </edit>
    </match>
    <match target="scan">
    <test name="family" compare="eq" ignore-blanks="true">
        <string>Ubuntu</string>
    </test>
    <test name="style">
        <string>Medium Italic</string>
    </test>
    <edit name="weight">
        <const>demibold</const>
    </edit>
    </match>
</fontconfig>

После чего достаточно перезагрузить компьютер.

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *