summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qfontengine_ft.cpp11
-rw-r--r--src/gui/text/qfontengine_ft_p.h4
3 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 1cdbf6aa8e..1a71042648 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -152,8 +152,10 @@ static int getFontWeight(const QString &weightString)
return QFont::ExtraBold;
// And now the contains() checks for the translated strings.
+ //: The word for "Extra" as in "Extra Bold, Extra Thin" used as a pattern for string searches
const QString translatedExtra = QCoreApplication::translate("QFontDatabase", "Extra").toLower();
if (s.contains(translatedBold)) {
+ //: The word for "Demi" as in "Demi Bold" used as a pattern for string searches
QString translatedDemi = QCoreApplication::translate("QFontDatabase", "Demi").toLower();
if (s .contains(translatedDemi))
return QFont::DemiBold;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 9aab0282d3..b79f971156 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -510,7 +510,7 @@ void QFreetypeFace::addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoi
extern void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path);
-void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool)
+void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path)
{
if (slot->format != FT_GLYPH_FORMAT_BITMAP
|| slot->bitmap.pixel_mode != FT_PIXEL_MODE_MONO)
@@ -1430,7 +1430,7 @@ void QFontEngineFT::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyph
for (int gl = 0; gl < glyphs.numGlyphs; gl++) {
FT_UInt glyph = positioned_glyphs[gl];
FT_Load_Glyph(face, glyph, FT_LOAD_TARGET_MONO);
- freetype->addBitmapToPath(face->glyph, positions[gl], path);
+ QFreetypeFace::addBitmapToPath(face->glyph, positions[gl], path);
}
unlockFace();
}
@@ -1696,7 +1696,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matr
glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format)
{
- Glyph *g = loadGlyphFor(glyph, subPixelPosition, format, matrix);
+ Glyph *g = loadGlyphFor(glyph, subPixelPosition, format, matrix, true);
glyph_metrics_t overall;
if (g) {
@@ -1839,7 +1839,8 @@ void QFontEngineFT::unlockAlphaMapForGlyph()
QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
QFixed subPixelPosition,
GlyphFormat format,
- const QTransform &t)
+ const QTransform &t,
+ bool fetchBoundingBox)
{
FT_Face face = 0;
QGlyphSet *glyphSet = 0;
@@ -1852,7 +1853,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
Q_ASSERT(glyphSet != 0);
}
- if (glyphSet != 0 && glyphSet->outline_drawing)
+ if (glyphSet != 0 && glyphSet->outline_drawing && !fetchBoundingBox)
return 0;
Glyph *glyph = glyphSet != 0 ? glyphSet->getGlyph(g, subPixelPosition) : 0;
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 8fd5ca23af..1218893e19 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -102,7 +102,7 @@ public:
int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints);
static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale);
- static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool = false);
+ static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path);
private:
friend class QFontEngineFT;
@@ -266,7 +266,7 @@ private:
inline Glyph *loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format = Format_None, bool fetchMetricsOnly = false) const
{ return loadGlyph(cacheEnabled ? &defaultGlyphSet : 0, glyph, subPixelPosition, format, fetchMetricsOnly); }
Glyph *loadGlyph(QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat = Format_None, bool fetchMetricsOnly = false) const;
- Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t);
+ Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t, bool fetchBoundingBox = false);
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);