diff --git a/src/plugins/bazaar/annotationhighlighter.cpp b/src/plugins/bazaar/annotationhighlighter.cpp
index 7fcbc2a124e13621c4ce2db928946dd85388360e..0d8aaac4eb82cb3a278b7a7a9184a87f88bf0a56 100644
--- a/src/plugins/bazaar/annotationhighlighter.cpp
+++ b/src/plugins/bazaar/annotationhighlighter.cpp
@@ -33,9 +33,8 @@ using namespace Bazaar::Internal;
 using namespace Bazaar;
 
 BazaarAnnotationHighlighter::BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                         const QColor &bg,
                                                          QTextDocument *document)
-    : VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    : VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
       m_changeset(QLatin1String(Constants::ANNOTATE_CHANGESET_ID))
 {
 }
diff --git a/src/plugins/bazaar/annotationhighlighter.h b/src/plugins/bazaar/annotationhighlighter.h
index ff39440286ac03711b4ba0ca1340e15333edcc51..5c55eff87bf4a40f4dbc31e1ae92c11938b5c675 100644
--- a/src/plugins/bazaar/annotationhighlighter.h
+++ b/src/plugins/bazaar/annotationhighlighter.h
@@ -38,7 +38,7 @@ namespace Internal {
 class BazaarAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
 {
 public:
-    explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                          QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/bazaar/bazaareditor.cpp b/src/plugins/bazaar/bazaareditor.cpp
index 917f819dd3ba2435fc9f7df9c436bb3df55ce20e..70acb54038f0df16d4962b5ea595b1ca1e35682a 100644
--- a/src/plugins/bazaar/bazaareditor.cpp
+++ b/src/plugins/bazaar/bazaareditor.cpp
@@ -35,7 +35,6 @@
 #include <QRegExp>
 #include <QString>
 #include <QTextCursor>
-#include <QDebug>
 
 #define BZR_CHANGE_PATTERN "[0-9]+"
 
@@ -107,8 +106,7 @@ QString BazaarEditor::changeUnderCursor(const QTextCursor &cursorIn) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                              const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new BazaarAnnotationHighlighter(changes, bg);
+    return new BazaarAnnotationHighlighter(changes);
 }
diff --git a/src/plugins/bazaar/bazaareditor.h b/src/plugins/bazaar/bazaareditor.h
index 50dca61e04202cfb46670a8191ced5cbe1f8c72d..5cff890d69d441f6097819257419356887e412e1 100644
--- a/src/plugins/bazaar/bazaareditor.h
+++ b/src/plugins/bazaar/bazaareditor.h
@@ -46,7 +46,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &cursor) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
 
     mutable QRegExp m_changesetId;
     mutable QRegExp m_exactChangesetId;
diff --git a/src/plugins/clearcase/annotationhighlighter.cpp b/src/plugins/clearcase/annotationhighlighter.cpp
index 89ba54899362addbd5b6d69b3e9b6ad21c09bd71..81de1b907969fb17206dbb774c6bc84ef60ade11 100644
--- a/src/plugins/clearcase/annotationhighlighter.cpp
+++ b/src/plugins/clearcase/annotationhighlighter.cpp
@@ -34,9 +34,8 @@ using namespace ClearCase;
 using namespace ClearCase::Internal;
 
 ClearCaseAnnotationHighlighter::ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                               const QColor &bg,
                                                                QTextDocument *document) :
-    VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     m_separator(QLatin1Char('|'))
 {
 }
diff --git a/src/plugins/clearcase/annotationhighlighter.h b/src/plugins/clearcase/annotationhighlighter.h
index 9792e2492ec4745fe19e0cdf92d143b5c8753714..f7e2740d3d0fa636f5b4880ba45e1f92b2349853 100644
--- a/src/plugins/clearcase/annotationhighlighter.h
+++ b/src/plugins/clearcase/annotationhighlighter.h
@@ -41,7 +41,7 @@ class ClearCaseAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
 {
     Q_OBJECT
 public:
-    explicit ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                             QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/clearcase/clearcaseeditor.cpp b/src/plugins/clearcase/clearcaseeditor.cpp
index 99324d7ab50b31bc999ea82d99118e85638b1f0d..04e60dfe2725f3cc6542ed8d1e1385c6d7aacfed 100644
--- a/src/plugins/clearcase/clearcaseeditor.cpp
+++ b/src/plugins/clearcase/clearcaseeditor.cpp
@@ -36,7 +36,6 @@
 #include <utils/qtcassert.h>
 #include <vcsbase/diffhighlighter.h>
 
-#include <QDebug>
 #include <QDir>
 #include <QFileInfo>
 #include <QTextBlock>
@@ -94,8 +93,7 @@ QString ClearCaseEditor::changeUnderCursor(const QTextCursor &c) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *ClearCaseEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                                 const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *ClearCaseEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new ClearCaseAnnotationHighlighter(changes, bg);
+    return new ClearCaseAnnotationHighlighter(changes);
 }
diff --git a/src/plugins/clearcase/clearcaseeditor.h b/src/plugins/clearcase/clearcaseeditor.h
index c9dd8c88e367bdd633436a03533431b03885e664..14d7031b866542b1d11d5866749d20aeff2acb7e 100644
--- a/src/plugins/clearcase/clearcaseeditor.h
+++ b/src/plugins/clearcase/clearcaseeditor.h
@@ -49,7 +49,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
 
     QRegExp m_versionNumberPattern;
 };
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
index 88045e13af1cb544e3e7f186f60d5adb228f7fa2..e27e9f955d903bf1730916b1527701ddc2a637ea 100644
--- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
@@ -40,13 +40,13 @@
 #include <coreplugin/actionmanager/actionmanager.h>
 #include <projectexplorer/projectexplorer.h>
 #include <projectexplorer/session.h>
-#include <texteditor/fontsettings.h>
 #include <texteditor/texteditoractionhandler.h>
 #include <texteditor/texteditorconstants.h>
 #include <texteditor/texteditorsettings.h>
 
 #include <QFileInfo>
 #include <QSharedPointer>
+#include <QTextBlock>
 
 using namespace CMakeProjectManager;
 using namespace CMakeProjectManager::Internal;
@@ -141,27 +141,6 @@ void CMakeEditorWidget::contextMenuEvent(QContextMenuEvent *e)
     showDefaultContextMenu(e, Constants::M_CONTEXT);
 }
 
-void CMakeEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
-{
-    TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    CMakeHighlighter *highlighter = qobject_cast<CMakeHighlighter*>(baseTextDocument()->syntaxHighlighter());
-    if (!highlighter)
-        return;
-
-    static QVector<TextEditor::TextStyle> categories;
-    if (categories.isEmpty()) {
-        categories << TextEditor::C_LABEL  // variables
-                << TextEditor::C_KEYWORD   // functions
-                << TextEditor::C_COMMENT
-                << TextEditor::C_STRING
-                << TextEditor::C_VISUAL_WHITESPACE;
-    }
-
-    const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
-    highlighter->setFormats(formats.constBegin(), formats.constEnd());
-    highlighter->rehighlight();
-}
-
 static bool isValidFileNameChar(const QChar &c)
 {
     if (c.isLetterOrNumber()
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h
index 529251645846a73fef2aa70e7a8650d88968c824..9d9f542b4b299711378c4935c0d3646f966d3a30 100644
--- a/src/plugins/cmakeprojectmanager/cmakeeditor.h
+++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h
@@ -85,7 +85,6 @@ protected:
 
 public slots:
     void unCommentSelection();
-    void setFontSettings(const TextEditor::FontSettings &);
 
 private:
     CMakeEditorFactory *m_factory;
diff --git a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
index 8f91004c03e5be18b97715fe02993cdbe3314e72..8231f402f467e2ec3962b7052f4d89471f31f9be 100644
--- a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
@@ -30,9 +30,7 @@
 #include "cmakehighlighter.h"
 
 #include <QRegExp>
-#include <QColor>
 #include <QTextDocument>
-#include <QTextEdit>
 
 using namespace CMakeProjectManager::Internal;
 
@@ -48,6 +46,15 @@ static bool isVariable(const QByteArray &word)
 CMakeHighlighter::CMakeHighlighter(QTextDocument *document) :
     TextEditor::SyntaxHighlighter(document)
 {
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_LABEL  // variables
+                   << TextEditor::C_KEYWORD   // functions
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_STRING
+                   << TextEditor::C_VISUAL_WHITESPACE;
+    }
+    setTextFormatCategories(categories);
 }
 
 
@@ -62,12 +69,12 @@ void CMakeHighlighter::highlightBlock(const QString &text)
     for (i=0; i < text.length(); i++) {
         char c = text.at(i).toLatin1();
         if (inCommentMode) {
-            setFormat(i, 1, m_formats[CMakeCommentFormat]);
+            setFormat(i, 1, formatForCategory(CMakeCommentFormat));
         } else {
             if (c == '#') {
                 if (!inStringMode) {
                     inCommentMode = true;
-                    setFormat(i, 1, m_formats[CMakeCommentFormat]);
+                    setFormat(i, 1, formatForCategory(CMakeCommentFormat));
                     buf.clear();
                 } else {
                     buf += c;
@@ -75,7 +82,7 @@ void CMakeHighlighter::highlightBlock(const QString &text)
             } else if (c == '(') {
                 if (!inStringMode) {
                     if (!buf.isEmpty())
-                        setFormat(i - buf.length(), buf.length(), m_formats[CMakeFunctionFormat]);
+                        setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeFunctionFormat));
                     buf.clear();
                 } else {
                     buf += c;
@@ -88,10 +95,10 @@ void CMakeHighlighter::highlightBlock(const QString &text)
             } else if (c == '\"') {
                 buf += c;
                 if (inStringMode) {
-                    setFormat(i + 1 - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
+                    setFormat(i + 1 - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
                     buf.clear();
                 } else {
-                    setFormat(i, 1, m_formats[CMakeStringFormat]);
+                    setFormat(i, 1, formatForCategory(CMakeStringFormat));
                 }
                 inStringMode = !inStringMode;
             } else if (c == '\\') {
@@ -105,14 +112,14 @@ void CMakeHighlighter::highlightBlock(const QString &text)
                 }
             } else if (c == '$') {
                 if (inStringMode)
-                    setFormat(i - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
+                    setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
                 buf.clear();
                 buf += c;
                 setFormat(i, 1, emptyFormat);
             } else if (c == '}') {
                 buf += c;
                 if (isVariable(buf)) {
-                    setFormat(i + 1 - buf.length(), buf.length(), m_formats[CMakeVariableFormat]);
+                    setFormat(i + 1 - buf.length(), buf.length(), formatForCategory(CMakeVariableFormat));
                     buf.clear();
                 }
             } else {
@@ -123,12 +130,12 @@ void CMakeHighlighter::highlightBlock(const QString &text)
     }
 
     if (inStringMode) {
-        setFormat(i - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
+        setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
         setCurrentBlockState(1);
     } else {
         setCurrentBlockState(0);
     }
 
-    applyFormatToSpaces(text, m_formats[CMakeVisualWhiteSpaceFormat]);
+    applyFormatToSpaces(text, formatForCategory(CMakeVisualWhiteSpaceFormat));
 }
 
diff --git a/src/plugins/cmakeprojectmanager/cmakehighlighter.h b/src/plugins/cmakeprojectmanager/cmakehighlighter.h
index ba6b31ac068da1d8c3f6e122a45cda609a1ba887..4cfef25a708eb8aeaa4ea93ed234605229ed5374 100644
--- a/src/plugins/cmakeprojectmanager/cmakehighlighter.h
+++ b/src/plugins/cmakeprojectmanager/cmakehighlighter.h
@@ -31,9 +31,6 @@
 #define CMAKEHIGHLIGHTER_H
 
 #include <texteditor/syntaxhighlighter.h>
-#include <QtAlgorithms>
-#include <QSyntaxHighlighter>
-#include <QTextCharFormat>
 
 namespace CMakeProjectManager {
 namespace Internal {
@@ -50,21 +47,11 @@ public:
         CMakeFunctionFormat,
         CMakeCommentFormat,
         CMakeStringFormat,
-        CMakeVisualWhiteSpaceFormat,
-        NumCMakeFormats
+        CMakeVisualWhiteSpaceFormat
     };
 
     CMakeHighlighter(QTextDocument *document = 0);
     virtual void highlightBlock(const QString &text);
-
-    // Set formats from a sequence of type QTextCharFormat
-    template <class InputIterator>
-        void setFormats(InputIterator begin, InputIterator end) {
-            qCopy(begin, end, m_formats);
-        }
-
-private:
-    QTextCharFormat m_formats[NumCMakeFormats];
 };
 
 } // namespace Internal
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 3e5cb74293f6ed07457962c77635119e1f3b325e..738c5544b8bb802d6b650ab83d8497e2f2df4b36 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -1887,14 +1887,10 @@ const Utils::CommentDefinition *CPPEditor::commentDefinition() const
 void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
 {
     TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    CppHighlighter *highlighter
-            = qobject_cast<CppHighlighter*>(baseTextDocument()->syntaxHighlighter());
+    TextEditor::SyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter();
     if (!highlighter)
         return;
 
-    const QVector<QTextCharFormat> formats = fs.toTextCharFormats(highlighterFormatCategories());
-    highlighter->setFormats(formats.constBegin(), formats.constEnd());
-
     m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES);
     m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED);
     m_occurrencesUnusedFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp
index ce1d70845d8cd0cabcd93fc6335060be58ad89c3..7e16616ed24be0997ca4466f070ece0f5e767fd6 100644
--- a/src/plugins/cppeditor/cpphighlighter.cpp
+++ b/src/plugins/cppeditor/cpphighlighter.cpp
@@ -28,6 +28,7 @@
 ****************************************************************************/
 
 #include "cpphighlighter.h"
+#include "cppeditorenums.h"
 
 #include <cpptools/cppdoxygen.h>
 #include <cpptools/cpptoolsreuse.h>
@@ -37,7 +38,6 @@
 #include <cplusplus/Lexer.h>
 
 #include <QTextDocument>
-#include <QDebug>
 
 using namespace CppEditor::Internal;
 using namespace TextEditor;
@@ -46,6 +46,21 @@ using namespace CPlusPlus;
 CppHighlighter::CppHighlighter(QTextDocument *document) :
     TextEditor::SyntaxHighlighter(document)
 {
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_NUMBER
+                   << TextEditor::C_STRING
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_OPERATOR
+                   << TextEditor::C_PREPROCESSOR
+                   << TextEditor::C_LABEL
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_DOXYGEN_COMMENT
+                   << TextEditor::C_DOXYGEN_TAG
+                   << TextEditor::C_VISUAL_WHITESPACE;
+    }
+    setTextFormatCategories(categories);
 }
 
 void CppHighlighter::highlightBlock(const QString &text)
@@ -80,11 +95,11 @@ void CppHighlighter::highlightBlock(const QString &text)
         BaseTextDocumentLayout::clearParentheses(currentBlock());
         if (text.length())  {// the empty line can still contain whitespace
             if (initialState == Lexer::State_MultiLineComment)
-                highlightLine(text, 0, text.length(), m_formats[CppCommentFormat]);
+                highlightLine(text, 0, text.length(), formatForCategory(CppCommentFormat));
             else if (initialState == Lexer::State_MultiLineDoxyComment)
-                highlightLine(text, 0, text.length(), m_formats[CppDoxygenCommentFormat]);
+                highlightLine(text, 0, text.length(), formatForCategory(CppDoxygenCommentFormat));
             else
-                setFormat(0, text.length(), m_formats[CppVisualWhitespace]);
+                setFormat(0, text.length(), formatForCategory(CppVisualWhitespace));
         }
         BaseTextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
         return;
@@ -109,7 +124,7 @@ void CppHighlighter::highlightBlock(const QString &text)
         }
 
         if (previousTokenEnd != tk.begin())
-            setFormat(previousTokenEnd, tk.begin() - previousTokenEnd, m_formats[CppVisualWhitespace]);
+            setFormat(previousTokenEnd, tk.begin() - previousTokenEnd, formatForCategory(CppVisualWhitespace));
 
         if (tk.is(T_LPAREN) || tk.is(T_LBRACE) || tk.is(T_LBRACKET)) {
             const QChar c = text.at(tk.begin());
@@ -148,11 +163,11 @@ void CppHighlighter::highlightBlock(const QString &text)
             continue;
 
         if (i == 0 && tk.is(T_POUND)) {
-            highlightLine(text, tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
+            highlightLine(text, tk.begin(), tk.length(), formatForCategory(CppPreprocessorFormat));
             expectPreprocessorKeyword = true;
         } else if (highlightCurrentWordAsPreprocessor &&
                    (tk.isKeyword() || tk.is(T_IDENTIFIER)) && isPPKeyword(text.midRef(tk.begin(), tk.length()))) {
-            setFormat(tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
+            setFormat(tk.begin(), tk.length(), formatForCategory(CppPreprocessorFormat));
             const QStringRef ppKeyword = text.midRef(tk.begin(), tk.length());
             if (ppKeyword == QLatin1String("error")
                     || ppKeyword == QLatin1String("warning")
@@ -161,13 +176,13 @@ void CppHighlighter::highlightBlock(const QString &text)
             }
 
         } else if (tk.is(T_NUMERIC_LITERAL)) {
-            setFormat(tk.begin(), tk.length(), m_formats[CppNumberFormat]);
+            setFormat(tk.begin(), tk.length(), formatForCategory(CppNumberFormat));
         } else if (tk.isStringLiteral() || tk.isCharLiteral()) {
-            highlightLine(text, tk.begin(), tk.length(), m_formats[CppStringFormat]);
+            highlightLine(text, tk.begin(), tk.length(), formatForCategory(CppStringFormat));
         } else if (tk.isComment()) {
             const int startPosition = initialState ? previousTokenEnd : tk.begin();
             if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT))
-                highlightLine(text, startPosition, tk.end() - startPosition, m_formats[CppCommentFormat]);
+                highlightLine(text, startPosition, tk.end() - startPosition, formatForCategory(CppCommentFormat));
 
             else // a doxygen comment
                 highlightDoxygenComment(text, startPosition, tk.end() - startPosition);
@@ -191,11 +206,11 @@ void CppHighlighter::highlightBlock(const QString &text)
             }
 
         } else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword()) {
-            setFormat(tk.begin(), tk.length(), m_formats[CppKeywordFormat]);
+            setFormat(tk.begin(), tk.length(), formatForCategory(CppKeywordFormat));
         } else if (tk.isOperator()) {
-            setFormat(tk.begin(), tk.length(), m_formats[CppOperatorFormat]);
+            setFormat(tk.begin(), tk.length(), formatForCategory(CppOperatorFormat));
         } else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
