Skip to content

Commit

Permalink
Merge pull request #1548 from Kozea/fast-tests
Browse files Browse the repository at this point in the history
Improve tests’ speed
  • Loading branch information
liZe authored Jan 24, 2022
2 parents 51f8a0d + 85d9c6f commit f993dfb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions weasyprint/css/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,10 +1041,10 @@ def preprocess_stylesheet(device_media_type, base_url, stylesheet_rules,
'symbols': None,
'additive_symbols': None,
}
rule_descriptors = dict(
preprocess_descriptors('counter-style', base_url, content))
rule_descriptors = preprocess_descriptors(
'counter-style', base_url, content)

for descriptor_name, descriptor_value in rule_descriptors.items():
for descriptor_name, descriptor_value in rule_descriptors:
counter[descriptor_name] = descriptor_value

if counter['system'] is None:
Expand Down
4 changes: 2 additions & 2 deletions weasyprint/css/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""

from copy import deepcopy
from math import inf

from .utils import remove_whitespace
Expand Down Expand Up @@ -299,4 +298,5 @@ def render_marker(self, counter_name, counter_value):
return prefix + value + suffix

def copy(self):
return CounterStyle(deepcopy(self))
# Values are dicts but they are never modified, no need to deepcopy
return CounterStyle(super().copy())
3 changes: 2 additions & 1 deletion weasyprint/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,8 @@ def write_pdf(self, target=None, zoom=1, attachments=None, finisher=None):
ttfont = TTFont(full_font, fontNumber=fonts[0].index)
options = subset.Options(
retain_gids=True, passthrough_tables=True,
ignore_missing_glyphs=True, notdef_glyph=True)
ignore_missing_glyphs=True, hinting=False)
options.drop_tables += ['GSUB', 'GPOS']
subsetter = subset.Subsetter(options)
subsetter.populate(gids=cmap)
subsetter.subset(ttfont)
Expand Down

0 comments on commit f993dfb

Please sign in to comment.