Allow font names with integers in them.

This commit is contained in:
Florian Bruhin 2015-02-25 23:20:09 +01:00
parent 1d27dcca81
commit 1dc9862c0b
2 changed files with 6 additions and 3 deletions

View File

@ -686,9 +686,9 @@ class Font(BaseType):
) |
# size (<float>pt | <int>px)
(?P<size>[0-9]+((\.[0-9]+)?[pP][tT]|[pP][xX]))
)\ # size/weight/style are space-separated
)* # 0-inf size/weight/style tags
(?P<family>[A-Za-z, "-]*)$ # mandatory font family""", re.VERBOSE)
)\ # size/weight/style are space-separated
)* # 0-inf size/weight/style tags
(?P<family>[A-Za-z0-9, "-]*)$ # mandatory font family""", re.VERBOSE)
def validate(self, value):
if not value:

View File

@ -1095,6 +1095,9 @@ class FontTests(unittest.TestCase):
# (style, weight, pointsize, pixelsize, family
'"Foobar Neue"':
FontDesc(QFont.StyleNormal, QFont.Normal, -1, -1, 'Foobar Neue'),
'inconsolatazi4':
FontDesc(QFont.StyleNormal, QFont.Normal, -1, -1,
'inconsolatazi4'),
'10pt "Foobar Neue"':
FontDesc(QFont.StyleNormal, QFont.Normal, 10, None, 'Foobar Neue'),
'10PT "Foobar Neue"':