-            setFormat(tk.begin(), tk.length(), m_formats[CppLabelFormat]);
+            setFormat(tk.begin(), tk.length(), formatForCategory(CppLabelFormat));
         } else if (tk.is(T_IDENTIFIER)) {
             highlightWord(text.midRef(tk.begin(), tk.length()), tk.begin(), tk.length());
         }
@@ -204,7 +219,7 @@ void CppHighlighter::highlightBlock(const QString &text)
     // mark the trailing white spaces
     const int lastTokenEnd = tokens.last().end();
     if (text.length() > lastTokenEnd)
-        highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, m_formats[CppVisualWhitespace]);
+        highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace));
 
     if (!initialState && state && !tokens.isEmpty()) {
         parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'),
@@ -326,7 +341,7 @@ bool CppHighlighter::isPPKeyword(const QStringRef &text) const
 void CppHighlighter::highlightLine(const QString &text, int position, int length,
                                    const QTextCharFormat &format)
 {
-    QTextCharFormat visualSpaceFormat = m_formats[CppVisualWhitespace];
+    QTextCharFormat visualSpaceFormat = formatForCategory(CppVisualWhitespace);
     visualSpaceFormat.setBackground(format.background());
 
     const int end = position + length;
@@ -360,7 +375,7 @@ void CppHighlighter::highlightWord(QStringRef word, int position, int length)
                     return;
             }
 
-            setFormat(position, length, m_formats[CppTypeFormat]);
+            setFormat(position, length, formatForCategory(CppTypeFormat));
         }
     }
 }
@@ -372,8 +387,8 @@ void CppHighlighter::highlightDoxygenComment(const QString &text, int position,
     const QChar *uc = text.unicode();
     const QChar *it = uc + position;
 
-    const QTextCharFormat &format = m_formats[CppDoxygenCommentFormat];
-    const QTextCharFormat &kwFormat = m_formats[CppDoxygenTagFormat];
+    const QTextCharFormat &format = formatForCategory(CppDoxygenCommentFormat);
+    const QTextCharFormat &kwFormat = formatForCategory(CppDoxygenTagFormat);
 
     while (!it->isNull()) {
         if (it->unicode() == QLatin1Char('\\') ||
diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h
index 9e38897c296cb54c80301083a36fb8547ba85772..e697783559d5388aafb5dea5e1145de68675b015 100644
--- a/src/plugins/cppeditor/cpphighlighter.h
+++ b/src/plugins/cppeditor/cpphighlighter.h
@@ -30,8 +30,6 @@
 #ifndef CPPHIGHLIGHTER_H
 #define CPPHIGHLIGHTER_H
 
-#include "cppeditorenums.h"
-
 #include <texteditor/syntaxhighlighter.h>
 
 #include <QTextCharFormat>
@@ -51,12 +49,6 @@ public:
 
     virtual void highlightBlock(const QString &text);
 
-    // Set formats from a sequence of type QTextCharFormat
-    template <class InputIterator>
-        void setFormats(InputIterator begin, InputIterator end) {
-            qCopy(begin, end, m_formats);
-        }
-
 private:
     void highlightWord(QStringRef word, int position, int length);
     void highlightLine(const QString &line, int position, int length,
@@ -66,8 +58,6 @@ private:
                                  int length);
 
     bool isPPKeyword(const QStringRef &text) const;
-
-    QTextCharFormat m_formats[NumCppFormats];
 };
 
 } // namespace Internal
diff --git a/src/plugins/cppeditor/cppsnippetprovider.cpp b/src/plugins/cppeditor/cppsnippetprovider.cpp
index 6586ae67aeda004d8b3c3b9f5d20f6cff1fd41e7..85cb83ab00d7bbd26842b6290fcedf2265065258 100644
--- a/src/plugins/cppeditor/cppsnippetprovider.cpp
+++ b/src/plugins/cppeditor/cppsnippetprovider.cpp
@@ -36,8 +36,6 @@
 
 #include <cpptools/cppqtstyleindenter.h>
 
-#include <texteditor/texteditorsettings.h>
-#include <texteditor/fontsettings.h>
 #include <texteditor/snippets/snippeteditor.h>
 
 #include <QLatin1String>
@@ -65,12 +63,7 @@ QString CppSnippetProvider::displayName() const
 
 void CppSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *editor) const
 {
-    CppHighlighter *highlighter = new CppHighlighter;
-    const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
-    const QVector<QTextCharFormat> &formats =
-        fs.toTextCharFormats(CPPEditorWidget::highlighterFormatCategories());
-    highlighter->setFormats(formats.constBegin(), formats.constEnd());
-    editor->setSyntaxHighlighter(highlighter);
+    editor->setSyntaxHighlighter(new CppHighlighter);
     editor->setIndenter(new CppTools::CppQtStyleIndenter);
     editor->setAutoCompleter(new CppAutoCompleter);
 }
diff --git a/src/plugins/cvs/annotationhighlighter.cpp b/src/plugins/cvs/annotationhighlighter.cpp
index 50dc595dc3058958b88aa6e1f3389420782fdef7..d528394a2c8779895f831b47841c1ea0c95727f8 100644
--- a/src/plugins/cvs/annotationhighlighter.cpp
+++ b/src/plugins/cvs/annotationhighlighter.cpp
@@ -33,9 +33,8 @@ using namespace Cvs;
 using namespace Cvs::Internal;
 
 CvsAnnotationHighlighter::CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                   const QColor &bg,
                                                    QTextDocument *document) :
-    VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     m_blank(QLatin1Char(' '))
 {
 }
diff --git a/src/plugins/cvs/annotationhighlighter.h b/src/plugins/cvs/annotationhighlighter.h
index 7932da4e981206785f2cab0d1fd7c32b821df3a1..9ded8cc148f2cea1aa7eb6aaf30075854be753c2 100644
--- a/src/plugins/cvs/annotationhighlighter.h
+++ b/src/plugins/cvs/annotationhighlighter.h
@@ -41,7 +41,7 @@ class CvsAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
     Q_OBJECT
 
 public:
-    explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                       QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp
index f5a35394409d04ac2ad5e894cb2e6254f98ab9d2..8446b8b63d46c47ed0d60e14da191023a418e204 100644
--- a/src/plugins/cvs/cvseditor.cpp
+++ b/src/plugins/cvs/cvseditor.cpp
@@ -123,10 +123,9 @@ QString CvsEditor::changeUnderCursor(const QTextCursor &c) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                           const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new CvsAnnotationHighlighter(changes, bg);
+    return new CvsAnnotationHighlighter(changes);
 }
 
 QStringList CvsEditor::annotationPreviousVersions(const QString &revision) const
diff --git a/src/plugins/cvs/cvseditor.h b/src/plugins/cvs/cvseditor.h
index 6e6895f651b6991e05de8358fa8a32088ee4235a..82621f18f0139688bd1c2e512249944083f1ab53 100644
--- a/src/plugins/cvs/cvseditor.h
+++ b/src/plugins/cvs/cvseditor.h
@@ -48,7 +48,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
     QStringList annotationPreviousVersions(const QString &revision) const;
 
     mutable QRegExp m_revisionAnnotationPattern;
