Add fontconfig instructions to install-chromeos-fonts.py.

Update the install-chromeos-fonts.py script to also describe
how to configure fontconfig to use the default rendering
settings that are used on Chrome OS devices.

BUG=687626

Review-Url: https://codereview.chromium.org/2680913005
Cr-Original-Commit-Position: refs/heads/master@{#449406}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5ae8facd914c824fed5b03f8c1f6e4fba8e436f1
This commit is contained in:
derat 2017-02-09 13:08:49 -08:00 коммит произвёл Commit bot
Родитель d693e8e16e
Коммит 21bfdecac0
1 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -82,6 +82,36 @@ def main(args):
for file in files:
os.chmod(os.path.join(base, file), 0644)
print """\
Chrome OS font rendering settings are specified using Fontconfig. If your
system's configuration doesn't match Chrome OS's (which vary for different
devices), fonts may be rendered with different subpixel rendering, subpixel
positioning, or hinting settings. This may affect font metrics.
Chrome OS's settings are stored in the media-libs/fontconfig package, which is
at src/third_party/chromiumos-overlay/media-libs/fontconfig in a Chrome OS
checkout. You can configure your system to match Chrome OS's defaults by
creating or editing a ~/.fonts.conf file:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign"><bool>true</bool></edit>
<edit name="autohint" mode="assign"><bool>true</bool></edit>
<edit name="hinting" mode="assign"><bool>true</bool></edit>
<edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
<edit name="rgba" mode="assign"><const>rgb</const></edit>
</match>
</fontconfig>
To load additional per-font configs (and assuming you have Chrome OS checked
out), add the following immediately before the "</fontconfig>" line:
<include ignore_missing="yes">/path/to/src/third_party/chromiumos-overlay/media-libs/fontconfig/files/local.conf</include>
"""
return 0
if __name__ == '__main__':