From c8fe5bd1d2b6a3610a667a0ad3f9a171ccf0b0d0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 7 Aug 2014 07:33:14 +0200 Subject: [PATCH] conftypes: Remove quotes for QtFont. --- qutebrowser/config/conftypes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qutebrowser/config/conftypes.py b/qutebrowser/config/conftypes.py index 564f672d7..887f036a1 100644 --- a/qutebrowser/config/conftypes.py +++ b/qutebrowser/config/conftypes.py @@ -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