diff --git a/src/plugins/git/annotationhighlighter.cpp b/src/plugins/git/annotationhighlighter.cpp
index 9b19420eb4ca0aba36572a1050175423074537c6..4e91ca088205c7e7308d102ef49402065d630b16 100644
--- a/src/plugins/git/annotationhighlighter.cpp
+++ b/src/plugins/git/annotationhighlighter.cpp
@@ -35,9 +35,8 @@ namespace Git {
 namespace Internal {
 
 GitAnnotationHighlighter::GitAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                   const QColor &bg,
                                                    QTextDocument *document) :
-    VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     m_blank(QLatin1Char(' '))
 {
 }
diff --git a/src/plugins/git/annotationhighlighter.h b/src/plugins/git/annotationhighlighter.h
index 6c2539b6fbdf3ee55e27b1e6fec7196541422da9..73f59851265ce8ac723caccb5fb8bcf51b37fba7 100644
--- a/src/plugins/git/annotationhighlighter.h
+++ b/src/plugins/git/annotationhighlighter.h
@@ -40,7 +40,7 @@ class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
 {
     Q_OBJECT
 public:
-    explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                       QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp
index cdc4746055d9145f20d09b5075d4edb5a1b90ab7..2baf17ddefd22a88b5852fcf163a0fbfa4976270 100644
--- a/src/plugins/git/giteditor.cpp
+++ b/src/plugins/git/giteditor.cpp
@@ -107,10 +107,9 @@ QString GitEditor::changeUnderCursor(const QTextCursor &c) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                           const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new GitAnnotationHighlighter(changes, bg);
+    return new GitAnnotationHighlighter(changes);
 }
 
 /* Remove the date specification from annotation, which is tabular:
diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h
index 47f79e07e8e964eb872834432416c62892fb9e2f..648a2fa4ecb91fefbb5cba8cf1db8537c045ad44 100644
--- a/src/plugins/git/giteditor.h
+++ b/src/plugins/git/giteditor.h
@@ -63,7 +63,7 @@ private:
     bool open(QString *errorString, const QString &fileName, const QString &realFileName);
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
     QString decorateVersion(const QString &revision) const;
     QStringList annotationPreviousVersions(const QString &revision) const;
     bool isValidRevision(const QString &revision) const;
diff --git a/src/plugins/git/githighlighters.cpp b/src/plugins/git/githighlighters.cpp
index 2f00c9f2db3cddbec9b9d141017503f4d7ef6ed0..835b0f556d518476784d9095c1dca78cacfc8912 100644
--- a/src/plugins/git/githighlighters.cpp
+++ b/src/plugins/git/githighlighters.cpp
@@ -27,9 +27,7 @@
 **
 ****************************************************************************/
 
-#include <texteditor/fontsettings.h>
 #include <texteditor/texteditorconstants.h>
-#include <texteditor/texteditorsettings.h>
 
 #include <utils/qtcassert.h>
 
@@ -40,13 +38,6 @@ namespace Internal {
 
 static const char CHANGE_PATTERN[] = "\\b[a-f0-9]{7,40}\\b";
 
-// Retrieve the comment char format from the text editor.
-static QTextCharFormat commentFormat()
-{
-    const TextEditor::FontSettings settings = TextEditor::TextEditorSettings::instance()->fontSettings();
-    return settings.toTextCharFormat(TextEditor::C_COMMENT);
-}
-
 GitSubmitHighlighter::GitSubmitHighlighter(QTextEdit * parent) :
     TextEditor::SyntaxHighlighter(parent)
 {
@@ -61,7 +52,11 @@ GitSubmitHighlighter::GitSubmitHighlighter(TextEditor::BaseTextDocument *parent)
 
 void GitSubmitHighlighter::initialize()
 {
-    m_commentFormat = commentFormat();
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty())
+        categories << TextEditor::C_COMMENT;
+
+    setTextFormatCategories(categories);
     m_keywordPattern.setPattern(QLatin1String("^[\\w-]+:"));
     m_hashChar = QLatin1Char('#');
     QTC_CHECK(m_keywordPattern.isValid());
@@ -77,7 +72,7 @@ void GitSubmitHighlighter::highlightBlock(const QString &text)
         setCurrentBlockState(state);
         return;
     } else if (text.startsWith(m_hashChar)) {
-        setFormat(0, text.size(), m_commentFormat);
+        setFormat(0, text.size(), formatForCategory(Format_Comment));
         setCurrentBlockState(state);
         return;
     } else if (state == None) {
@@ -107,11 +102,10 @@ void GitSubmitHighlighter::highlightBlock(const QString &text)
 }
 
 GitRebaseHighlighter::RebaseAction::RebaseAction(const QString &regexp,
-                                                 const TextEditor::FontSettings &settings,
-                                                 TextEditor::TextStyle category)
-    : exp(regexp)
+                                                 const Format formatCategory)
+    : exp(regexp),
+      formatCategory(formatCategory)
 {
-    format = settings.toTextCharFormat(category);
 }
 
 GitRebaseHighlighter::GitRebaseHighlighter(TextEditor::BaseTextDocument *parent) :
@@ -119,26 +113,36 @@ GitRebaseHighlighter::GitRebaseHighlighter(TextEditor::BaseTextDocument *parent)
     m_hashChar(QLatin1Char('#')),
     m_changeNumberPattern(QLatin1String(CHANGE_PATTERN))
 {
-    const TextEditor::FontSettings settings = TextEditor::TextEditorSettings::instance()->fontSettings();
-    m_commentFormat = settings.toTextCharFormat(TextEditor::C_COMMENT);
-    m_changeFormat = settings.toTextCharFormat(TextEditor::C_DOXYGEN_COMMENT);
-    m_descFormat = settings.toTextCharFormat(TextEditor::C_STRING);
-    m_actions << RebaseAction(QLatin1String("^(p|pick)\\b"), settings, TextEditor::C_KEYWORD);
-    m_actions << RebaseAction(QLatin1String("^(r|reword)\\b"), settings, TextEditor::C_FIELD);
-    m_actions << RebaseAction(QLatin1String("^(e|edit)\\b"), settings, TextEditor::C_TYPE);
-    m_actions << RebaseAction(QLatin1String("^(s|squash)\\b"), settings, TextEditor::C_ENUMERATION);
-    m_actions << RebaseAction(QLatin1String("^(f|fixup)\\b"), settings, TextEditor::C_NUMBER);
-    m_actions << RebaseAction(QLatin1String("^(x|exec)\\b"), settings, TextEditor::C_LABEL);
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_COMMENT
+                   << TextEditor::C_DOXYGEN_COMMENT
+                   << TextEditor::C_STRING
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_FIELD
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_ENUMERATION
+                   << TextEditor::C_NUMBER
+                   << TextEditor::C_LABEL;
+    }
+    setTextFormatCategories(categories);
+
+    m_actions << RebaseAction(QLatin1String("^(p|pick)\\b"), Format_Pick);
+    m_actions << RebaseAction(QLatin1String("^(r|reword)\\b"), Format_Reword);
+    m_actions << RebaseAction(QLatin1String("^(e|edit)\\b"), Format_Edit);
+    m_actions << RebaseAction(QLatin1String("^(s|squash)\\b"), Format_Squash);
+    m_actions << RebaseAction(QLatin1String("^(f|fixup)\\b"), Format_Fixup);
+    m_actions << RebaseAction(QLatin1String("^(x|exec)\\b"), Format_Exec);
 }
 
 void GitRebaseHighlighter::highlightBlock(const QString &text)
 {
     if (text.startsWith(m_hashChar)) {
-        setFormat(0, text.size(), m_commentFormat);
+        setFormat(0, text.size(), formatForCategory(Format_Comment));
         int changeIndex = 0;
         while ((changeIndex = m_changeNumberPattern.indexIn(text, changeIndex)) != -1) {
             const int changeLen = m_changeNumberPattern.matchedLength();
-            setFormat(changeIndex, changeLen, m_changeFormat);
+            setFormat(changeIndex, changeLen, formatForCategory(Format_Change));
             changeIndex += changeLen;
         }
         return;
@@ -147,13 +151,13 @@ void GitRebaseHighlighter::highlightBlock(const QString &text)
     foreach (const RebaseAction &action, m_actions) {
         if (action.exp.indexIn(text) != -1) {
             const int len = action.exp.matchedLength();
-            setFormat(0, len, action.format);
+            setFormat(0, len, formatForCategory(action.formatCategory));
             const int changeIndex = m_changeNumberPattern.indexIn(text, len);
             if (changeIndex != -1) {
                 const int changeLen = m_changeNumberPattern.matchedLength();
                 const int descStart = changeIndex + changeLen + 1;
-                setFormat(changeIndex, changeLen, m_changeFormat);
-                setFormat(descStart, text.size() - descStart, m_descFormat);
+                setFormat(changeIndex, changeLen, formatForCategory(Format_Change));
+                setFormat(descStart, text.size() - descStart, formatForCategory(Format_Description));
             }
             break;
         }
diff --git a/src/plugins/git/githighlighters.h b/src/plugins/git/githighlighters.h
index 3d7f6e062188dd89397529b8131f54450c5b6eee..888b615c721f54e506ab681bdfbf57e7ada2e3b9 100644
--- a/src/plugins/git/githighlighters.h
+++ b/src/plugins/git/githighlighters.h
@@ -31,7 +31,6 @@
 #define GITHIGHLIGHTERS_H
 
 #include <texteditor/syntaxhighlighter.h>
-#include <texteditor/texteditorconstants.h>
 
 namespace TextEditor {
 class FontSettings;
@@ -40,6 +39,18 @@ class FontSettings;
 namespace Git {
 namespace Internal {
 
+enum Format {
+    Format_Comment,
+    Format_Change,
+    Format_Description,
+    Format_Pick,
+    Format_Reword,
+    Format_Edit,
+    Format_Squash,
+    Format_Fixup,
+    Format_Exec
+};
+
 // Highlighter for git submit messages. Make the first line bold, indicates
 // comments as such (retrieving the format from the text editor) and marks up
 // keywords (words in front of a colon as in 'Task: <bla>').
@@ -50,10 +61,10 @@ public:
     explicit GitSubmitHighlighter(TextEditor::BaseTextDocument *parent);
     void highlightBlock(const QString &text);
 
-    void initialize();
 private:
+    void initialize();
+
     enum State { None = -1, Header, Other };
-    QTextCharFormat m_commentFormat;
     QRegExp m_keywordPattern;
     QChar m_hashChar;
 };
@@ -71,13 +82,9 @@ private:
     {
     public:
         mutable QRegExp exp;
-        QTextCharFormat format;
-        RebaseAction(const QString &regexp, const TextEditor::FontSettings &settings,
-                     TextEditor::TextStyle category);
+        Format formatCategory;
+        RebaseAction(const QString &regexp, const Format formatCategory);
     };
-    QTextCharFormat m_commentFormat;
-    QTextCharFormat m_changeFormat;
-    QTextCharFormat m_descFormat;
     const QChar m_hashChar;
     QRegExp m_changeNumberPattern;
     QList<RebaseAction> m_actions;
diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp
index e744b603deb63e3360b014b9efe7f74f2946762f..7e01ccb9f14847b939c66ffe306e46f2a2dadfb0 100644
--- a/src/plugins/glsleditor/glsleditor.cpp
+++ b/src/plugins/glsleditor/glsleditor.cpp
@@ -51,8 +51,6 @@
 #include <coreplugin/mimedatabase.h>
 #include <extensionsystem/pluginmanager.h>
 #include <texteditor/basetextdocument.h>
-#include <texteditor/fontsettings.h>
-#include <texteditor/tabsettings.h>
 #include <texteditor/texteditorconstants.h>
 #include <texteditor/texteditorsettings.h>
 #include <texteditor/syntaxhighlighter.h>
@@ -64,7 +62,7 @@
 #include <QFileInfo>
 #include <QSignalMapper>
 #include <QTimer>
-#include <QDebug>
+#include <QTextBlock>
 
 #include <QMenu>
 #include <QComboBox>
@@ -209,42 +207,6 @@ bool GLSLEditorEditable::open(QString *errorString, const QString &fileName, con
     return b;
 }
 
-void GLSLTextEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
-{
-    TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    Highlighter *highlighter = qobject_cast<Highlighter*>(baseTextDocument()->syntaxHighlighter());
-    if (!highlighter)
-        return;
-
-    /*
-        NumberFormat,
-        StringFormat,
-        TypeFormat,
-        KeywordFormat,
-        LabelFormat,
-        CommentFormat,
-        VisualWhitespace,
-     */
-    static QVector<TextEditor::TextStyle> categories;
-    if (categories.isEmpty()) {
-        categories << TextEditor::C_NUMBER
-                   << TextEditor::C_STRING
-                   << TextEditor::C_TYPE
-                   << TextEditor::C_KEYWORD
-                   << TextEditor::C_OPERATOR
-                   << TextEditor::C_PREPROCESSOR
-                   << TextEditor::C_LABEL
-                   << TextEditor::C_COMMENT
-                   << TextEditor::C_DOXYGEN_COMMENT
-                   << TextEditor::C_DOXYGEN_TAG
-                   << TextEditor::C_VISUAL_WHITESPACE
-                   << TextEditor::C_REMOVED_LINE;
-    }
-
-    highlighter->setFormats(fs.toTextCharFormats(categories));
-    highlighter->rehighlight();
-}
-
 QString GLSLTextEditorWidget::wordUnderCursor() const
 {
     QTextCursor tc = textCursor();
diff --git a/src/plugins/glsleditor/glsleditor.h b/src/plugins/glsleditor/glsleditor.h
index dbb8f0279bd163ea4669be6151359d59984abf26..dad0ca2b9edf1516fa2af38ee3b1b6739222db5d 100644
--- a/src/plugins/glsleditor/glsleditor.h
+++ b/src/plugins/glsleditor/glsleditor.h
@@ -109,9 +109,6 @@ public:
     TextEditor::IAssistInterface *createAssistInterface(TextEditor::AssistKind assistKind,
                                                         TextEditor::AssistReason reason) const;
 
-public slots:
-    virtual void setFontSettings(const TextEditor::FontSettings &);
-
 private slots:
     void updateDocument();
     void updateDocumentNow();
diff --git a/src/plugins/glsleditor/glslhighlighter.cpp b/src/plugins/glsleditor/glslhighlighter.cpp
index abe873b501db7fab7caf8947d18e8a2a12803fb4..709023ea9f2145646d80b37df4e5f1da19d27bbc 100644
--- a/src/plugins/glsleditor/glslhighlighter.cpp
+++ b/src/plugins/glsleditor/glslhighlighter.cpp
@@ -42,6 +42,22 @@ using namespace TextEditor;
 Highlighter::Highlighter(BaseTextDocument *parent)
     : TextEditor::SyntaxHighlighter(parent)
 {
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_NUMBER
+                   << TextEditor::C_STRING
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_OPERATOR
+                   << TextEditor::C_PREPROCESSOR
+                   << TextEditor::C_LABEL
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_DOXYGEN_COMMENT
+                   << TextEditor::C_DOXYGEN_TAG
+                   << TextEditor::C_VISUAL_WHITESPACE
+                   << TextEditor::C_REMOVED_LINE;
+    }
+    setTextFormatCategories(categories);
 }
 
 Highlighter::~Highlighter()
@@ -49,11 +65,6 @@ Highlighter::~Highlighter()
 
 }
 
-void Highlighter::setFormats(const QVector<QTextCharFormat> &formats)
-{
-    qCopy(formats.begin(), formats.end(), m_formats);
-}
-
 void Highlighter::highlightBlock(const QString &text)
 {
     const int previousState = previousBlockState();
@@ -96,7 +107,7 @@ void Highlighter::highlightBlock(const QString &text)
         setCurrentBlockState(previousState);
         BaseTextDocumentLayout::clearParentheses(currentBlock());
         if (text.length()) // the empty line can still contain whitespace
-            setFormat(0, text.length(), m_formats[GLSLVisualWhitespace]);
+            setFormat(0, text.length(), formatForCategory(GLSLVisualWhitespace));
         BaseTextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
         return;
     }
@@ -120,7 +131,7 @@ void Highlighter::highlightBlock(const QString &text)
 
         if (previousTokenEnd != tk.begin()) {
             setFormat(previousTokenEnd, tk.begin() - previousTokenEnd,
-                      m_formats[GLSLVisualWhitespace]);
+                      formatForCategory(GLSLVisualWhitespace));
         }
 
         if (tk.is(GLSL::Parser::T_LEFT_PAREN) || tk.is(GLSL::Parser::T_LEFT_BRACE) || tk.is(GLSL::Parser::T_LEFT_BRACKET)) {
@@ -157,17 +168,17 @@ void Highlighter::highlightBlock(const QString &text)
             highlightAsPreprocessor = false;
 
         if (false /* && i == 0 && tk.is(GLSL::Parser::T_POUND)*/) {
-            highlightLine(text, tk.begin(), tk.length, m_formats[GLSLPreprocessorFormat]);
+            highlightLine(text, tk.begin(), tk.length, formatForCategory(GLSLPreprocessorFormat));
             highlightAsPreprocessor = true;
 
         } else if (highlightCurrentWordAsPreprocessor && isPPKeyword(text.midRef(tk.begin(), tk.length))) {
-            setFormat(tk.begin(), tk.length, m_formats[GLSLPreprocessorFormat]);
+            setFormat(tk.begin(), tk.length, formatForCategory(GLSLPreprocessorFormat));
 
         } else if (tk.is(GLSL::Parser::T_NUMBER)) {
-            setFormat(tk.begin(), tk.length, m_formats[GLSLNumberFormat]);
+            setFormat(tk.begin(), tk.length, formatForCategory(GLSLNumberFormat));
 
         } else if (tk.is(GLSL::Parser::T_COMMENT)) {
-            highlightLine(text, tk.begin(), tk.length, m_formats[GLSLCommentFormat]);
+            highlightLine(text, tk.begin(), tk.length, formatForCategory(GLSLCommentFormat));
 
             // we need to insert a close comment parenthesis, if
             //  - the line starts in a C Comment (initalState != 0)
@@ -190,9 +201,9 @@ void Highlighter::highlightBlock(const QString &text)
         } else if (tk.is(GLSL::Parser::T_IDENTIFIER)) {
             int kind = lex.findKeyword(data.constData() + tk.position, tk.length);
             if (kind == GLSL::Parser::T_RESERVED)
-                setFormat(tk.position, tk.length, m_formats[GLSLReservedKeyword]);
+                setFormat(tk.position, tk.length, formatForCategory(GLSLReservedKeyword));
             else if (kind != GLSL::Parser::T_IDENTIFIER)
-                setFormat(tk.position, tk.length, m_formats[GLSLKeywordFormat]);
+                setFormat(tk.position, tk.length, formatForCategory(GLSLKeywordFormat));
         }
     }
 
@@ -245,7 +256,7 @@ void Highlighter::highlightBlock(const QString &text)
 void Highlighter::highlightLine(const QString &text, int position, int length,
                                 const QTextCharFormat &format)
 {
-    const QTextCharFormat visualSpaceFormat = m_formats[GLSLVisualWhitespace];
+    const QTextCharFormat visualSpaceFormat = formatForCategory(GLSLVisualWhitespace);
 
     const int end = position + length;
     int index = position;
@@ -363,15 +374,15 @@ void Highlighter::highlightBlock(const QString &text)
         const GLSL::Token &tk = tokens.at(i);
 
         if (tk.is(GLSL::Parser::T_NUMBER)) {
-            setFormat(tk.position, tk.length, m_formats[GLSLNumberFormat]);
+            setFormat(tk.position, tk.length, formatForCategory(GLSLNumberFormat);
         } else if (tk.is(GLSL::Parser::T_COMMENT)) {
-            setFormat(tk.position, tk.length, Qt::darkGreen); // ### FIXME: m_formats[GLSLCommentFormat]);
+            setFormat(tk.position, tk.length, Qt::darkGreen); // ### FIXME: formatForCategory(GLSLCommentFormat);
         } else if (tk.is(GLSL::Parser::T_IDENTIFIER)) {
             int kind = lex.findKeyword(data.constData() + tk.position, tk.length);
             if (kind == GLSL::Parser::T_RESERVED)
-                setFormat(tk.position, tk.length, m_formats[GLSLReservedKeyword]);
+                setFormat(tk.position, tk.length, formatForCategory(GLSLReservedKeyword);
             else if (kind != GLSL::Parser::T_IDENTIFIER)
-                setFormat(tk.position, tk.length, m_formats[GLSLKeywordFormat]);
+                setFormat(tk.position, tk.length, formatForCategory(GLSLKeywordFormat);
         } else if (tk.is(GLSL::Parser::T_LEFT_PAREN) || tk.is(GLSL::Parser::T_LEFT_BRACE) || tk.is(GLSL::Parser::T_LEFT_BRACKET)) {
             const QChar c = text.at(tk.begin());
             parentheses.append(Parenthesis(Parenthesis::Opened, c, tk.begin()));
diff --git a/src/plugins/glsleditor/glslhighlighter.h b/src/plugins/glsleditor/glslhighlighter.h
index 9038f636b3c67f1bf727ba589c2b0f3dfeedbbf3..fdc40f97ffb00f8fc5ec4a646d9366dde7292867 100644
--- a/src/plugins/glsleditor/glslhighlighter.h
+++ b/src/plugins/glsleditor/glslhighlighter.h
@@ -60,15 +60,10 @@ public:
     explicit Highlighter(TextEditor::BaseTextDocument *parent);
     virtual ~Highlighter();
 
-    void setFormats(const QVector<QTextCharFormat> &formats);
-
 protected:
     void highlightBlock(const QString &text);
     void highlightLine(const QString &text, int position, int length, const QTextCharFormat &format);
     bool isPPKeyword(const QStringRef &text) const;
-
-private:
-    QTextCharFormat m_formats[NumGLSLFormats];
 };
 
 } // namespace Internal
diff --git a/src/plugins/mercurial/annotationhighlighter.cpp b/src/plugins/mercurial/annotationhighlighter.cpp
index 22656bed55140ca20bac4ec2e4ce406c4003ba72..6a0a0be01e336bdd3a72e26fc308bf3170d1fd78 100644
--- a/src/plugins/mercurial/annotationhighlighter.cpp
+++ b/src/plugins/mercurial/annotationhighlighter.cpp
@@ -34,9 +34,8 @@ using namespace Mercurial::Internal;
 using namespace Mercurial;
 
 MercurialAnnotationHighlighter::MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                               const QColor &bg,
                                                                QTextDocument *document)
-    : VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    : VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     changeset(QLatin1String(Constants::CHANGESETID12))
 {
 }
diff --git a/src/plugins/mercurial/annotationhighlighter.h b/src/plugins/mercurial/annotationhighlighter.h
index 310596554dbf80c1ec8d41d98e0aca47ec92ab06..931a745c6ee2026d61dd4c9bcb44896a4ab3541b 100644
--- a/src/plugins/mercurial/annotationhighlighter.h
+++ b/src/plugins/mercurial/annotationhighlighter.h
@@ -39,7 +39,7 @@ namespace Internal {
 class MercurialAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
 {
 public:
-    explicit MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                             QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp
index 79bbcded45762b0224abdb5db11bcd7760d70787..ca6a62b9fb4e0d877ae264ee725b3fbea39e6814 100644
--- a/src/plugins/mercurial/mercurialeditor.cpp
+++ b/src/plugins/mercurial/mercurialeditor.cpp
@@ -89,10 +89,9 @@ QString MercurialEditor::changeUnderCursor(const QTextCursor &cursorIn) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                                 const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new MercurialAnnotationHighlighter(changes, bg);
+    return new MercurialAnnotationHighlighter(changes);
 }
 
 QString MercurialEditor::decorateVersion(const QString &revision) const
diff --git a/src/plugins/mercurial/mercurialeditor.h b/src/plugins/mercurial/mercurialeditor.h
index a2ca6dce8b36d9e925645a5a486f6153d7e9aa11..ddbefdcce8cc53baf58ef15db1032b51bc04072e 100644
--- a/src/plugins/mercurial/mercurialeditor.h
+++ b/src/plugins/mercurial/mercurialeditor.h
@@ -46,7 +46,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &cursor) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
     QString decorateVersion(const QString &revision) const;
     QStringList annotationPreviousVersions(const QString &revision) const;
 
diff --git a/src/plugins/perforce/annotationhighlighter.cpp b/src/plugins/perforce/annotationhighlighter.cpp
index d3d8760958cdb1604a81b7c6e7ddd6320b616518..93ee74918c41e5b7093851c3242ad6e962a72219 100644
--- a/src/plugins/perforce/annotationhighlighter.cpp
+++ b/src/plugins/perforce/annotationhighlighter.cpp
@@ -33,9 +33,8 @@ namespace Perforce {
 namespace Internal {
 
 PerforceAnnotationHighlighter::PerforceAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                             const QColor &bg,
                                                              QTextDocument *document) :
-    VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     m_colon(QLatin1Char(':'))
 {
 }
diff --git a/src/plugins/perforce/annotationhighlighter.h b/src/plugins/perforce/annotationhighlighter.h
index 4c47fd48b3771d3d86b0a2f679ae3febfe3cd4c2..2d35c04c6e73e3eff60f9cc3ca29520deae40d83 100644
--- a/src/plugins/perforce/annotationhighlighter.h
+++ b/src/plugins/perforce/annotationhighlighter.h
@@ -41,7 +41,6 @@ class PerforceAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
     Q_OBJECT
 public:
     explicit PerforceAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                           const QColor &bg,
                                            QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp
index 0c3a66d6da77774debd9b1ae4b15f082d9773f58..a859a77fe6c152994d42113f9344055eee7271d6 100644
--- a/src/plugins/perforce/perforceeditor.cpp
+++ b/src/plugins/perforce/perforceeditor.cpp
@@ -109,10 +109,9 @@ QString PerforceEditor::changeUnderCursor(const QTextCursor &c) const
     return m_changeNumberPattern.exactMatch(change) ? change : QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                                const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new PerforceAnnotationHighlighter(changes, bg);
+    return new PerforceAnnotationHighlighter(changes);
 }
 
 QString PerforceEditor::findDiffFile(const QString &f) const
diff --git a/src/plugins/perforce/perforceeditor.h b/src/plugins/perforce/perforceeditor.h
index 09c1ef2b1bd243b476c921b554043c83d9bd907b..6f8163d23c4ddb7dc1c8da62167771163b8a4cc5 100644
--- a/src/plugins/perforce/perforceeditor.h
+++ b/src/plugins/perforce/perforceeditor.h
@@ -50,7 +50,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
     QString findDiffFile(const QString &f) const;
     QStringList annotationPreviousVersions(const QString &v) const;
 
diff --git a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
index 6e59d4a013838bfc678754e17c2bb17df1fa98b5..ea809c4e6fdfdca0167055abe04ae43a215c299b 100644
--- a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
+++ b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
@@ -40,9 +40,7 @@
 #include "pythonhighlighter.h"
 #include "lexical/pythonscanner.h"
 
-#include <texteditor/basetextdocumentlayout.h>
 #include <texteditor/basetextdocument.h>
-#include <texteditor/fontsettings.h>
 #include <texteditor/texteditorconstants.h>
 
 namespace PythonEditor {
@@ -67,30 +65,26 @@ using namespace PythonEditor::Internal;
  * @endcode
  */
 
-/// @return List that maps enum Format values to TextEditor plugin formats
-QVector<TextEditor::TextStyle> initFormatCategories()
-{
-    QVector<TextEditor::TextStyle> categories(Format_FormatsAmount);
-    categories[Format_Number] = TextEditor::C_NUMBER;
-    categories[Format_String] = TextEditor::C_STRING;
-    categories[Format_Keyword] = TextEditor::C_KEYWORD;
-    categories[Format_Type] = TextEditor::C_TYPE;
-    categories[Format_ClassField] = TextEditor::C_FIELD;
-    categories[Format_MagicAttr] = TextEditor::C_JS_SCOPE_VAR;
-    categories[Format_Operator] = TextEditor::C_OPERATOR;
-    categories[Format_Comment] = TextEditor::C_COMMENT;
-    categories[Format_Doxygen] = TextEditor::C_DOXYGEN_COMMENT;
-    categories[Format_Whitespace] = TextEditor::C_VISUAL_WHITESPACE;
-    categories[Format_Identifier] = TextEditor::C_TEXT;
-    categories[Format_ImportedModule] = TextEditor::C_STRING;
-
-    return categories;
-}
-
 /// New instance created when opening any document in editor
 PythonHighlighter::PythonHighlighter(TextEditor::BaseTextDocument *parent) :
     TextEditor::SyntaxHighlighter(parent)
 {
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_NUMBER
+                   << TextEditor::C_STRING
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_FIELD
+                   << TextEditor::C_JS_SCOPE_VAR
+                   << TextEditor::C_OPERATOR
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_DOXYGEN_COMMENT
+                   << TextEditor::C_TEXT
+                   << TextEditor::C_VISUAL_WHITESPACE
+                   << TextEditor::C_STRING;
+    }
+    setTextFormatCategories(categories);
 }
 
 /// Instance destroyed when one of documents closed from editor
@@ -98,18 +92,6 @@ PythonHighlighter::~PythonHighlighter()
 {
 }
 
-/**
-  QtCreator has own fonts&color settings. Highlighter wants get access to
-  this settings before highlightBlock() called first time.
-  Settings provided by PyEditor::EditorWidget class.
-  */
-void PythonHighlighter::setFontSettings(const TextEditor::FontSettings &fs)
-{
-    QVector<TextEditor::TextStyle> categories = initFormatCategories();
-    m_formats = fs.toTextCharFormats(categories);
-    rehighlight();
-}
-
 /**
  * @brief Highlighter::highlightBlock highlights single line of Python code
  * @param text is single line without EOLN symbol. Access to all block data
@@ -155,13 +137,13 @@ int PythonHighlighter::highlightLine(const QString &text, int initialState)
         if (format == Format_Keyword) {
             QString value = scanner.value(tk);
             if (isImportKeyword(value) && hasOnlyWhitespace) {
-                setFormat(tk.begin(), tk.length(), m_formats[format]);
+                setFormat(tk.begin(), tk.length(), formatForCategory(format));
                 highlightImport(scanner);
                 break;
             }
         }
 
-        setFormat(tk.begin(), tk.length(), m_formats[format]);
+        setFormat(tk.begin(), tk.length(), formatForCategory(format));
         if (format != Format_Whitespace)
             hasOnlyWhitespace = false;
     }
@@ -178,7 +160,7 @@ void PythonHighlighter::highlightImport(Scanner &scanner)
         Format format = tk.format();
         if (tk.format() == Format_Identifier)
             format = Format_ImportedModule;
-        setFormat(tk.begin(), tk.length(), m_formats[format]);
+        setFormat(tk.begin(), tk.length(), formatForCategory(format));
     }
 }
 
diff --git a/src/plugins/pythoneditor/tools/pythonhighlighter.h b/src/plugins/pythoneditor/tools/pythonhighlighter.h
index cb2a72e2437f63c6b4ea732361d28effcb6304e6..801f55e06683065ae007446bb0d2ec90981ef766 100644
--- a/src/plugins/pythoneditor/tools/pythonhighlighter.h
+++ b/src/plugins/pythoneditor/tools/pythonhighlighter.h
@@ -32,8 +32,6 @@
 
 #include "../pythoneditor_global.h"
 #include <texteditor/syntaxhighlighter.h>
-#include <texteditor/fontsettings.h>
-#include <QMap>
 
 namespace PythonEditor {
 
@@ -46,15 +44,12 @@ public:
     explicit PythonHighlighter(TextEditor::BaseTextDocument *parent);
     virtual ~PythonHighlighter();
 
-    void setFontSettings(const TextEditor::FontSettings &fs);
-
 protected:
     virtual void highlightBlock(const QString &text);
 
 private:
     int highlightLine(const QString &text, int initialState);
     void highlightImport(Internal::Scanner &scanner);
-    QVector<QTextCharFormat> m_formats;
 };
 
 } // namespace PythonEditor
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 4292812c075c652902ef25179e8d19563b34807e..c6e3b27630fb0215503a22a1eddf84550d795be2 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -980,12 +980,6 @@ void QmlJSTextEditorWidget::updateFileName()
 void QmlJSTextEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
 {
     TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    Highlighter *highlighter = qobject_cast<Highlighter*>(baseTextDocument()->syntaxHighlighter());
-    if (!highlighter)
-        return;
-
-    highlighter->setFormats(fs.toTextCharFormats(highlighterFormatCategories()));
-    highlighter->rehighlight();
 
     m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES);
     m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED);
diff --git a/src/plugins/qmljseditor/qmljshighlighter.cpp b/src/plugins/qmljseditor/qmljshighlighter.cpp
index 840f5839aed8986b91361ab39ebc087527ce8c20..2628077ce489fa86ffdb95a738590defe9597b72 100644
--- a/src/plugins/qmljseditor/qmljshighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljshighlighter.cpp
@@ -41,11 +41,22 @@ using namespace QmlJS;
 Highlighter::Highlighter(QTextDocument *parent)
     : TextEditor::SyntaxHighlighter(parent),
       m_qmlEnabled(true),
+      m_braceDepth(0),
+      m_foldingIndent(0),
       m_inMultilineComment(false)
 {
     m_currentBlockParentheses.reserve(20);
-    m_braceDepth = 0;
-    m_foldingIndent = 0;
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_NUMBER
+                   << TextEditor::C_STRING
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_FIELD
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_VISUAL_WHITESPACE;
+    }
+    setTextFormatCategories(categories);
 }
 
 Highlighter::~Highlighter()
@@ -62,12 +73,6 @@ void Highlighter::setQmlEnabled(bool qmlEnabled)
     m_qmlEnabled = qmlEnabled;
 }
 
-void Highlighter::setFormats(const QVector<QTextCharFormat> &formats)
-{
-    QTC_ASSERT(formats.size() == NumFormats, return);
-    qCopy(formats.begin(), formats.end(), m_formats);
-}
-
 void Highlighter::highlightBlock(const QString &text)
 {
     const QList<Token> tokens = m_scanner(text, onBlockStart());
@@ -78,11 +83,11 @@ void Highlighter::highlightBlock(const QString &text)
 
         switch (token.kind) {
             case Token::Keyword:
-                setFormat(token.offset, token.length, m_formats[KeywordFormat]);
+                setFormat(token.offset, token.length, formatForCategory(KeywordFormat));
                 break;
 
             case Token::String:
-                setFormat(token.offset, token.length, m_formats[StringFormat]);
+                setFormat(token.offset, token.length, formatForCategory(StringFormat));
                 break;
 
             case Token::Comment:
@@ -95,11 +100,11 @@ void Highlighter::highlightBlock(const QString &text)
                     onOpeningParenthesis(QLatin1Char('+'), token.offset, index == 0);
                     m_inMultilineComment = true;
                 }
-                setFormat(token.offset, token.length, m_formats[CommentFormat]);
+                setFormat(token.offset, token.length, formatForCategory(CommentFormat));
                 break;
 
             case Token::RegExp:
-                setFormat(token.offset, token.length, m_formats[StringFormat]);
+                setFormat(token.offset, token.length, formatForCategory(StringFormat));
                 break;
 
             case Token::LeftParenthesis:
@@ -136,7 +141,7 @@ void Highlighter::highlightBlock(const QString &text)
                     // check the previous token
                     if (index == 0 || tokens.at(index - 1).isNot(Token::Dot)) {
                         if (index + 1 == tokens.size() || tokens.at(index + 1).isNot(Token::Colon)) {
-                            setFormat(token.offset, token.length, m_formats[KeywordFormat]);
+                            setFormat(token.offset, token.length, formatForCategory(KeywordFormat));
                             break;
                         }
                     }
@@ -144,7 +149,7 @@ void Highlighter::highlightBlock(const QString &text)
                     const Token &previousToken = tokens.at(index - 1);
                     if (previousToken.is(Token::Identifier) && text.at(previousToken.offset) == QLatin1Char('p')
                         && text.midRef(previousToken.offset, previousToken.length) == QLatin1String("property")) {
-                        setFormat(token.offset, token.length, m_formats[KeywordFormat]);
+                        setFormat(token.offset, token.length, formatForCategory(KeywordFormat));
                         break;
                     }
                 }
@@ -163,7 +168,7 @@ void Highlighter::highlightBlock(const QString &text)
     int previousTokenEnd = 0;
     for (int index = 0; index < tokens.size(); ++index) {
         const Token &token = tokens.at(index);
-        setFormat(previousTokenEnd, token.begin() - previousTokenEnd, m_formats[VisualWhitespace]);
+        setFormat(previousTokenEnd, token.begin() - previousTokenEnd, formatForCategory(VisualWhitespace));
 
         switch (token.kind) {
         case Token::Comment:
@@ -177,7 +182,7 @@ void Highlighter::highlightBlock(const QString &text)
                     do {
                         ++i;
                     } while (i < e && text.at(i).isSpace());
-                    setFormat(start, i - start, m_formats[VisualWhitespace]);
+                    setFormat(start, i - start, formatForCategory(VisualWhitespace));
                 } else {
                     ++i;
                 }
@@ -191,7 +196,7 @@ void Highlighter::highlightBlock(const QString &text)
         previousTokenEnd = token.end();
     }
 
-    setFormat(previousTokenEnd, text.length() - previousTokenEnd, m_formats[VisualWhitespace]);
+    setFormat(previousTokenEnd, text.length() - previousTokenEnd, formatForCategory(VisualWhitespace));
 
     setCurrentBlockState(m_scanner.state());
     onBlockEnd(m_scanner.state());
diff --git a/src/plugins/qmljseditor/qmljshighlighter.h b/src/plugins/qmljseditor/qmljshighlighter.h
index badcfc05f4bd09578c9778fbef947c78c4d7d58b..b81f1687218359cbcab09f6a0814e7f635a40fff 100644
--- a/src/plugins/qmljseditor/qmljshighlighter.h
+++ b/src/plugins/qmljseditor/qmljshighlighter.h
@@ -34,13 +34,8 @@
 
 #include <qmljs/qmljsscanner.h>
 
-#include <QVector>
-#include <QSet>
-#include <QSyntaxHighlighter>
-
 #include <texteditor/basetextdocumentlayout.h>
 #include <texteditor/syntaxhighlighter.h>
-#include <texteditor/texteditorconstants.h>
 
 namespace QmlJSEditor {
 
@@ -65,7 +60,6 @@ public:
 
     bool isQmlEnabled() const;
     void setQmlEnabled(bool duiEnabled);
-    void setFormats(const QVector<QTextCharFormat> &formats);
 
 protected:
     virtual void highlightBlock(const QString &text);
@@ -92,8 +86,6 @@ private:
 
     QmlJS::Scanner m_scanner;
     Parentheses m_currentBlockParentheses;
-
-    QTextCharFormat m_formats[NumFormats];
 };
 
 } // namespace QmlJSEditor
diff --git a/src/plugins/qmljseditor/qmljssnippetprovider.cpp b/src/plugins/qmljseditor/qmljssnippetprovider.cpp
index 5253a12be59f7d478a07cb7c59849efbdd782a34..026fef61999c0bd9701b2c29426234c9278682e0 100644
--- a/src/plugins/qmljseditor/qmljssnippetprovider.cpp
+++ b/src/plugins/qmljseditor/qmljssnippetprovider.cpp
@@ -34,7 +34,6 @@
 #include "qmljseditorconstants.h"
 
 #include <texteditor/texteditorsettings.h>
-#include <texteditor/fontsettings.h>
 #include <texteditor/texteditorconstants.h>
 #include <texteditor/snippets/snippeteditor.h>
 
@@ -65,10 +64,7 @@ QString QmlJSSnippetProvider::displayName() const
 
 void QmlJSSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *editor) const
 {
-    Highlighter *highlighter = new Highlighter;
-    const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
-    highlighter->setFormats(fs.toTextCharFormats(QmlJSTextEditorWidget::highlighterFormatCategories()));
-    editor->setSyntaxHighlighter(highlighter);
+    editor->setSyntaxHighlighter(new Highlighter);
     editor->setIndenter(new Indenter);
     editor->setAutoCompleter(new AutoCompleter);
 }
diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp
index e60d48c60e9cd746de6fb4e75d27131349fec721..3ce4692ca2c7cf4c7fedaa0471a65d21d3808512 100644
--- a/src/plugins/qt4projectmanager/profileeditor.cpp
+++ b/src/plugins/qt4projectmanager/profileeditor.cpp
@@ -190,25 +190,6 @@ void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e)
     showDefaultContextMenu(e, Constants::M_CONTEXT);
 }
 
-void ProFileEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
-{
-    TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    ProFileHighlighter *highlighter = qobject_cast<ProFileHighlighter*>(baseTextDocument()->syntaxHighlighter());
-    if (!highlighter)
-        return;
-
-    static QVector<TextEditor::TextStyle> categories;
-    if (categories.isEmpty()) {
-        categories << TextEditor::C_TYPE
-                   << TextEditor::C_KEYWORD
-                   << TextEditor::C_COMMENT
-                   << TextEditor::C_VISUAL_WHITESPACE;
-    }
-
-    highlighter->setFormats(fs.toTextCharFormats(categories));
-    highlighter->rehighlight();
-}
-
 //
 // ProFileDocument
 //
diff --git a/src/plugins/qt4projectmanager/profileeditor.h b/src/plugins/qt4projectmanager/profileeditor.h
index fc0a15f564ca6f52fea74508217243d4b4f57e90..4c86dfbf3b79d543b942acd1f13f75515932f0b1 100644
--- a/src/plugins/qt4projectmanager/profileeditor.h
+++ b/src/plugins/qt4projectmanager/profileeditor.h
@@ -75,9 +75,6 @@ protected:
     TextEditor::BaseTextEditor *createEditor();
     void contextMenuEvent(QContextMenuEvent *);
 
-public slots:
-    virtual void setFontSettings(const TextEditor::FontSettings &);
-
 private:
     ProFileEditorFactory *m_factory;
     TextEditor::TextEditorActionHandler *m_ah;
diff --git a/src/plugins/qt4projectmanager/profilehighlighter.cpp b/src/plugins/qt4projectmanager/profilehighlighter.cpp
index 7d346c070acf14792e2ee8b0759b8cd4886dc931..11e5b1424c5c65b29c159135f3215680acb41df7 100644
--- a/src/plugins/qt4projectmanager/profilehighlighter.cpp
+++ b/src/plugins/qt4projectmanager/profilehighlighter.cpp
@@ -43,6 +43,15 @@ ProFileHighlighter::ProFileHighlighter(QTextDocument *document) :
     ProFileCompletionAssistProvider *pcap
             = ExtensionSystem::PluginManager::getObject<ProFileCompletionAssistProvider>();
     m_keywords = TextEditor::Keywords(pcap->variables(), pcap->functions(), QMap<QString, QStringList>());
+
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_TYPE
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_VISUAL_WHITESPACE;
+    }
+    setTextFormatCategories(categories);
 }
 
 void ProFileHighlighter::highlightBlock(const QString &text)
@@ -58,26 +67,26 @@ void ProFileHighlighter::highlightBlock(const QString &text)
     for (;;) {
         const QChar c = text.at(i);
         if (inCommentMode) {
-            setFormat(i, 1, m_formats[ProfileCommentFormat]);
+            setFormat(i, 1, formatForCategory(ProfileCommentFormat));
         } else {
             if (c.isLetter() || c == QLatin1Char('_') || c == QLatin1Char('.') || c.isDigit()) {
                 buf += c;
                 setFormat(i - buf.length()+1, buf.length(), emptyFormat);
                 if (!buf.isEmpty() && m_keywords.isFunction(buf))
-                    setFormat(i - buf.length()+1, buf.length(), m_formats[ProfileFunctionFormat]);
+                    setFormat(i - buf.length()+1, buf.length(), formatForCategory(ProfileFunctionFormat));
                 else if (!buf.isEmpty() && m_keywords.isVariable(buf))
-                    setFormat(i - buf.length()+1, buf.length(), m_formats[ProfileVariableFormat]);
+                    setFormat(i - buf.length()+1, buf.length(), formatForCategory(ProfileVariableFormat));
             } else if (c == QLatin1Char('(')) {
                 if (!buf.isEmpty() && m_keywords.isFunction(buf))
-                    setFormat(i - buf.length(), buf.length(), m_formats[ProfileFunctionFormat]);
+                    setFormat(i - buf.length(), buf.length(), formatForCategory(ProfileFunctionFormat));
                 buf.clear();
             } else if (c == QLatin1Char('#')) {
                 inCommentMode = true;
-                setFormat(i, 1, m_formats[ProfileCommentFormat]);
+                setFormat(i, 1, formatForCategory(ProfileCommentFormat));
                 buf.clear();
             } else {
                 if (!buf.isEmpty() && m_keywords.isVariable(buf))
-                    setFormat(i - buf.length(), buf.length(), m_formats[ProfileVariableFormat]);
+                    setFormat(i - buf.length(), buf.length(), formatForCategory(ProfileVariableFormat));
                 buf.clear();
             }
         }
@@ -86,5 +95,5 @@ void ProFileHighlighter::highlightBlock(const QString &text)
             break;
     }
 
-    applyFormatToSpaces(text, m_formats[ProfileVisualWhitespaceFormat]);
+    applyFormatToSpaces(text, formatForCategory(ProfileVisualWhitespaceFormat));
 }
diff --git a/src/plugins/qt4projectmanager/profilehighlighter.h b/src/plugins/qt4projectmanager/profilehighlighter.h
index 9ae775785f6ad6be9c1e5b9a56e80c63bb8010ff..a7317962fd4afff6e418d229f43411f68020868a 100644
--- a/src/plugins/qt4projectmanager/profilehighlighter.h
+++ b/src/plugins/qt4projectmanager/profilehighlighter.h
@@ -51,14 +51,7 @@ public:
     ProFileHighlighter(QTextDocument *document = 0);
     void highlightBlock(const QString &text);
 
-    // Set formats from a sequence of type QTextCharFormat
-    void setFormats(const QVector<QTextCharFormat> &formats)
-    {
-        qCopy(formats.begin(), formats.end(), m_formats);
-    }
-
 private:
-    QTextCharFormat m_formats[NumProfileFormats];
     TextEditor::Keywords m_keywords;
 };
 
diff --git a/src/plugins/subversion/annotationhighlighter.cpp b/src/plugins/subversion/annotationhighlighter.cpp
index 8671bdb7a27b42d32677d68c88bceecf24df0672..f80b9f66acba3e9b174ab01045d30daa1f10ccf3 100644
--- a/src/plugins/subversion/annotationhighlighter.cpp
+++ b/src/plugins/subversion/annotationhighlighter.cpp
@@ -33,9 +33,8 @@ using namespace Subversion;
 using namespace Subversion::Internal;
 
 SubversionAnnotationHighlighter::SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                                 const QColor &bg,
                                                                  QTextDocument *document) :
-    VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
+    VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
     m_blank(QLatin1Char(' '))
 {
 }
diff --git a/src/plugins/subversion/annotationhighlighter.h b/src/plugins/subversion/annotationhighlighter.h
index 683e820215b064fc16a0aec5d4150ef451d2eaec..8d1e785dcaf54e3b85d34dfd9cd5c676507ca7c5 100644
--- a/src/plugins/subversion/annotationhighlighter.h
+++ b/src/plugins/subversion/annotationhighlighter.h
@@ -40,7 +40,7 @@ class SubversionAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighte
 {
     Q_OBJECT
 public:
-    explicit SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                              QTextDocument *document = 0);
 
 private:
diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp
index 569268686e23b73dd5ed439da83ece3248ab3a29..a64b401486dc8e84ab348334b99ec4bd0b7eaa72 100644
--- a/src/plugins/subversion/subversioneditor.cpp
+++ b/src/plugins/subversion/subversioneditor.cpp
@@ -109,10 +109,9 @@ QString SubversionEditor::changeUnderCursor(const QTextCursor &c) const
     return QString();
 }
 
-VcsBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                                  const QColor &bg) const
+VcsBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
 {
-    return new SubversionAnnotationHighlighter(changes, bg);
+    return new SubversionAnnotationHighlighter(changes);
 }
 
 QStringList SubversionEditor::annotationPreviousVersions(const QString &v) const
diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h
index ee883255a52ffdcbc62805c564330d74f2fde371..f59e5138fb9d02a2a53a0dc4f1d38ccc9ff834e3 100644
--- a/src/plugins/subversion/subversioneditor.h
+++ b/src/plugins/subversion/subversioneditor.h
@@ -48,7 +48,7 @@ public:
 private:
     QSet<QString> annotationChanges() const;
     QString changeUnderCursor(const QTextCursor &) const;
-    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
+    VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
     QStringList annotationPreviousVersions(const QString &) const;
 
     mutable QRegExp m_changeNumberPattern;
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 4b34ea0132d0f4363281eff15e9d1ee907d7ec45..15db797efca6a8996adfa68c636f48480689738d 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -5645,6 +5645,12 @@ void BaseTextEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
 
     slotUpdateExtraAreaWidth();   // Adjust to new font width
     updateCurrentLineHighlight(); // Make sure it takes the new color
+
+    SyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter();
+    if (highlighter) {
+        highlighter->setFontSettings(fs);
+        highlighter->rehighlight();
+    }
 }
 
 void BaseTextEditorWidget::setTabSettings(const TabSettings &ts)
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp
index d511e7a44c1b10b95984651b7d66f5cb9e993ff8..43c6e587b88c91bcfab39fe35b4fe549eff642e4 100644
--- a/src/plugins/texteditor/generichighlighter/highlighter.cpp
+++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp
@@ -60,7 +60,28 @@ Highlighter::Highlighter(QTextDocument *parent) :
     m_persistentObservableStatesCounter(PersistentsStart),
     m_dynamicContextsCounter(0),
     m_isBroken(false)
-{}
+{
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_TEXT
+                   << TextEditor::C_VISUAL_WHITESPACE
+                   << TextEditor::C_KEYWORD
+                   << TextEditor::C_TYPE
+                   << TextEditor::C_COMMENT
+                   << TextEditor::C_NUMBER
+                   << TextEditor::C_NUMBER
+                   << TextEditor::C_NUMBER
+                   << TextEditor::C_STRING
+                   << TextEditor::C_STRING
+                   << TextEditor::C_TEXT
+                   << TextEditor::C_TEXT
+                   << TextEditor::C_TEXT
+                   << TextEditor::C_TEXT
+                   << TextEditor::C_TEXT;
+    }
+
+    setTextFormatCategories(categories);
+}
 
 Highlighter::~Highlighter()
 {}
@@ -82,19 +103,14 @@ Highlighter::KateFormatMap::KateFormatMap()
     m_ids.insert(QLatin1String("dsChar"), Highlighter::Char);
     m_ids.insert(QLatin1String("dsString"), Highlighter::String);
     m_ids.insert(QLatin1String("dsComment"), Highlighter::Comment);
-    m_ids.insert(QLatin1String("dsOthers"), Highlighter::Others);
     m_ids.insert(QLatin1String("dsAlert"), Highlighter::Alert);
+    m_ids.insert(QLatin1String("dsError"), Highlighter::Error);
     m_ids.insert(QLatin1String("dsFunction"), Highlighter::Function);
     m_ids.insert(QLatin1String("dsRegionMarker"), Highlighter::RegionMarker);
-    m_ids.insert(QLatin1String("dsError"), Highlighter::Error);
-}
-
-void Highlighter::configureFormat(TextFormatId id, const QTextCharFormat &format)
-{
-    m_creatorFormats[id] = format;
+    m_ids.insert(QLatin1String("dsOthers"), Highlighter::Others);
 }
 
-void  Highlighter::setDefaultContext(const QSharedPointer<Context> &defaultContext)
+void Highlighter::setDefaultContext(const QSharedPointer<Context> &defaultContext)
 {
     m_defaultContext = defaultContext;
     m_persistentObservableStates.insert(m_defaultContext->name(), Default);
@@ -140,7 +156,7 @@ void Highlighter::highlightBlock(const QString &text)
         }
     }
 
-    applyFormatToSpaces(text, m_creatorFormats.value(VisualWhitespace));
+    applyFormatToSpaces(text, formatForCategory(VisualWhitespace));
 }
 
 void Highlighter::setupDataForBlock(const QString &text)
@@ -388,34 +404,30 @@ void Highlighter::applyFormat(int offset,
         return;
     }
 
-    TextFormatId formatId = m_kateFormats.m_ids.value(itemData->style());
+    TextFormatId formatId = m_kateFormats.m_ids.value(itemData->style(), Normal);
     if (formatId != Normal) {
-        QHash<TextFormatId, QTextCharFormat>::const_iterator cit =
-            m_creatorFormats.constFind(formatId);
-        if (cit != m_creatorFormats.constEnd()) {
-            QTextCharFormat format = cit.value();
-            if (itemData->isCustomized()) {
-                // Please notice that the following are applied every time for item data which have
-                // customizations. The configureFormats method could be used to provide a "one time"
-                // configuration, but it would probably require to traverse all item data from all
-                // definitions available/loaded (either to set the values or for some "notifying"
-                // strategy). This is because the highlighter does not really know on which
-                // definition(s) it is working. Since not many item data specify customizations I
-                // think this approach would fit better. If there are other ideas...
-                if (itemData->color().isValid())
-                    format.setForeground(itemData->color());
-                if (itemData->isItalicSpecified())
-                    format.setFontItalic(itemData->isItalic());
-                if (itemData->isBoldSpecified())
-                    format.setFontWeight(toFontWeight(itemData->isBold()));
-                if (itemData->isUnderlinedSpecified())
-                    format.setFontUnderline(itemData->isUnderlined());
-                if (itemData->isStrikeOutSpecified())
-                    format.setFontStrikeOut(itemData->isStrikeOut());
-            }
-
-            setFormat(offset, count, format);
+        QTextCharFormat format = formatForCategory(formatId);
+        if (itemData->isCustomized()) {
+            // Please notice that the following are applied every time for item data which have
+            // customizations. The configureFormats method could be used to provide a "one time"
+            // configuration, but it would probably require to traverse all item data from all
+            // definitions available/loaded (either to set the values or for some "notifying"
+            // strategy). This is because the highlighter does not really know on which
+            // definition(s) it is working. Since not many item data specify customizations I
+            // think this approach would fit better. If there are other ideas...
+            if (itemData->color().isValid())
+                format.setForeground(itemData->color());
+            if (itemData->isItalicSpecified())
+                format.setFontItalic(itemData->isItalic());
+            if (itemData->isBoldSpecified())
+                format.setFontWeight(toFontWeight(itemData->isBold()));
+            if (itemData->isUnderlinedSpecified())
+                format.setFontUnderline(itemData->isUnderlined());
+            if (itemData->isStrikeOutSpecified())
+                format.setFontStrikeOut(itemData->isStrikeOut());
         }
+
+        setFormat(offset, count, format);
     }
 }
 
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.h b/src/plugins/texteditor/generichighlighter/highlighter.h
index dc3445663a62e0faf591f69bec3b1054a7115329..5dbe5e6fc6f551b01b640d6d2db1faa50a4f3daf 100644
--- a/src/plugins/texteditor/generichighlighter/highlighter.h
+++ b/src/plugins/texteditor/generichighlighter/highlighter.h
@@ -65,12 +65,12 @@ public:
         VisualWhitespace,
         Keyword,
         DataType,
+        Comment,
         Decimal,
         BaseN,
         Float,
         Char,
         String,
-        Comment,
         Alert,
         Error,
         Function,
@@ -78,7 +78,6 @@ public:
         Others
     };
 
-    void configureFormat(TextFormatId id, const QTextCharFormat &format);
     void setTabSettings(const TabSettings &ts);
     void setDefaultContext(const QSharedPointer<Context> &defaultContext);
 
@@ -134,7 +133,6 @@ private:
         QHash<QString, TextFormatId> m_ids;
     };
     static const KateFormatMap m_kateFormats;
-    QHash<TextFormatId, QTextCharFormat> m_creatorFormats;
 
     struct BlockData : TextBlockUserData
     {
diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp
index 8bd4d46239036da4ea9c695f821a5d0a10ea1a01..61103b7bbf2336a6530d41dba5649581016e0594 100644
--- a/src/plugins/texteditor/plaintexteditor.cpp
+++ b/src/plugins/texteditor/plaintexteditor.cpp
@@ -38,15 +38,12 @@
 #include "manager.h"
 #include "context.h"
 #include "normalindenter.h"
-#include "fontsettings.h"
 
 #include <coreplugin/coreconstants.h>
 #include <coreplugin/icore.h>
 
 #include <QSharedPointer>
 
-#include <QDebug>
-
 using namespace Core;
 using namespace TextEditor::Internal;
 
@@ -94,30 +91,6 @@ void PlainTextEditorWidget::unCommentSelection()
     Utils::unCommentSelection(this, m_commentDefinition);
 }
 
-void PlainTextEditorWidget::setFontSettings(const FontSettings &fs)
-{
-    BaseTextEditorWidget::setFontSettings(fs);
-
-    if (baseTextDocument()->syntaxHighlighter()) {
-        Highlighter *highlighter =
-            static_cast<Highlighter *>(baseTextDocument()->syntaxHighlighter());
-
-        highlighter->configureFormat(Highlighter::VisualWhitespace, fs.toTextCharFormat(C_VISUAL_WHITESPACE));
-        highlighter->configureFormat(Highlighter::Keyword, fs.toTextCharFormat(C_KEYWORD));
-        highlighter->configureFormat(Highlighter::DataType, fs.toTextCharFormat(C_TYPE));
-        highlighter->configureFormat(Highlighter::Comment, fs.toTextCharFormat(C_COMMENT));
-        // Using C_NUMBER for all kinds of numbers.
-        highlighter->configureFormat(Highlighter::Decimal, fs.toTextCharFormat(C_NUMBER));
-        highlighter->configureFormat(Highlighter::BaseN, fs.toTextCharFormat(C_NUMBER));
-        highlighter->configureFormat(Highlighter::Float, fs.toTextCharFormat(C_NUMBER));
-        // Using C_STRING for strings and chars.
-        highlighter->configureFormat(Highlighter::Char, fs.toTextCharFormat(C_STRING));
-        highlighter->configureFormat(Highlighter::String, fs.toTextCharFormat(C_STRING));
-
-        highlighter->rehighlight();
-    }
-}
-
 void PlainTextEditorWidget::setTabSettings(const TextEditor::TabSettings &ts)
 {
     BaseTextEditorWidget::setTabSettings(ts);
diff --git a/src/plugins/texteditor/plaintexteditor.h b/src/plugins/texteditor/plaintexteditor.h
index 05f2be6fcb06a97d01cb12adb4a3efd75ab9f6f1..b1540b467b960e43bb3705c751edcc35cb5470ed 100644
--- a/src/plugins/texteditor/plaintexteditor.h
+++ b/src/plugins/texteditor/plaintexteditor.h
@@ -67,7 +67,6 @@ public:
 
 public slots:
     virtual void unCommentSelection();
-    virtual void setFontSettings(const FontSettings &fs);
     virtual void setTabSettings(const TextEditor::TabSettings &);
 
 private slots:
diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp
index de9c5acd09275b1fa6fc9b07d8352b57cb7f30c3..0ad601f162e2fd70b6dbe68a3a8753725c88f3d1 100644
--- a/src/plugins/texteditor/syntaxhighlighter.cpp
+++ b/src/plugins/texteditor/syntaxhighlighter.cpp
@@ -30,6 +30,10 @@
 #include "syntaxhighlighter.h"
 #include "basetextdocument.h"
 #include "basetextdocumentlayout.h"
+#include "texteditorsettings.h"
+#include "fontsettings.h"
+
+#include <utils/qtcassert.h>
 
 #include <qtimer.h>
 
@@ -70,12 +74,15 @@ public:
     }
 
     void applyFormatChanges(int from, int charsRemoved, int charsAdded);
+    void updateFormatsForCategories(const TextEditor::FontSettings &fontSettings);
 
     QVector<QTextCharFormat> formatChanges;
     QTextBlock currentBlock;
     bool rehighlightPending;
     bool inReformatBlocks;
     BaseTextDocumentLayout::FoldValidator foldValidator;
+    QVector<QTextCharFormat> formats;
+    QVector<TextEditor::TextStyle> formatCategories;
 };
 
 static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsRemoved, int charsAdded) {
@@ -784,4 +791,31 @@ QList<QColor> SyntaxHighlighter::generateColors(int n, const QColor &background)
     return result;
 }
 
+void SyntaxHighlighter::setFontSettings(const TextEditor::FontSettings &fontSettings)
+{
+    Q_D(SyntaxHighlighter);
+    d->updateFormatsForCategories(fontSettings);
+}
+
+void SyntaxHighlighter::setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories)
+{
+    Q_D(SyntaxHighlighter);
+    d->formatCategories = categories;
+    d->updateFormatsForCategories(TextEditorSettings::instance()->fontSettings());
+}
+
+QTextCharFormat SyntaxHighlighter::formatForCategory(int category) const
+{
+    Q_D(const SyntaxHighlighter);
+    QTC_ASSERT(d->formats.size() > category, return QTextCharFormat());
+
+    return d->formats.at(category);
+}
+
+void SyntaxHighlighterPrivate::updateFormatsForCategories(const TextEditor::FontSettings &fontSettings)
+{
+    formats = fontSettings.toTextCharFormats(formatCategories);
+}
+
+
 #include "moc_syntaxhighlighter.cpp"
diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h
index 8cee09a209ea11124d22e74a73432583181aaac2..e66fa86f72950337215e21dc57f529254598514c 100644
--- a/src/plugins/texteditor/syntaxhighlighter.h
+++ b/src/plugins/texteditor/syntaxhighlighter.h
@@ -31,7 +31,7 @@
 #define TEXTEDITOR_SYNTAXHIGHLIGHTER_H
 
 #include "texteditor_global.h"
-
+#include <texteditor/texteditorconstants.h>
 #include <QObject>
 #include <QTextLayout>
 
@@ -48,6 +48,7 @@ QT_END_NAMESPACE
 namespace TextEditor {
 
 class BaseTextDocument;
+class FontSettings;
 class SyntaxHighlighterPrivate;
 
 class TEXTEDITOR_EXPORT SyntaxHighlighter : public QObject
@@ -68,11 +69,15 @@ public:
 
     static QList<QColor> generateColors(int n, const QColor &background);
 
+    // Don't call in constructors of derived classes
+    virtual void setFontSettings(const TextEditor::FontSettings &fontSettings);
 public Q_SLOTS:
     void rehighlight();
     void rehighlightBlock(const QTextBlock &block);
 
 protected:
+    void setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories);
+    QTextCharFormat formatForCategory(int categoryIndex) const;
     virtual void highlightBlock(const QString &text) = 0;
 
     void setFormat(int start, int count, const QTextCharFormat &format);
diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp
index 3a04647103d486f238add17a2b2380216c1c6c9b..841b7ed479da3a5fc34171a33605fab163c83c5a 100644
--- a/src/plugins/vcsbase/baseannotationhighlighter.cpp
+++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp
@@ -28,6 +28,7 @@
 ****************************************************************************/
 
 #include "baseannotationhighlighter.h"
+#include <texteditor/fontsettings.h>
 
 #include <QDebug>
 #include <QColor>
@@ -51,34 +52,63 @@ typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap;
 */
 
 namespace VcsBase {
-namespace Internal {
 
 class BaseAnnotationHighlighterPrivate
 {
+    BaseAnnotationHighlighter *q_ptr;
+    Q_DECLARE_PUBLIC(BaseAnnotationHighlighter)
 public:
+    enum Formats {
+        BackgroundFormat // C_TEXT
+    };
+
+    BaseAnnotationHighlighterPrivate();
+
+    void updateOtherFormats();
+
     ChangeNumberFormatMap m_changeNumberMap;
     QColor m_background;
 };
 
-} // namespace Internal
+BaseAnnotationHighlighterPrivate::BaseAnnotationHighlighterPrivate()
+    : q_ptr(0)
+{
+}
+
+void BaseAnnotationHighlighterPrivate::updateOtherFormats()
+{
+    Q_Q(BaseAnnotationHighlighter);
+    m_background = q->formatForCategory(BackgroundFormat).brushProperty(QTextFormat::BackgroundBrush).color();
+    q->setChangeNumbers(m_changeNumberMap.keys().toSet());
+}
+
 
 BaseAnnotationHighlighter::BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
-                                                     const QColor &bg,
                                                      QTextDocument *document) :
     TextEditor::SyntaxHighlighter(document),
-    d(new Internal::BaseAnnotationHighlighterPrivate)
+    d_ptr(new BaseAnnotationHighlighterPrivate())
 {
-    d->m_background = bg;
+    d_ptr->q_ptr = this;
+
+    Q_D(BaseAnnotationHighlighter);
+
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty())
+        categories << TextEditor::C_TEXT;
+
+    setTextFormatCategories(categories);
+    d->updateOtherFormats();
+
     setChangeNumbers(changeNumbers);
 }
 
 BaseAnnotationHighlighter::~BaseAnnotationHighlighter()
 {
-    delete d;
 }
 
 void BaseAnnotationHighlighter::setChangeNumbers(const ChangeNumbers &changeNumbers)
 {
+    Q_D(BaseAnnotationHighlighter);
     d->m_changeNumberMap.clear();
     if (!changeNumbers.isEmpty()) {
         // Assign a color gradient to annotation change numbers. Give
@@ -99,6 +129,7 @@ void BaseAnnotationHighlighter::setChangeNumbers(const ChangeNumbers &changeNumb
 
 void BaseAnnotationHighlighter::highlightBlock(const QString &text)
 {
+    Q_D(BaseAnnotationHighlighter);
     if (text.isEmpty() || d->m_changeNumberMap.empty())
         return;
     const QString change = changeNumber(text);
@@ -107,10 +138,11 @@ void BaseAnnotationHighlighter::highlightBlock(const QString &text)
         setFormat(0, text.length(), it.value());
 }
 
-void BaseAnnotationHighlighter::setBackgroundColor(const QColor &color)
+void BaseAnnotationHighlighter::setFontSettings(const TextEditor::FontSettings &fontSettings)
 {
-    d->m_background = color;
-    setChangeNumbers(d->m_changeNumberMap.keys().toSet());
+    Q_D(BaseAnnotationHighlighter);
+    SyntaxHighlighter::setFontSettings(fontSettings);
+    d->updateOtherFormats();
 }
 
 } // namespace VcsBase
diff --git a/src/plugins/vcsbase/baseannotationhighlighter.h b/src/plugins/vcsbase/baseannotationhighlighter.h
index e1845477e4ee8293544878316a70b43bf1ef59de..ff5fdfb1a41a875c9bcde3d9911a97dda79033e5 100644
--- a/src/plugins/vcsbase/baseannotationhighlighter.h
+++ b/src/plugins/vcsbase/baseannotationhighlighter.h
@@ -35,17 +35,16 @@
 #include <texteditor/syntaxhighlighter.h>
 
 namespace VcsBase {
-namespace Internal {
 class BaseAnnotationHighlighterPrivate;
-} // namespace Internal
 
 class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighlighter
 {
     Q_OBJECT
+    Q_DECLARE_PRIVATE(BaseAnnotationHighlighter)
 public:
     typedef  QSet<QString> ChangeNumbers;
 
-    explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
+    explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
                                        QTextDocument *document = 0);
     virtual ~BaseAnnotationHighlighter();
 
@@ -53,13 +52,13 @@ public:
 
     virtual void highlightBlock(const QString &text);
 
-    void setBackgroundColor(const QColor &color);
+    virtual void setFontSettings(const TextEditor::FontSettings &fontSettings);
 
 private:
     // Implement this to return the change number of a line
     virtual QString changeNumber(const QString &block) const = 0;
 
-    Internal::BaseAnnotationHighlighterPrivate *const d;
+    QScopedPointer<BaseAnnotationHighlighterPrivate> d_ptr;
 };
 
 } // namespace VcsBase
diff --git a/src/plugins/vcsbase/diffhighlighter.cpp b/src/plugins/vcsbase/diffhighlighter.cpp
index 9a26fa5f58e595c2d05735e56bd1a1302a0dfc88..5798c30a73cb8bf63d6664fcf2b04d58d0a4ecf4 100644
--- a/src/plugins/vcsbase/diffhighlighter.cpp
+++ b/src/plugins/vcsbase/diffhighlighter.cpp
@@ -72,8 +72,7 @@ enum DiffFormats {
     DiffInFormat,
     DiffOutFormat,
     DiffFileFormat,
-    DiffLocationFormat,
-    NumDiffFormats
+    DiffLocationFormat
 };
 
 enum FoldingState {
@@ -83,61 +82,92 @@ enum FoldingState {
     Location
 };
 
+}; // namespace Internal;
+
+static inline QTextCharFormat invertedColorFormat(const QTextCharFormat &in)
+{
+    QTextCharFormat rc = in;
+    rc.setForeground(in.background());
+    rc.setBackground(in.foreground());
+    return rc;
+}
+
 // --- DiffHighlighterPrivate
 class DiffHighlighterPrivate
 {
+    DiffHighlighter *q_ptr;
+    Q_DECLARE_PUBLIC(DiffHighlighter)
 public:
     DiffHighlighterPrivate(const QRegExp &filePattern);
 
-    DiffFormats analyzeLine(const QString &block) const;
+    Internal::DiffFormats analyzeLine(const QString &block) const;
+    void updateOtherFormats();
 
     mutable QRegExp m_filePattern;
     const QString m_locationIndicator;
     const QChar m_diffInIndicator;
     const QChar m_diffOutIndicator;
-    QTextCharFormat m_formats[NumDiffFormats];
     QTextCharFormat m_addedTrailingWhiteSpaceFormat;
 
-    FoldingState m_foldingState;
+    Internal::FoldingState m_foldingState;
 };
 
 DiffHighlighterPrivate::DiffHighlighterPrivate(const QRegExp &filePattern) :
+    q_ptr(0),
     m_filePattern(filePattern),
     m_locationIndicator(QLatin1String("@@")),
     m_diffInIndicator(QLatin1Char('+')),
     m_diffOutIndicator(QLatin1Char('-')),
-    m_foldingState(StartOfFile)
+    m_foldingState(Internal::StartOfFile)
 {
     QTC_CHECK(filePattern.isValid());
 }
 
-DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const
+Internal::DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const
 {
     // Do not match on git "--- a/" as a deleted line, check
     // file first
     if (m_filePattern.indexIn(text) == 0)
-        return DiffFileFormat;
+        return Internal::DiffFileFormat;
     if (text.startsWith(m_diffInIndicator))
-        return DiffInFormat;
+        return Internal::DiffInFormat;
     if (text.startsWith(m_diffOutIndicator))
-        return DiffOutFormat;
+        return Internal::DiffOutFormat;
     if (text.startsWith(m_locationIndicator))
-        return DiffLocationFormat;
-    return DiffTextFormat;
+        return Internal::DiffLocationFormat;
+    return Internal::DiffTextFormat;
 }
 
-} // namespace Internal
+void DiffHighlighterPrivate::updateOtherFormats()
+{
+    Q_Q(DiffHighlighter);
+    m_addedTrailingWhiteSpaceFormat =
+            invertedColorFormat(q->formatForCategory(Internal::DiffInFormat));
+
+}
 
 // --- DiffHighlighter
 DiffHighlighter::DiffHighlighter(const QRegExp &filePattern) :
     TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(0)),
-    d(new Internal::DiffHighlighterPrivate(filePattern))
+    d_ptr(new DiffHighlighterPrivate(filePattern))
 {
+    d_ptr->q_ptr = this;
+    Q_D(DiffHighlighter);
+
+    static QVector<TextEditor::TextStyle> categories;
+    if (categories.isEmpty()) {
+        categories << TextEditor::C_TEXT
+                   << TextEditor::C_ADDED_LINE
+                   << TextEditor::C_REMOVED_LINE
+                   << TextEditor::C_DIFF_FILE
+                   << TextEditor::C_DIFF_LOCATION;
+    }
+    setTextFormatCategories(categories);
+    d->updateOtherFormats();
 }
 
 DiffHighlighter::~DiffHighlighter()
 {
-    delete d;
 }
 
 // Check trailing spaces
@@ -157,6 +187,7 @@ static inline int trimmedLength(const QString &in)
  */
 void DiffHighlighter::highlightBlock(const QString &text)
 {
+    Q_D(DiffHighlighter);
     if (text.isEmpty())
         return;
 
@@ -168,13 +199,13 @@ void DiffHighlighter::highlightBlock(const QString &text)
     case Internal::DiffInFormat: {
             // Mark trailing whitespace.
             const int trimmedLen = trimmedLength(text);
-            setFormat(0, trimmedLen, d->m_formats[format]);
+            setFormat(0, trimmedLen, formatForCategory(format));
             if (trimmedLen != length)
                 setFormat(trimmedLen, length - trimmedLen, d->m_addedTrailingWhiteSpaceFormat);
         }
         break;
     default:
-        setFormat(0, length, d->m_formats[format]);
+        setFormat(0, length, formatForCategory(format));
         break;
     }
 
@@ -234,24 +265,11 @@ void DiffHighlighter::highlightBlock(const QString &text)
     }
 }
 
-static inline QTextCharFormat invertedColorFormat(const QTextCharFormat &in)
+void DiffHighlighter::setFontSettings(const TextEditor::FontSettings &fontSettings)
 {
-    QTextCharFormat rc = in;
-    rc.setForeground(in.background());
-    rc.setBackground(in.foreground());
-    return rc;
-}
-
-void DiffHighlighter::setFormats(const QVector<QTextCharFormat> &s)
-{
-    if (s.size() == Internal::NumDiffFormats) {
-        qCopy(s.constBegin(), s.constEnd(), d->m_formats);
-        // Display trailing blanks with colors swapped
-        d->m_addedTrailingWhiteSpaceFormat =
-                invertedColorFormat(d->m_formats[Internal::DiffInFormat]);
-    } else {
-        qWarning("%s: insufficient setting size: %d", Q_FUNC_INFO, s.size());
-    }
+    Q_D(DiffHighlighter);
+    SyntaxHighlighter::setFontSettings(fontSettings);
+    d->updateOtherFormats();
 }
 
 } // namespace VcsBase
