Fix fetching of liberation fonts

Also add them to .gitignore
This commit is contained in:
Kovid Goyal 2020-12-15 11:46:55 +05:30
parent ebffa0a506
commit 5f67dd54b5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View File

@ -30,6 +30,7 @@ resources/viewer.html
resources/content-server/index-generated.html
resources/content-server/locales.zip
resources/mathjax
resources/fonts/liberation
resources/mozilla-ca-certs.pem
resources/user-agent-data.json
icons/icns/*.iconset

View File

@ -24,9 +24,10 @@ class LiberationFonts(ReVendor):
def run(self, opts):
self.clean()
os.makedirs(self.vendored_dir)
self.use_symlinks = opts.system_liberation_fonts
with self.temp_dir() as dl_src:
src = opts.path_to_hyphenation or self.download_vendor_release(dl_src, opts.hyphenation_url)
font_files = glob.glob(os.path.join(src, '*/Liberation*.ttf'))
src = opts.path_to_liberation_fonts or self.download_vendor_release(dl_src, opts.liberation_fonts_url)
font_files = glob.glob(os.path.join(src, 'Liberation*.ttf'))
if not font_files:
raise SystemExit(f'No font files found in {src}')