diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 64adeaa260..e161917db1 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1172,10 +1172,12 @@ static bool setFontWeightFromValue(const QCss::Value &value, QFont *font)
  */
 static bool setFontFamilyFromValues(const QVector<QCss::Value> &values, QFont *font, int start = 0)
 {
+    qDebug() << __FUNCTION__ ;
     QString family;
     bool shouldAddSpace = false;
     for (int i = start; i < values.count(); ++i) {
         const QCss::Value &v = values.at(i);
+        qDebug() << __FUNCTION__  << i << "looking at" << v.toString();
         if (v.type == Value::TermOperatorComma) {
             family += QLatin1Char(',');
             shouldAddSpace = false;
@@ -1192,6 +1194,7 @@ static bool setFontFamilyFromValues(const QVector<QCss::Value> &values, QFont *f
     if (family.isEmpty())
         return false;
     font->setFamily(family);
+    qDebug() << __FUNCTION__  <<"fam="<< family;
     return true;
 }
 
@@ -1277,10 +1280,18 @@ bool ValueExtractor::extractFont(QFont *font, int *fontSizeAdjustment)
             continue;
         const QCss::Value &val = decl.d->values.at(0);
         switch (decl.d->propertyId) {
-            case FontSize: setFontSizeFromValue(val, font, fontSizeAdjustment); break;
-            case FontStyle: setFontStyleFromValue(val, font); break;
-            case FontWeight: setFontWeightFromValue(val, font); break;
-            case FontFamily: setFontFamilyFromValues(decl.d->values, font); break;
+            case FontSize:
+            setFontSizeFromValue(val, font, fontSizeAdjustment);
+            break;
+            case FontStyle:
+            setFontStyleFromValue(val, font);
+            break;
+            case FontWeight:
+            setFontWeightFromValue(val, font);
+            break;
+            case FontFamily:
+            setFontFamilyFromValues(decl.d->values, font);
+            break;
             case TextDecoration: setTextDecorationFromValues(decl.d->values, font); break;
             case Font: parseShorthandFontProperty(decl.d->values, font, fontSizeAdjustment); break;
             case FontVariant: setFontVariantFromValue(val, font); break;
@@ -2089,6 +2100,7 @@ static inline bool isHexDigit(const char c)
 
 QString Scanner::preprocess(const QString &input, bool *hasEscapeSequences)
 {
+    qDebug() << __FUNCTION__ << input;
     QString output = input;
 
     if (hasEscapeSequences)
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index c7fff266ad..1b1aed6620 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2064,6 +2064,7 @@ uint qHash(const QFont &font, uint seed) Q_DECL_NOTHROW
  */
 bool QFont::fromString(const QString &descrip)
 {
+    qDebug() << __FUNCTION__ << descrip;
     const auto l = descrip.splitRef(QLatin1Char(','));
 
     int count = l.count();
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 08106db6ce..f5e1b23736 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -1109,6 +1109,14 @@ QVariant QTextFormat::property(int propertyId) const
 */
 void QTextFormat::setProperty(int propertyId, const QVariant &value)
 {
+    if (propertyId == FontFamily) {
+        qDebug() << __FUNCTION__ << propertyId << value.type() << value.toString();
+        if (value.toString().endsWith(QLatin1String(",serif")) ) {
+            qDebug("BR1");
+            qDebug("BR2");
+        }
+    }
+
     if (!d)
         d = new QTextFormatPrivate;
     if (!value.isValid())
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 9154182df1..906672321a 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1348,6 +1348,8 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
     QFont f;
     int adjustment = -255;
     extractor.extractFont(&f, &adjustment);
+    qDebug() << __FUNCTION__ << "extracted" << f << f.family()
+             << f.styleName();
     charFormat.setFont(f, QTextCharFormat::FontPropertiesSpecifiedOnly);
 
     if (adjustment >= -1)