diff --git a/src/plugins/vcsbase/diffhighlighter.h b/src/plugins/vcsbase/diffhighlighter.h
index be55af5fc2289513cd76b94f3a314c46a9e44885..6ce2692e1824f5fa03d06471ae1ea568c5898a2d 100644
--- a/src/plugins/vcsbase/diffhighlighter.h
+++ b/src/plugins/vcsbase/diffhighlighter.h
@@ -44,23 +44,22 @@ namespace TextEditor { class FontSettingsPage; }
 
 namespace VcsBase {
 
-namespace Internal { class DiffHighlighterPrivate; }
+class DiffHighlighterPrivate;
 
 class VCSBASE_EXPORT DiffHighlighter : public TextEditor::SyntaxHighlighter
 {
     Q_OBJECT
-
+    Q_DECLARE_PRIVATE(DiffHighlighter)
 public:
     explicit DiffHighlighter(const QRegExp &filePattern);
     ~DiffHighlighter();
 
     void highlightBlock(const QString &text);
 
-    // Set formats from a sequence of type QTextCharFormat
-    void setFormats(const QVector<QTextCharFormat> &s);
+    virtual void setFontSettings(const TextEditor::FontSettings &fontSettings);
 
 private:
-    Internal::DiffHighlighterPrivate *const d;
+    QScopedPointer<DiffHighlighterPrivate> d_ptr;
 };
 
 } // namespace VcsBase
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index 1b90d8a28439e2b752694a8d89cc7641d14aa4ef..b2f24db9087d1971701574f8926e15ae50841a88 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -41,7 +41,6 @@
 #include <projectexplorer/session.h>
 #include <texteditor/basetextdocument.h>
 #include <texteditor/basetextdocumentlayout.h>
-#include <texteditor/fontsettings.h>
 #include <texteditor/texteditorsettings.h>
 #include <utils/qtcassert.h>
 
@@ -571,8 +570,6 @@ public:
     bool m_mouseDragging;
     QList<AbstractTextCursorHandler *> m_textCursorHandlers;
 
-    QColor m_backgroundColor;
-
 private:
     QComboBox *m_entriesComboBox;
 };
@@ -1048,7 +1045,7 @@ void VcsBaseEditorWidget::slotActivateAnnotation()
         ah->setChangeNumbers(changes);
         ah->rehighlight();
     } else {
-        baseTextDocument()->setSyntaxHighlighter(createAnnotationHighlighter(changes, d->m_backgroundColor));
+        baseTextDocument()->setSyntaxHighlighter(createAnnotationHighlighter(changes));
     }
 }
 
@@ -1186,33 +1183,6 @@ void VcsBaseEditorWidget::reportCommandFinished(bool ok, int exitCode, const QVa
         setPlainText(tr("Failed to retrieve data."));
 }
 
-void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
-{
-    TextEditor::BaseTextEditorWidget::setFontSettings(fs);
-    d->m_backgroundColor = fs.toTextCharFormat(TextEditor::C_TEXT)
-            .brushProperty(QTextFormat::BackgroundBrush).color();
-
-    if (d->m_parameters->type == AnnotateOutput) {
-        if (BaseAnnotationHighlighter *highlighter = qobject_cast<BaseAnnotationHighlighter *>(baseTextDocument()->syntaxHighlighter())) {
-            highlighter->setBackgroundColor(d->m_backgroundColor);
-            highlighter->rehighlight();
-        }
-    } else if (hasDiff()) {
-        if (DiffHighlighter *highlighter = qobject_cast<DiffHighlighter*>(baseTextDocument()->syntaxHighlighter())) {
-            static QVector<TextEditor::TextStyle> categories;
-            if (categories.isEmpty()) {
-                categories << TextEditor::C_TEXT
-                           << TextEditor::C_ADDED_LINE
-                           << TextEditor::C_REMOVED_LINE
-                           << TextEditor::C_DIFF_FILE
-                           << TextEditor::C_DIFF_LOCATION;
-            }
-            highlighter->setFormats(fs.toTextCharFormats(categories));
-            highlighter->rehighlight();
-        }
-    }
-}
-
 const VcsBaseEditorParameters *VcsBaseEditorWidget::findType(const VcsBaseEditorParameters *array,
                                                        int arraySize,
                                                        EditorContentType et)
diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h
index 4d0ee1c90192822bb062f008a6c2815c19cf1e47..b438b93bbe5a72937a2577f664d2fecfa81fd824 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.h
+++ b/src/plugins/vcsbase/vcsbaseeditor.h
@@ -217,9 +217,6 @@ protected:
     void mouseDoubleClickEvent(QMouseEvent *e);
     void keyPressEvent(QKeyEvent *);
 
-public slots:
-    void setFontSettings(const TextEditor::FontSettings &);
-
 private slots:
     void slotActivateAnnotation();
     void slotPopulateDiffBrowser();
@@ -244,8 +241,7 @@ protected:
     // Implement to identify a change number at the cursor position
     virtual QString changeUnderCursor(const QTextCursor &) const = 0;
     // Factory functions for highlighters
-    virtual BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes,
-                                                                   const QColor &bg) const = 0;
+    virtual BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const = 0;
     // Returns a local file name from the diff file specification
     // (text cursor at position above change hunk)
     QString fileNameFromDiffSpecification(const QTextBlock &inBlock) const;
diff --git a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro b/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro
index d2302a9b03e37befca2f081e07bd733a85c494f6..667ab9070fdce64a14a1ca5dcdbb8f9b26694d4f 100644
--- a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro
+++ b/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro
@@ -8,6 +8,7 @@ SOURCES += \
     tst_highlighterengine.cpp \
     highlightermock.cpp \
     formats.cpp \
