Commit 56fafb98 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Use third_party/content_shell_fonts on Android

Previously third_party/content_shell_fonts were used on Linux, but not
Android. Updated the scripts to use it instead of the the files provided
by Linux distro.

Bug: 787020
Change-Id: Idf71c65a45466682f25a23474dcc67925af59466
Reviewed-on: https://chromium-review.googlesource.com/903240Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534819}
parent 5e0f702d
......@@ -7,32 +7,32 @@
</family>
<family>
<fileset>
<file>kochi-mincho.ttf</file>
<file>Garuda.ttf</file>
</fileset>
</family>
<family>
<fileset>
<file>lohit_hi.ttf</file>
<file>Lohit-Devanagari.ttf</file>
</fileset>
</family>
<family>
<fileset>
<file>lohit_ta.ttf</file>
<file>Lohit-Gurmukhi.ttf</file>
</fileset>
</family>
<family>
<fileset>
<file>MuktiNarrow.ttf</file>
<file>Lohit-Tamil.ttf</file>
</fileset>
</family>
<family>
<fileset>
<file>Garuda.ttf</file>
<file>MuktiNarrow.ttf</file>
</fileset>
</family>
<family>
<fileset>
<file>lohit_pa.ttf</file>
<file>NotoSansKhmer-Regular.ttf</file>
</fileset>
</family>
</familyset>
......@@ -64,9 +64,12 @@ from webkitpy.w3c.wpt_manifest import WPTManifest
_log = logging.getLogger(__name__)
# TODO(https://crbug.com/787020): Remove dependency on msttcorefonts.
MS_TRUETYPE_FONTS_DIR = '/usr/share/fonts/truetype/msttcorefonts/'
MS_TRUETYPE_FONTS_PACKAGE = 'ttf-mscorefonts-installer'
CONTENT_SHELL_FONTS_DIR = "third_party/content_shell_fonts/content_shell_test_fonts"
FONT_FILES = [
[[MS_TRUETYPE_FONTS_DIR], 'Arial.ttf', MS_TRUETYPE_FONTS_PACKAGE],
[[MS_TRUETYPE_FONTS_DIR], 'Arial_Bold.ttf', MS_TRUETYPE_FONTS_PACKAGE],
......@@ -97,17 +100,15 @@ FONT_FILES = [
[[MS_TRUETYPE_FONTS_DIR], 'Verdana_Italic.ttf', MS_TRUETYPE_FONTS_PACKAGE],
# The Microsoft font EULA
[['/usr/share/doc/ttf-mscorefonts-installer/'], 'READ_ME!.gz', MS_TRUETYPE_FONTS_PACKAGE],
# Other fonts: Arabic, CJK, Indic, Thai, etc.
# [['/usr/share/fonts/truetype/ttf-dejavu/'], 'DejaVuSans.ttf', 'ttf-dejavu'],
# [['/usr/share/fonts/truetype/kochi/'], 'kochi-mincho.ttf', 'ttf-kochi-mincho'],
# [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_hi.ttf', 'ttf-indic-fonts-core'],
# [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_ta.ttf', 'ttf-indic-fonts-core'],
# [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'MuktiNarrow.ttf', 'ttf-indic-fonts-core'],
# [['/usr/share/fonts/truetype/thai/', '/usr/share/fonts/truetype/tlwg/'], 'Garuda.ttf', 'fonts-tlwg-garuda'],
# [['/usr/share/fonts/truetype/ttf-indic-fonts-core/',
# '/usr/share/fonts/truetype/ttf-punjabi-fonts/'],
# 'lohit_pa.ttf',
# 'ttf-indic-fonts-core'],
[[CONTENT_SHELL_FONTS_DIR], 'DejaVuSans.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'Garuda.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'Lohit-Devanagari.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'Lohit-Gurmukhi.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'Lohit-Tamil.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'MuktiNarrow.ttf', None],
[[CONTENT_SHELL_FONTS_DIR], 'NotoSansKhmer-Regular.ttf', None],
]
......@@ -1865,14 +1866,18 @@ class Port(object):
for (font_dirs, font_file, package) in FONT_FILES:
exists = False
for font_dir in font_dirs:
font_path = font_dir + font_file
font_path = os.path.join(font_dir, font_file)
if not os.path.isabs(font_path):
font_path = self._path_from_chromium_base(font_path)
if self._check_file_exists(font_path, '', more_logging=False):
result.append(font_path)
exists = True
break
if not exists:
message = 'You are missing %s under %s. Try installing %s. See build instructions.' % \
(font_file, font_dirs, package)
message = 'You are missing %s under %s.' % (font_file, font_dirs)
if package:
message += ' Try installing %s. See build instructions.' % package
_log.error(message)
raise TestRunException(exit_codes.SYS_DEPS_EXIT_STATUS, message)
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment