1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00

check for font_config

check for font_config before attempting to add_font_face
This commit is contained in:
Keith Callenberg 2016-11-17 15:29:39 -05:00 committed by GitHub
parent be739e82d6
commit 0463f0d919

View File

@ -687,10 +687,11 @@ def preprocess_stylesheet(device_media_type, base_url, stylesheet_rules,
key.replace('_', '-'), rule.line, rule.column)
break
else:
font_filename = font_config.add_font_face(
rule_descriptors, url_fetcher)
if font_filename:
fonts.append(font_filename)
if font_config is not None:
font_filename = font_config.add_font_face(
rule_descriptors, url_fetcher)
if font_filename:
fonts.append(font_filename)
def get_all_computed_styles(html, user_stylesheets=None,