+    syntaxhighlighter.cpp \
     $$GENERICHIGHLIGHTERDIR/highlighter.cpp \
     $$GENERICHIGHLIGHTERDIR/context.cpp \
     $$GENERICHIGHLIGHTERDIR/dynamicrule.cpp \
diff --git a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5d5c6c9abd885c31d558b5d62e89f06803b3eb14
--- /dev/null
+++ b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "syntaxhighlighter.h"
+#include "highlighter.h"
+#include "formats.h"
+
+using namespace TextEditor;
+using namespace Internal;
+
+QTextCharFormat SyntaxHighlighter::formatForCategory(int categoryIndex) const
+{
+    switch (categoryIndex) {
+    case Highlighter::Keyword:      return Formats::instance().keywordFormat();
+    case Highlighter::DataType:     return Formats::instance().dataTypeFormat();
+    case Highlighter::Decimal:      return Formats::instance().decimalFormat();
+    case Highlighter::BaseN:        return Formats::instance().baseNFormat();
+    case Highlighter::Float:        return Formats::instance().floatFormat();
+    case Highlighter::Char:         return Formats::instance().charFormat();
+    case Highlighter::String:       return Formats::instance().stringFormat();
+    case Highlighter::Comment:      return Formats::instance().commentFormat();
+    case Highlighter::Alert:        return Formats::instance().alertFormat();
+    case Highlighter::Error:        return Formats::instance().errorFormat();
+    case Highlighter::Function:     return Formats::instance().functionFormat();
+    case Highlighter::RegionMarker: return Formats::instance().regionMarketFormat();
+    case Highlighter::Others:       return Formats::instance().othersFormat();
+    default:                                  return QTextCharFormat();
+    }
+}
+
diff --git a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h
index ac22e00e1a22b60d2508d013708141364632dd9f..5caa7f9368cf60505faf3016377ed596134d168d 100644
--- a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h
+++ b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h
@@ -35,6 +35,7 @@
 // base instead of the real TextEditor::SyntaxHighlighter should not affect it.
 
 #include <QSyntaxHighlighter>
