summaryrefslogtreecommitdiff
path: root/pango/pangofc-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-04-28 08:19:38 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-04-28 08:19:38 +0000
commit328a89098e50c5d007c57467d7b143ca8d28ca9f (patch)
tree3dafdd127d6def81c5dd110214d7f6b4a0538c1f /pango/pangofc-font.c
parent61064c7998cfcb870dbdf002021860903e3715e7 (diff)
downloadpango-328a89098e50c5d007c57467d7b143ca8d28ca9f.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.
Diffstat (limited to 'pango/pangofc-font.c')
-rw-r--r--pango/pangofc-font.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index e3585acf..a3583234 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -306,22 +306,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
@@ -359,16 +348,12 @@ 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.
+ /* Quantize the underline and strikethrough position to integer values.
*/
- if (fcfont->is_hinted)
- {
- pango_quantize_line_geometry (&metrics->underline_thickness,
- &metrics->underline_position);
- pango_quantize_line_geometry (&metrics->strikethrough_thickness,
- &metrics->strikethrough_position);
- }
+ pango_quantize_line_geometry (&metrics->underline_thickness,
+ &metrics->underline_position);
+ pango_quantize_line_geometry (&metrics->strikethrough_thickness,
+ &metrics->strikethrough_position);
PANGO_FC_FONT_UNLOCK_FACE (fcfont);
}
@@ -827,22 +812,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