conftypes: Remove quotes for QtFont.

This commit is contained in:
Florian Bruhin 2014-08-07 07:33:14 +02:00
parent ebee09b650
commit c8fe5bd1d2

View File

@ -703,6 +703,11 @@ class QtFont(Font):
font.setPointSizeF(float(size[:-2]))
elif size.lower().endswith('px'):
font.setPointSizeF(int(size[:-2]))
# The Qt CSS parser handles " and ' before passing the string to
# QFont.setFamily. We could do proper CSS-like parsing here, but since
# hopefully nobody will ever have a font with quotes in the family (if
# that's even possible), we take a much more naive approach.
family = family.replace('"', '').replace("'", '')
font.setFamily(family)
return font