Beispiel #1
0
void TextEdit::fontChanged(const QFont &f)
{
	if (m_param == NULL)
		return;
	if (f.bold() != m_bBold){
		m_bBold = f.bold();
		Command cmd;
		cmd->id    = CmdBold;
		cmd->flags = m_bBold ? COMMAND_CHECKED : 0;
		cmd->param = m_param;
		Event e(EventCommandChecked, cmd);
		e.process();
	}
	if (f.italic() != m_bItalic){
		m_bItalic = f.italic();
		Command cmd;
		cmd->id    = CmdItalic;
		cmd->flags = m_bItalic ? COMMAND_CHECKED : 0;
		cmd->param = m_param;
		Event e(EventCommandChecked, cmd);
		e.process();
	}
	if (f.underline() != m_bUnderline){
		m_bUnderline = f.underline();
		Command cmd;
		cmd->id    = CmdUnderline;
		cmd->flags = m_bUnderline ? COMMAND_CHECKED : 0;
		cmd->param = m_param;
		Event e(EventCommandChecked, cmd);
		e.process();
	}
}
void Contact::setUserListItem(const UserListItem &_u)
{
	u_=_u;
	u_.setAvatarFactory(account()->avatarFactory());
	QString s = name();

	if (u_.isSelf())
		s = account()->name();
	if(!description().isEmpty()) {
		QFont fnt;
		QFont fnt2;
		fnt2.fromString(PsiOptions::instance()->getOption("options.ui.look.font.contactlist").toString());
		fnt.fromString(PsiOptions::instance()->getOption("options.ui.look.font.status").toString());
		int size = fnt.pointSize() - fnt2.pointSize();
		s += "<br><font size='"+QString("%1").arg(size)+"' color='" + PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.status-messages").value<QColor>().name() + "'>";		
		if(fnt.bold())
			s += "<b>";
		if(fnt.italic())
			s += "<i>";
		if(PsiOptions::instance()->getOption("options.ui.style.rosterEmoticons").toBool())
			s += TextUtil::emoticonify(TextUtil::plain2rich(description()));
		else
			s += TextUtil::plain2rich(description());
		if(fnt.bold())
			s += "</b>";
		if(fnt.italic())
			s += "</i>";
		s += "</font>";
	}

	contactName_.setText(s, textColor(),
	contactList()->contactListView());
}
Beispiel #3
0
QString QtUiStyle::fontDescription(const QFont &font) const {
  QString desc = "font: ";
  if(font.italic())
    desc += "italic ";
  if(font.bold())
    desc += "bold ";
  if(!font.italic() && !font.bold())
    desc += "normal ";
  desc += QString("%1pt \"%2\"").arg(font.pointSize()).arg(font.family());
  return desc;
}
Beispiel #4
0
void FontEditor::update()
{
    if (m_object) {

        QVariant valueFont = m_object ? m_object->property(m_fontPropertyName.toLatin1()) : QVariant();
        setFont((valueFont.isValid() && valueFont.canConvert<QFont>()) ? valueFont.value<QFont>() : QFont());

        int indexFont = m_object->metaObject()->indexOfProperty(m_fontPropertyName.toLatin1());
        if (m_object->metaObject()->property(indexFont).hasNotifySignal()) {
            QMetaMethod signal = m_object->metaObject()->property(indexFont).notifySignal();
            QMetaMethod slot = this->metaObject()->method(this->metaObject()->indexOfSlot("fontFromObjectProperty()"));
            connect(m_object, signal, this, slot, Qt::UniqueConnection);
        }

        QVariant currentColorVar = m_object->property(m_colorPropertyName.toLatin1());
        ui->fontColor->setEnabled(currentColorVar.canConvert<QColor>());

    } else if (m_objectList.count()) {

        QString family;
        qreal size = -1;
        bool bold = false;
        bool italic = false;
        bool strikeout = false;
        bool underline = false;
        bool fontFound = false;
        bool colorFound = false;
        foreach(QObject * object, m_objectList) {
            QVariant fontValue = object->property(m_fontPropertyName.toLatin1());
            QVariant colorValue = object->property(m_colorPropertyName.toLatin1());
            if (fontValue.isValid() && fontValue.canConvert<QFont>()) {
                QFont f = fontValue.value<QFont>();
                if (!fontFound) {
                    family = f.family();
                    size = f.pointSizeF();
                    bold = f.bold();
                    italic = f.italic();
                    strikeout = f.strikeOut();
                    underline = f.underline();
                    fontFound = true;
                } else {
                    if (f.family() != family) family = QString();
                    if (f.pointSizeF() != size) size = -1;
                    if (f.bold() != bold) bold = false;
                    if (f.italic() != italic) italic = false;
                    if (f.strikeOut() != strikeout) strikeout = false;
                    if (f.underline() != underline) underline = false;
                }
            }
            if (!colorFound && colorValue.isValid() && colorValue.canConvert<QColor>()) {
                colorFound = true;
            }

        }
/*!
 * Test Cut Rich Text.
 */
void Ut_MRichTextEdit::testCut()
{
    QString htmlText = "<b>bold</b>";
    m_subject->document()->setHtml(htmlText);
    m_subject->setSelection(0, 4, false);

    QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier, QString(""));
    m_subject->keyPressEvent(event);

    htmlText = "text";
    m_subject->document()->setHtml(htmlText);

    QFont curFont = m_subject->currentFont();
    bool curBoldStyle = curFont.bold();
    QCOMPARE(curBoldStyle, false);
    delete event;

    event = new QKeyEvent(QEvent::KeyPress, Qt::Key_V, Qt::ControlModifier, QString(""));
    m_subject->keyPressEvent(event);

    curFont = m_subject->currentFont();
    curBoldStyle = curFont.bold();
    QCOMPARE(curBoldStyle, true);
    delete event;

    htmlText = "<i>italic</i>";
    m_subject->document()->setHtml(htmlText);
    m_subject->setSelection(0, 4, false);

    event = new QKeyEvent(QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier, QString(""));
    m_subject->keyPressEvent(event);

    htmlText = "text";
    m_subject->document()->setHtml(htmlText);

    curFont = m_subject->currentFont();
    bool curItalicStyle = curFont.italic();
    QCOMPARE(curItalicStyle, false);
    delete event;

    event = new QKeyEvent(QEvent::KeyPress, Qt::Key_V, Qt::ControlModifier, QString(""));
    m_subject->keyPressEvent(event);

    curFont = m_subject->currentFont();
    curItalicStyle = curFont.italic();
    QCOMPARE(curItalicStyle, true);
    delete event;
    event = 0;
}
/*!
 * Test SetFontBold.
 */
void Ut_MRichTextEdit::testSetFontBold()
{
    QFont curFont = m_subject->currentFont();
    bool curBoldStyle = curFont.bold();
    QCOMPARE(curBoldStyle, false);

    QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_B, Qt::ControlModifier, QString(""));
    m_subject->keyPressEvent(event);
    curFont = m_subject->currentFont();
    curBoldStyle = curFont.bold();
    QCOMPARE(curBoldStyle, true);

    delete event;
    event = 0;
}
Beispiel #7
0
static int selectFont( lua_State* L )
{
	bool ok;
	QFont f;
	if( lua_gettop(L) > 0 )
	{
		f = QFont( luaL_checkstring( L, 1 ),	// Name
		luaL_checknumber( L, 2 ),			// pointsize
		( luaL_checknumber( L, 3 ) )?QFont::Bold:QFont::Normal,	// Bold
		luaL_checknumber( L, 4 ) );			// Italic
	}
	f = QFontDialog::getFont( &ok, f, 0 );
	if( !ok )
	{
		lua_pushnil( L );
		lua_pushnil( L );
		lua_pushnil( L );
		lua_pushnil( L );
	}else
	{
		lua_pushstring( L, f.family() );
		lua_pushnumber( L, f.pointSize() );
		lua_pushboolean( L, f.bold() );
		lua_pushboolean( L, f.italic() );
	}
	return 4;
}
Beispiel #8
0
bool QFontProto::bold() const
{
  QFont *item = qscriptvalue_cast<QFont*>(thisObject());
  if (item)
    return item->bold();
  return false;
}
QRect KoDocumentSectionDelegate::decorationRect(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    int width = option.decorationSize.width();
    if (index.data(Qt::DecorationRole).value<QIcon>().isNull())
        width = 0;
    switch(d->view->displayMode()) {
    case View::ThumbnailMode: {
        QFont font = option.font;
        if (index.data(Model::ActiveRole).toBool())
            font.setBold(!font.bold());
        const QFontMetrics metrics(font);
        const int totalwidth = metrics.width(index.data(Qt::DisplayRole).toString()) + width + d->margin;
        int left;
        if (totalwidth < option.rect.width())
            left = (option.rect.width() - totalwidth) / 2;
        else
            left = 0;
        return QRect(left, thumbnailRect(option, index).bottom() + d->margin, width, textBoxHeight(option));
    }
    case View::DetailedMode:
    case View::MinimalMode: {
        const int left = thumbnailRect(option, index).right() + d->margin;
        return QRect(left, 0, width, textBoxHeight(option));
    }
    default: return QRect();
    }
}
FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, int wordSpacing, int letterSpacing)
    : m_data(adoptRef(new FontPlatformDataPrivate()))
{
    QFont font;
    int requestedSize = description.computedPixelSize();
    font.setFamily(familyName);
    if (requestedSize)
    font.setPixelSize(requestedSize);
    font.setItalic(description.italic());
    font.setWeight(toQFontWeight(description.weight()));
    font.setWordSpacing(wordSpacing);
    font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
    if (description.fontSmoothing() == NoSmoothing)
        font.setStyleStrategy(QFont::NoAntialias);
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    if (description.fontSmoothing() == AutoSmoothing && !Font::shouldUseSmoothing())
        font.setStyleStrategy(QFont::NoAntialias);
#endif

    m_data->bold = font.bold();
    // WebKit allows font size zero but QFont does not. We will return
    // m_data->size if a font size of zero is requested and pixelSize()
    // otherwise.
    m_data->size = (!requestedSize) ? requestedSize : font.pixelSize();
    m_data->rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
}
void
body_view::set_font(const QFont& font)
{
  QString s;
  if (!font.family().isEmpty()) {
    s.append("font-family:\"" + font.family() + "\";");
  }
  if (font.pointSize()>1) {
    s.append(QString("font-size:%1 pt;").arg(font.pointSize()));
  }
  else if (font.pixelSize()>1) {
    s.append(QString("font-size:%1 px;").arg(font.pixelSize()));
  }
  if (font.bold()) {
    s.append("font-weight: bold;");
  }
  if (font.style()==QFont::StyleItalic) {
    s.append("font-style: italic;");
  }
  else if (font.style()==QFont::StyleOblique) {
    s.append("font-style: oblique;");
  }
  m_font_css=s;
  set_body_style();
}
Beispiel #12
0
LabelCreator::LabelCreator(QWidget *parent)
  : QDialog(parent) {

  setupUi(this);
  setWindowTitle(tr("Create Label Dialog"));
  _bold->setFixedWidth(32);
  _bold->setFixedHeight(32);
  _bold->setIcon(QPixmap(":kst_bold.png"));
  _italic->setFixedWidth(32);
  _italic->setFixedHeight(32);
  _italic->setIcon(QPixmap(":kst_italic.png"));
  _labelColor->setFixedWidth(32);
  _labelColor->setFixedHeight(32);

  _labelText->setObjectStore(kstApp->mainWindow()->document()->objectStore());

  QFont font;
  font.fromString(dialogDefaults().value("label/font",font.toString()).toString());
  _family->setCurrentFont(font);
  _bold->setChecked(font.bold());
  _italic->setChecked(font.italic());

  _labelColor->setColor(dialogDefaults().value("label/color",QColor(Qt::black)).value<QColor>());
  _labelFontScale->setValue(dialogDefaults().value("label/fontScale",12).toDouble());
  if (dialogDefaults().value("label/fixLeft",true).toBool()) {
    _left->setChecked(true);
  } else {
    _right->setChecked(true);
  }
  _lockPosToData->setChecked(dialogDefaultsLockPosToData("label"));
  _saveAsDefault->show();

  _Label_11->setProperty("si","Font &size:");
  _Label_12->setProperty("si","Font famil&y:");
}
void XYZTextEditor::fontChanged(const QFont &f) {
    m_ui->comboFont->setCurrentIndex(m_ui->comboFont->findText(QFontInfo(f).family()));
    m_ui->comboSize->setCurrentIndex(m_ui->comboSize->findText(QString::number(f.pointSize())));
    m_ui->btnTextBold->setChecked(f.bold());
    m_ui->btnTextItalic->setChecked(f.italic());
    m_ui->btnUnderline->setChecked(f.underline());
}
Beispiel #14
0
TextSettingsDialog::TextSettingsDialog(QWidget *parent, const OptionsMap& settings)
: BaseSettingsDialog(parent) {

    setupUi(this);
    new HelpButton(this, buttonBox, "17467707");

    curColor = qvariant_cast<QColor>(settings[LABEL_COLOR]);

#if (QT_VERSION < 0x050000) //Qt 5
    QStyle *buttonStyle = new QPlastiqueStyle;
#else
    QStyle *buttonStyle = new QProxyStyle(QStyleFactory::create("fusion"));
#endif
    buttonStyle->setParent(colorButton);
    colorButton->setStyle(buttonStyle);

    updateColorButton();
    QFont curFont = qvariant_cast<QFont>(settings[LABEL_FONT]);
    fontComboBox->setCurrentFont(curFont);
    sizeSpinBox->setValue(curFont.pointSize());

    boldToolButton->setChecked(curFont.bold());
    italicToolButton->setChecked(curFont.italic());
    underlineToolButton->setChecked(curFont.underline());
    overlineToolButton->setChecked(curFont.overline());

    overlineToolButton->setVisible(false);

    connect(colorButton, SIGNAL(clicked()), SLOT(sl_colorButton()));
}
Beispiel #15
0
void
message_view::setFont(const QFont& font)
{
  m_headersv->setFont(font);
  QString s="body {";
  if (!font.family().isEmpty()) {
    s.append("font-family:\"" + font.family() + "\";");
  }
  if (font.pointSize()>1) {
    s.append(QString("font-size:%1 pt;").arg(font.pointSize()));
  }
  else if (font.pixelSize()>1) {
    s.append(QString("font-size:%1 px;").arg(font.pixelSize()));
  }
  if (font.bold()) {
    s.append("font-weight: bold;");
  }
  if (font.style()==QFont::StyleItalic) {
    s.append("font-style: italic;");
  }
  else if (font.style()==QFont::StyleOblique) {
    s.append("font-style: oblique;");
  }
  s.append("}\n");
  m_bodyv->set_body_style(s);
  //  m_bodyv->redisplay();
}
Beispiel #16
0
void KNFontDialog::setInitialFont(const QFont &font)
{
    //Save the initial font as the result font.
    m_resultFont=font;
    //Set the font to previewer.
    m_previewer->setFont(font);
    //Sync the font size.
    syncFontSize(font.pointSizeF());
    //Sync the font family.
    //Clear the filter of proxy model first.
    m_fontFamilyFilter->setFilterFixedString("");
    //Find and select the font family.
    m_fontComboBox->setCurrentFont(font);
    QModelIndex fontProxyIndex=
            m_fontFamilyFilter->mapFromSource(
                m_fontComboBox->model()->index(m_fontComboBox->currentIndex(),
                                               0));
    m_fontFamilyList->setCurrentIndex(fontProxyIndex);
    m_fontFamilyList->scrollTo(fontProxyIndex);
    //Sync the font style.
    m_fontStyles[Bold]->setChecked(font.bold());
    m_fontStyles[Italic]->setChecked(font.italic());
    m_fontStyles[Underline]->setChecked(font.underline());
    m_fontStyles[StrikeOut]->setChecked(font.strikeOut());
    m_fontStyles[Kerning]->setChecked(font.kerning());
}
Beispiel #17
0
QString Tools::cssFontDefinition(const QFont &font, bool onlyFontFamily)
{
	// The font definition:
	QString definition = QString(font.italic() ? "italic " : "") +
	                     QString(font.bold()   ? "bold "   : "") +
	                     QString::number(QFontInfo(font).pixelSize()) + "px ";

	// Then, try to match the font name with a standard CSS font family:
	QString genericFont = "";
	if (definition.contains("serif", false) || definition.contains("roman", false))
		genericFont = "serif";
	// No "else if" because "sans serif" must be counted as "sans". So, the order between "serif" and "sans" is important
	if (definition.contains("sans", false) || definition.contains("arial", false) || definition.contains("helvetica", false))
		genericFont = "sans-serif";
	if (definition.contains("mono",       false) || definition.contains("courier", false) ||
	    definition.contains("typewriter", false) || definition.contains("console", false) ||
	    definition.contains("terminal",   false) || definition.contains("news",    false))
		genericFont = "monospace";

	// Eventually add the generic font family to the definition:
	QString fontDefinition = "\"" + font.family() + "\"";
	if (!genericFont.isEmpty())
		fontDefinition += ", " + genericFont;

	if (onlyFontFamily)
		return fontDefinition;

	return definition + fontDefinition;
}
Beispiel #18
0
QFont MainWindow::getSystemVolumeFont()
{
	QFont f = this->font() ;
	f.setItalic( !f.italic() ) ;
	f.setBold( !f.bold() ) ;
	return f ;
}
Beispiel #19
0
void View::paintText()
{
    glColor3f(1.f, 1.f, 1.f);

    // QGLWidget's renderText takes xy coordinates, a string, and a font
    renderText(10, 20, "A: Left shift",this->font());
    renderText(10, 35, "D: Right shift", this->font());
    renderText(10, 50, "R: Random Track", this->font());
    renderText(10, 65, "T: Reset Camera", this->font());
    renderText(10, 80, "F: Follow the Comet", this->font());
    renderText(10, 95, "3: Earth", this->font());
    renderText(10, 110,"B: Enable/Disable Bump Mapping", this->font());
    renderText(10, 125,"L: Show Lines", this->font());
    renderText(10, 140,"Space: quit", this->font());

    if(globalcounter > 265)
    {
        glPushMatrix();
        glLoadIdentity();
        QFont font = QFont("Times New Roman", 30, 4);
        font.bold();
        font.setPointSize(50);
        renderText(width()/2.f-50*3.5, height()/2.f,"Thank you", font);

        glPopMatrix();
    }

}
Beispiel #20
0
void
Item::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
{
    bool dirty = false;
    QStringList &cs_m_dirs = CollectionSetup::instance()->m_dirs;

    // Figure out if a child folder is activated
    for ( QStringList::const_iterator iter = cs_m_dirs.begin(); iter != cs_m_dirs.end();
            ++iter )
        if ( ( *iter ).startsWith( m_url.path(1) ) )
            if ( *iter != "/" ) // "/" should not match as a child of "/"
                dirty = true;

    // Use a different color if this folder has an activated child folder
    const QFont f = p->font();
    QColorGroup _cg = cg;
    if ( dirty )
    {
        _cg.setColor( QColorGroup::Text, listView()->colorGroup().link() );
        QFont font = p->font();
        font.setBold( !font.bold() );
        p->setFont( font );
    }

    QCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align );
    p->setFont( f );
}
static XFontSet getFontSet(const QFont &f)
{
    int i = 0;
    if (f.italic())
        i |= 1;
    if (f.bold())
        i |= 2;

    if (f.pointSize() > 20)
        i += 4;

    if (!fontsetCache[i]) {
        Display* dpy = X11->display;
        int missCount;
        char** missList;
        fontsetCache[i] = XCreateFontSet(dpy, fontsetnames[i], &missList, &missCount, 0);
        if(missCount > 0)
            XFreeStringList(missList);
        if (!fontsetCache[i]) {
            fontsetCache[i] = XCreateFontSet(dpy, "-*-fixed-*-*-*-*-16-*", &missList, &missCount, 0);
            if(missCount > 0)
                XFreeStringList(missList);
            if (!fontsetCache[i])
                fontsetCache[i] = (XFontSet)-1;
        }
    }
    return (fontsetCache[i] == (XFontSet)-1) ? 0 : fontsetCache[i];
}
void FontSetupPage::changeFont(const QString &style)
{
    QFont font = m_plainTextEdit->font();
    bool bold = font.bold();
    QFont::Style italic = font.style();

    if (style == "Italic") {
        bold = false;
        italic = QFont::StyleItalic;
    } else if (style == "Bold") {
        bold = true;
        italic = QFont::StyleNormal;
    } else if (style == "Bold Italic") {
        bold = true;
        italic = QFont::StyleItalic;
    } else if (style == "Normal") {
        bold = false;
        italic = QFont::StyleNormal;
    }

    font.setBold(bold);
    font.setStyle(italic);
    m_plainTextEdit->setFont(font);

    m_font = font;
}
void QgsFieldConditionalFormatWidget::setFormattingFromStyle( QgsConditionalStyle style )
{
  btnBackgroundColor->setColor( style.backgroundColor() );
  btnTextColor->setColor( style.textColor() );
  if ( !style.icon().isNull() )
  {
    checkIcon->setChecked( true );
    QIcon icon( style.icon() );
    btnChangeIcon->setIcon( icon );
  }
  else
  {
    checkIcon->setChecked( false );
    btnChangeIcon->setIcon( QIcon() );
  }
  if ( style.symbol() )
  {
    mSymbol = style.symbol()->clone();
  }
  else
  {
    mSymbol = 0;
  }
  QFont font = style.font();
  mFontBoldBtn->setChecked( font.bold() );
  mFontItalicBtn->setChecked( font.italic() );
  mFontStrikethroughBtn->setChecked( font.strikeOut() );
  mFontUnderlineBtn->setChecked( font.underline() );
  mFontFamilyCmbBx->setFont( font );
}
void TextEdit::fontChanged( const QFont &f )
{
    comboFont->lineEdit()->setText( f.family() );
    comboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
    actionTextBold->setOn( f.bold() );
    actionTextItalic->setOn( f.italic() );
    actionTextUnderline->setOn( f.underline() );
}
Beispiel #25
0
void TextEdit::fontChanged(const QFont &f)
{
    comboFont->setCurrentIndex(comboFont->findText(QFontInfo(f).family()));
    comboSize->setCurrentIndex(comboSize->findText(QString::number(f.pointSize())));
    actionTextBold->setChecked(f.bold());
    actionTextItalic->setChecked(f.italic());
    actionTextUnderline->setChecked(f.underline());
}
Beispiel #26
0
void MTTextEdit::fontChanged(const QFont & f)
{
    fontComboBox->setCurrentIndex(fontComboBox->findText(QFontInfo(f).family()));
    sizeComboBox->setCurrentIndex(sizeComboBox->findText(QString::number(f.pointSize())));
    tbtnBold->setChecked(f.bold());
    tbtnItalic->setChecked(f.italic());
    tbtnUnderlined->setChecked(f.underline());
}
Beispiel #27
0
/**
 * Sets the font weight to \a b
 *
 * @param b True to enable bold, false otherwise.
 */
