summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-05-03 13:50:10 +0200
committerJiang Jiang <jiang.jiang@nokia.com>2011-05-04 14:34:31 +0200
commitedf55f7d500a18c04e1f7244958491c79e7674cf (patch)
tree1d4b200991962f697e2f2cc04c29e3e425f72d63 /src/gui/text
parent2a8d50ed6a8e3ca6a03b407028ea175460af6e2f (diff)
Remove QFontEngineFT::loadGlyphMetrics
It is no longer used and was accidentally merged back in. Reviewed-by: Eskil (cherry picked from commit 782535ac548c582542bd1c17207e288e816870a8)
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_ft.cpp100
-rw-r--r--src/gui/text/qfontengine_ft_p.h1
2 files changed, 0 insertions, 101 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 58bcca87b7..237cde4ed1 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -803,106 +803,6 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
return load_flags;
}
-QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const
-{
- Glyph *g = set->getGlyph(glyph);
- if (g && g->format == format)
- return g;
-
- bool hsubpixel = false;
- int vfactor = 1;
- int load_flags = loadFlags(set, format, 0, hsubpixel, vfactor);
-
- // apply our matrix to this, but note that the metrics will not be affected by this.
- FT_Face face = lockFace();
- FT_Matrix matrix = this->matrix;
- FT_Matrix_Multiply(&set->transformationMatrix, &matrix);
- FT_Set_Transform(face, &matrix, 0);
- freetype->matrix = matrix;
-
- bool transform = matrix.xx != 0x10000 || matrix.yy != 0x10000 || matrix.xy != 0 || matrix.yx != 0;
- if (transform)
- load_flags |= FT_LOAD_NO_BITMAP;
-
- FT_Error err = FT_Load_Glyph(face, glyph, load_flags);
- if (err && (load_flags & FT_LOAD_NO_BITMAP)) {
- load_flags &= ~FT_LOAD_NO_BITMAP;
- err = FT_Load_Glyph(face, glyph, load_flags);
- }
- if (err == FT_Err_Too_Few_Arguments) {
- // this is an error in the bytecode interpreter, just try to run without it
- load_flags |= FT_LOAD_FORCE_AUTOHINT;
- err = FT_Load_Glyph(face, glyph, load_flags);
- }
- if (err != FT_Err_Ok)
- qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
-
- unlockFace();
- if (set->outline_drawing)
- return 0;
-
- if (!g) {
- g = new Glyph;
- g->uploadedToServer = false;
- g->data = 0;
- }
-
- FT_GlyphSlot slot = face->glyph;
- if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(slot);
- int left = slot->metrics.horiBearingX;
- int right = slot->metrics.horiBearingX + slot->metrics.width;
- int top = slot->metrics.horiBearingY;
- int bottom = slot->metrics.horiBearingY - slot->metrics.height;
- if (transform && slot->format != FT_GLYPH_FORMAT_BITMAP) { // freetype doesn't apply the transformation on the metrics
- int l, r, t, b;
- FT_Vector vector;
- vector.x = left;
- vector.y = top;
- FT_Vector_Transform(&vector, &matrix);
- l = r = vector.x;
- t = b = vector.y;
- vector.x = right;
- vector.y = top;
- FT_Vector_Transform(&vector, &matrix);
- if (l > vector.x) l = vector.x;
- if (r < vector.x) r = vector.x;
- if (t < vector.y) t = vector.y;
- if (b > vector.y) b = vector.y;
- vector.x = right;
- vector.y = bottom;
- FT_Vector_Transform(&vector, &matrix);
- if (l > vector.x) l = vector.x;
- if (r < vector.x) r = vector.x;
- if (t < vector.y) t = vector.y;
- if (b > vector.y) b = vector.y;
- vector.x = left;
- vector.y = bottom;
- FT_Vector_Transform(&vector, &matrix);
- if (l > vector.x) l = vector.x;
- if (r < vector.x) r = vector.x;
- if (t < vector.y) t = vector.y;
- if (b > vector.y) b = vector.y;
- left = l;
- right = r;
- top = t;
- bottom = b;
- }
- left = FLOOR(left);
- right = CEIL(right);
- bottom = FLOOR(bottom);
- top = CEIL(top);
-
- g->linearAdvance = face->glyph->linearHoriAdvance >> 10;
- g->width = TRUNC(right-left);
- g->height = TRUNC(top-bottom);
- g->x = TRUNC(left);
- g->y = TRUNC(top);
- g->advance = TRUNC(ROUND(face->glyph->advance.x));
- g->format = Format_None;
-
- return g;
-}
-
QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
QFixed subPixelPosition,
GlyphFormat format,
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 2c335f3cd3..41064715b1 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -343,7 +343,6 @@ protected:
private:
friend class QFontEngineFTRawFont;
- QFontEngineFT::Glyph *loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const;
int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const;
GlyphFormat defaultFormat;