+#include <texteditor/texteditorconstants.h>
 
 namespace TextEditor {
 
@@ -47,6 +48,10 @@ public:
 protected:
     void applyFormatToSpaces(const QString &, const QTextCharFormat &)
     {}
+    void setTextFormatCategories(const QVector<TextEditor::TextStyle> &)
+    {}
+    QTextCharFormat formatForCategory(int categoryIndex) const;
+
 };
 
 }
diff --git a/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp b/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp
index 9ce100a67844f8e34e852a5085fe233c1734dacf..6d18ea18bcbaf067e3dd32580212a44fef4135ee 100644
--- a/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp
+++ b/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp
@@ -57,7 +57,7 @@ class tst_HighlighterEngine : public QObject
 public:
     tst_HighlighterEngine();
 
-private slots:    
+private slots:
     void initTestCase();
     void init();
 
@@ -130,20 +130,6 @@ void tst_HighlighterEngine::initTestCase()
     m_highlighterMock.reset(new HighlighterMock());
     m_highlighterMock->setDefaultContext(m_definition->initialContext());
     m_highlighterMock->setDocument(m_text.document());
-    m_highlighterMock->configureFormat(Highlighter::Keyword, Formats::instance().keywordFormat());
-    m_highlighterMock->configureFormat(Highlighter::DataType, Formats::instance().dataTypeFormat());
-    m_highlighterMock->configureFormat(Highlighter::Decimal, Formats::instance().decimalFormat());
-    m_highlighterMock->configureFormat(Highlighter::BaseN, Formats::instance().baseNFormat());
-    m_highlighterMock->configureFormat(Highlighter::Float, Formats::instance().floatFormat());
-    m_highlighterMock->configureFormat(Highlighter::Char, Formats::instance().charFormat());
-    m_highlighterMock->configureFormat(Highlighter::String, Formats::instance().stringFormat());
-    m_highlighterMock->configureFormat(Highlighter::Comment, Formats::instance().commentFormat());
-    m_highlighterMock->configureFormat(Highlighter::Alert, Formats::instance().alertFormat());
-    m_highlighterMock->configureFormat(Highlighter::Error, Formats::instance().errorFormat());
-    m_highlighterMock->configureFormat(Highlighter::Function, Formats::instance().functionFormat());
-    m_highlighterMock->configureFormat(Highlighter::RegionMarker,
-                                       Formats::instance().regionMarketFormat());
-    m_highlighterMock->configureFormat(Highlighter::Others, Formats::instance().othersFormat());
 }
 
 void tst_HighlighterEngine::init()
@@ -605,7 +591,7 @@ void tst_HighlighterEngine::testSimpleLine_data()
     HighlightSequence seqi(seqd);
     seqi.add(9, 17, Formats::instance().commentFormat());
     HighlightSequence seqj(seqd);
-    seqj.add(9, 11, Formats::instance().commentFormat());    
+    seqj.add(9, 11, Formats::instance().commentFormat());
     HighlightSequence seqk(0, 3);
     HighlightSequence seql(0, 3, Formats::instance().keywordFormat());
     HighlightSequence seqm(0, 2);