void TextItem::setBold(bool b)
{
    QFont f = font();
    if(b != f.bold()) {
        f.setBold(b);
        QGraphicsTextItem::setFont(f);
    }
}
Beispiel #28
0
 virtual void paintCell( QPainter * p, const QColorGroup &cg, int c, int w, int a )
 {
     QFont f = p->font();
     if( isOn() )
         f.setBold( !f.bold() );
     p->setFont( f );
     super::paintCell( p, cg, c, w, a );
 }
void MainWindow::fontChanged(const QFont &f)
{
    comboFont->setCurrentIndex(comboFont->findText(QFontInfo(f).family()));
    comboSize->setCurrentIndex(comboSize->findText(QString::number(f.pointSize())));
    textBoldAction->setChecked(f.bold());
    textItalicAction->setChecked(f.italic());
    textUnderlineAction->setChecked(f.underline());
}
Beispiel #30
0
void PostWidget::setStyle(const QColor& color, const QColor& back, const QColor& read, const QColor& readBack, const QColor& own, const QColor& ownBack, const QFont& font)
{
    QString fntStr = "font-family:\"" + font.family() + "\"; font-size:" + QString::number(font.pointSize()) + "pt;";
    fntStr += (font.bold() ? " font-weight:bold;" : QString()) + (font.italic() ? " font-style:italic;" : QString());
    unreadStyle = baseStyle.arg( getColorString(color), getColorString(back), fntStr);
    readStyle = baseStyle.arg( getColorString(read), getColorString(readBack), fntStr );
    ownStyle = baseStyle.arg( getColorString(own), getColorString(ownBack), fntStr );
}