mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-05 00:21:15 +03:00
Add 'font-stretch' in the 'font' shorthand.
This commit is contained in:
parent
f7c363e546
commit
75cdc9baef
@ -1542,7 +1542,7 @@ def expand_background(base_url, name, tokens):
|
||||
|
||||
|
||||
@expander('font')
|
||||
@generic_expander('-style', '-variant', '-weight', '-size',
|
||||
@generic_expander('-style', '-variant', '-weight', '-stretch', '-size',
|
||||
'line-height', '-family') # line-height is not a suffix
|
||||
def expand_font(name, tokens):
|
||||
"""Expand the ``font`` shorthand property.
|
||||
@ -1572,6 +1572,8 @@ def expand_font(name, tokens):
|
||||
suffix = '-variant'
|
||||
elif font_weight([token]) is not None:
|
||||
suffix = '-weight'
|
||||
elif font_stretch([token]) is not None:
|
||||
suffix = '-stretch'
|
||||
else:
|
||||
# We’re done with these three, continue with font-size
|
||||
break
|
||||
|
@ -475,8 +475,9 @@ def test_font():
|
||||
'font_size': 'large',
|
||||
'font_family': ['serif'],
|
||||
}
|
||||
assert expand_to_dict('font: small-caps normal 700 large serif') == {
|
||||
assert expand_to_dict('font: small-caps condensed normal 700 large serif') == {
|
||||
#'font_style': 'normal', XXX shouldn’t this be here?
|
||||
'font_stretch': 'condensed',
|
||||
'font_variant': 'small-caps',
|
||||
'font_weight': 700,
|
||||
'font_size': 'large',
|
||||
|
Loading…
Reference in New Issue
Block a user