Fix quote handling for fonts.monospace family
This commit is contained in:
parent
a21a60c5ca
commit
f035d4f362
@ -1067,14 +1067,16 @@ class QtFont(Font):
|
||||
# through.
|
||||
raise ValueError("Unexpected size unit in {!r}!".format(
|
||||
size)) # pragma: no cover
|
||||
|
||||
if family == 'monospace':
|
||||
family = self.monospace_fonts
|
||||
# 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("'", '')
|
||||
if family == 'monospace':
|
||||
family = self.monospace_fonts
|
||||
font.setFamily(family)
|
||||
|
||||
return font
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user