From f035d4f3625c8cec17cd8595fee85fc1ecd96e7c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Oct 2017 22:05:53 +0200 Subject: [PATCH] Fix quote handling for fonts.monospace family --- qutebrowser/config/configtypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 46727210e..ace0900f9 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -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