summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-04-28 08:23:00 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-04-28 08:23:00 +0000
commitec3767fb459f7388a48c02b67f72c71e8cdd675b (patch)
treeece09756ac31c4683913768a5d4098009b325289
parent2bd503ca850ddabd4d9d31dd9a1552820ad28a6a (diff)
downloadpango-ec3767fb459f7388a48c02b67f72c71e8cdd675b.tar.gz
Don't use is_hinted. Metrics are always hinted now.
2006-04-28 Behdad Esfahbod <behdad@gnome.org> * pango/pangofc-font.c (get_face_metrics), (pango_fc_font_get_raw_extents): Don't use is_hinted. Metrics are always hinted now. * pango/pangoxft-font.c (_pango_xft_font_new): Remove hack that forced is_hinted to TRUE.
-rw-r--r--ChangeLog9
-rw-r--r--pango/pangofc-font.c41
-rw-r--r--pango/pangoxft-font.c6
3 files changed, 14 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bd28259..8edf3b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-04-28 Behdad Esfahbod <behdad@gnome.org>
+
+ * pango/pangofc-font.c (get_face_metrics),
+ (pango_fc_font_get_raw_extents): Don't use is_hinted. Metrics are
+ always hinted now.
+
+ * pango/pangoxft-font.c (_pango_xft_font_new): Remove hack that forced
+ is_hinted to TRUE.
+
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
* pangocairo.pc.in, pangocairo-uninstalled.pc.in: Remove CAIRO_CFLAGS
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index d6e2d8fd..42a063e8 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -328,22 +328,11 @@ get_face_metrics (PangoFcFont *fcfont,
FT_Vector_Transform (&vector, &ft_matrix);
metrics->ascent = PANGO_UNITS_26_6 (vector.y);
}
- else if (fcfont->is_hinted ||
- (face->face_flags & FT_FACE_FLAG_SCALABLE) == 0)
+ else
{
metrics->descent = - PANGO_UNITS_26_6 (face->size->metrics.descender);
metrics->ascent = PANGO_UNITS_26_6 (face->size->metrics.ascender);
}
- else
- {
- FT_Fixed ascender, descender;
-
- descender = FT_MulFix (face->descender, face->size->metrics.y_scale);
- metrics->descent = - PANGO_UNITS_26_6 (descender);
-
- ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale);
- metrics->ascent = PANGO_UNITS_26_6 (ascender);
- }
/* Versions of FreeType < 2.1.8 get underline thickness wrong
* for Postscript fonts (always zero), so we need a fallback
@@ -381,14 +370,8 @@ get_face_metrics (PangoFcFont *fcfont,
metrics->strikethrough_position = (PANGO_SCALE * face->size->metrics.y_ppem) / 4;
}
- /* If hinting is on for this font, quantize the underline and strikethrough position
- * to integer values.
- */
- if (fcfont->is_hinted)
- {
- quantize_position (&metrics->underline_thickness, &metrics->underline_position);
- quantize_position (&metrics->strikethrough_thickness, &metrics->strikethrough_position);
- }
+ quantize_position (&metrics->underline_thickness, &metrics->underline_position);
+ quantize_position (&metrics->strikethrough_thickness, &metrics->strikethrough_position);
PANGO_FC_FONT_UNLOCK_FACE (fcfont);
}
@@ -847,22 +830,8 @@ pango_fc_font_get_raw_extents (PangoFcFont *fcfont,
{
logical_rect->x = 0;
logical_rect->width = PANGO_UNITS_26_6 (gm->horiAdvance);
- if (fcfont->is_hinted ||
- (face->face_flags & FT_FACE_FLAG_SCALABLE) == 0)
- {
- logical_rect->y = - PANGO_UNITS_26_6 (face->size->metrics.ascender);
- logical_rect->height = PANGO_UNITS_26_6 (face->size->metrics.ascender - face->size->metrics.descender);
- }
- else
- {
- FT_Fixed ascender, descender;
-
- ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale);
- descender = FT_MulFix (face->descender, face->size->metrics.y_scale);
-
- logical_rect->y = - PANGO_UNITS_26_6 (ascender);
- logical_rect->height = PANGO_UNITS_26_6 (ascender - descender);
- }
+ logical_rect->y = - PANGO_UNITS_26_6 (face->size->metrics.ascender);
+ logical_rect->height = PANGO_UNITS_26_6 (face->size->metrics.ascender - face->size->metrics.descender);
}
}
else
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c
index fe3844fb..d0ef5caa 100644
--- a/pango/pangoxft-font.c
+++ b/pango/pangoxft-font.c
@@ -96,12 +96,6 @@ _pango_xft_font_new (PangoXftFontMap *xftfontmap,
"pattern", pattern,
NULL);
- /* Hack to force hinting of vertical metrics; hinting off for
- * a Xft font just means to not hint outlines, but we still
- * want integer line spacing, underline positions, etc
- */
- PANGO_FC_FONT (xfont)->is_hinted = TRUE;
-
xfont->xft_font = NULL;
return xfont;