Dont store the Liberation Fonts in source control

They were kept there originally because newer versions of them were
reported to cause BSODs in Windows Vista/7. Since we no longer support
those, and newer windows has moved font parsing out fo kernel, this
should no longer be an issue.
This commit is contained in:
Kovid Goyal 2020-12-15 11:42:19 +05:30
parent 5b2e06fa0c
commit ebffa0a506
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
15 changed files with 39 additions and 2 deletions

View File

@ -21,7 +21,7 @@ __all__ = [
'upload_user_manual', 'upload_demo', 'reupload',
'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas',
'linux', 'linux32', 'linux64', 'win', 'win32', 'win64', 'osx', 'build_dep',
'export_packages', 'hyphenation', 'csslint'
'export_packages', 'hyphenation', 'liberation_fonts', 'csslint'
]
from setup.installers import Linux, Win, OSX, Linux32, Linux64, Win32, Win64, ExtDev, BuildDep, ExportPackages
@ -51,6 +51,9 @@ mathjax = MathJax()
from setup.hyphenation import Hyphenation
hyphenation = Hyphenation()
from setup.liberation import LiberationFonts
liberation_fonts = LiberationFonts()
from setup.git_version import GitVersion
git_version = GitVersion()

34
setup/liberation.py Normal file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
from setup.revendor import ReVendor
class LiberationFonts(ReVendor):
description = 'Download the Liberation fonts'
NAME = 'liberation_fonts'
TAR_NAME = 'liberation-fonts'
VERSION = '2.1.1'
DOWNLOAD_URL = 'https://github.com/liberationfonts/liberation-fonts/files/4743886/liberation-fonts-ttf-%s.tar.gz' % VERSION
@property
def vendored_dir(self):
return self.j(self.RESOURCES, 'fonts', 'liberation')
def run(self, opts):
self.clean()
os.makedirs(self.vendored_dir)
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'))
if not font_files:
raise SystemExit(f'No font files found in {src}')
for x in font_files:
self.add_file(x, os.path.basename(x))

View File

@ -199,7 +199,7 @@ class RapydScript(Command): # {{{
class Resources(Command): # {{{
description = 'Compile various needed calibre resources'
sub_commands = ['kakasi', 'mathjax', 'rapydscript', 'hyphenation']
sub_commands = ['kakasi', 'liberation_fonts', 'mathjax', 'rapydscript', 'hyphenation']
def run(self, opts):
from calibre.utils.serialize import msgpack_dumps