summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp4
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp28
-rw-r--r--src/gui/text/qfontengine_qpf.cpp10
-rw-r--r--src/gui/text/qfontengine_x11.cpp5
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtexthtmlparser.cpp2
6 files changed, 25 insertions, 26 deletions
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index f62a6d1..9a29de2 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -767,8 +767,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
QString fn = qwsFontPath();
fn += QLatin1Char('/');
fn += family->name.toLower()
- + QLatin1String("_") + QString::number(pixelSize*10)
- + QLatin1String("_") + QString::number(style->key.weight)
+ + QLatin1Char('_') + QString::number(pixelSize*10)
+ + QLatin1Char('_') + QString::number(style->key.weight)
+ (style->key.style == QFont::StyleItalic ?
QLatin1String("i.qpf") : QLatin1String(".qpf"));
//###rotation ###
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 70e1599..605a7dd 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -509,9 +509,9 @@ bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *d
fd->styleStrategy |= QFont::NoAntialias;
fd->family = QString::fromLatin1(tokens[Family]);
QString foundry = QString::fromLatin1(tokens[Foundry]);
- if (! foundry.isEmpty() && foundry != QString::fromLatin1("*") && (!desc || desc->family->count > 1))
+ if (! foundry.isEmpty() && foundry != QLatin1String("*") && (!desc || desc->family->count > 1))
fd->family +=
- QString::fromLatin1(" [") + foundry + QString::fromLatin1("]");
+ QLatin1String(" [") + foundry + QLatin1Char(']');
if (qstrlen(tokens[AddStyle]) > 0)
fd->addStyle = QString::fromLatin1(tokens[AddStyle]);
@@ -1802,30 +1802,30 @@ QFontEngine *QFontDatabase::loadXlfd(int screen, int script, const QFontDef &req
QByteArray xlfd("-");
xlfd += desc.foundry->name.isEmpty() ? QByteArray("*") : desc.foundry->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.family->name.isEmpty() ? QByteArray("*") : desc.family->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.style->weightName ? desc.style->weightName : "*";
- xlfd += "-";
+ xlfd += '-';
xlfd += (desc.style->key.style == QFont::StyleItalic
- ? "i"
- : (desc.style->key.style == QFont::StyleOblique ? "o" : "r"));
- xlfd += "-";
+ ? 'i'
+ : (desc.style->key.style == QFont::StyleOblique ? 'o' : 'r'));
+ xlfd += '-';
xlfd += desc.style->setwidthName ? desc.style->setwidthName : "*";
// ### handle add-style
xlfd += "-*-";
xlfd += QByteArray::number(px);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xpoint);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xres);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->yres);
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.encoding->pitch;
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->avgwidth);
- xlfd += "-";
+ xlfd += '-';
xlfd += xlfd_for_id(desc.encoding->encoding);
FM_DEBUG(" using XLFD: %s\n", xlfd.data());
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index b7d1c59..28eb362 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -308,7 +308,7 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
readOnly = true;
#if defined(DEBUG_FONTENGINE)
- qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ")";
+ qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ')';
#endif
#ifndef QT_FONTS_ARE_RESOURCES
@@ -316,11 +316,11 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
if (!renderingFontEngine)
return;
- fileName = fontDef.family.toLower() + QLatin1String("_")
+ fileName = fontDef.family.toLower() + QLatin1Char('_')
+ QString::number(fontDef.pixelSize)
- + QLatin1String("_") + QString::number(fontDef.weight)
+ + QLatin1Char('_') + QString::number(fontDef.weight)
+ (fontDef.style != QFont::StyleNormal ?
- QLatin1String("_italic") : QLatin1String(""))
+ QLatin1String("_italic") : QLatin1String())
+ QLatin1String(".qsf");
fileName.replace(QLatin1Char(' '), QLatin1Char('_'));
fileName.prepend(qws_fontCacheDir());
@@ -550,7 +550,7 @@ bool QFontEngineQPF::stringToCMap(const QChar *str, int len, QGlyphLayout *glyph
#if 0 && defined(DEBUG_FONTENGINE)
QChar c(uc);
if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c))
- qDebug() << "glyph for character" << c << "/" << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
+ qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
seenGlyphs.insert(c);
#endif
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp
index 0972b2b..bafc99d 100644
--- a/src/gui/text/qfontengine_x11.cpp
+++ b/src/gui/text/qfontengine_x11.cpp
@@ -227,7 +227,7 @@ static QFontEngine::FaceId fontFile(const QByteArray &_xname, QFreetypeFace **fr
QByteArray best_mapping;
for (QStringList::ConstIterator it = fontpath.constBegin(); it != fontpath.constEnd(); ++it) {
- if ((*it).left(1) != QLatin1String("/"))
+ if (!(*it).startsWith(QLatin1Char('/')))
continue; // not a path name, a font server
QString fontmapname;
int num = 0;
@@ -693,9 +693,8 @@ QFontEngine::FaceId QFontEngineXLFD::faceId() const
if (freetype) {
const_cast<QFontEngineXLFD *>(this)->fsType = freetype->fsType();
} else {
- QFontEngine::Properties properties = QFontEngine::properties();
face_id.index = 0;
- face_id.filename = "-" + properties.postscriptName;
+ face_id.filename = '-' + QFontEngine::properties().postscriptName;
}
}
#endif
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index c66d0c1..fa032e6 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2500,7 +2500,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
LDEBUG << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
-// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ")";
+// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ')';
if (previousBlockFormat) {
qreal margin = qMax(blockFormat.topMargin(), previousBlockFormat->bottomMargin());
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index b1f1b75..ee743dc 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -499,7 +499,7 @@ void QTextHtmlParser::dumpHtml()
{
for (int i = 0; i < count(); ++i) {
qDebug().nospace() << qPrintable(QString(depth(i)*4, QLatin1Char(' ')))
- << qPrintable(at(i).tag) << ":"
+ << qPrintable(at(i).tag) << ':'
<< quoteNewline(at(i).text);
;
}