[pango/kill-ft-face: 12/17] fc: Make pango_fc_font_kern_glyphs empty
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/kill-ft-face: 12/17] fc: Make pango_fc_font_kern_glyphs empty
- Date: Fri, 12 Jul 2019 03:58:22 +0000 (UTC)
commit b08bb43373af0143ecd861cc80eddaa56b7d243f
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 24 16:54:34 2019 +0000
fc: Make pango_fc_font_kern_glyphs empty
This function has long been deprecated;
and it is is using freetype. So drop the
implementation.
pango/pangofc-font.c | 62 +++++-----------------------------------------------
1 file changed, 5 insertions(+), 57 deletions(-)
---
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index f140ec3d..c7fd066a 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -722,8 +722,11 @@ _pango_fc_font_shutdown (PangoFcFont *font)
* @font: a #PangoFcFont
* @glyphs: a #PangoGlyphString
*
- * Adjust each adjacent pair of glyphs in @glyphs according to
- * kerning information in @font.
+ * This function used to adjust each adjacent pair of glyphs
+ * in @glyphs according to kerning information in @font.
+ *
+ * Since 1.44, it does nothing.
+ *
*
* Since: 1.4
* Deprecated: 1.32
@@ -732,61 +735,6 @@ void
pango_fc_font_kern_glyphs (PangoFcFont *font,
PangoGlyphString *glyphs)
{
- FT_Error error;
- FT_Vector kerning;
- int i;
- gboolean hinting = font->is_hinted;
- gboolean scale = FALSE;
- double xscale = 1;
- PangoFcFontKey *key;
- FT_Face face;
-
- g_return_if_fail (PANGO_IS_FC_FONT (font));
- g_return_if_fail (glyphs != NULL);
-
- face = PANGO_FC_FONT_LOCK_FACE (font);
- if (G_UNLIKELY (!face))
- return;
-
- if (!FT_HAS_KERNING (face))
- {
- PANGO_FC_FONT_UNLOCK_FACE (font);
- return;
- }
-
- key = _pango_fc_font_get_font_key (font);
- if (key) {
- const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key);
- PangoMatrix identity = PANGO_MATRIX_INIT;
- if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 2 * sizeof (double))))
- {
- scale = TRUE;
- pango_matrix_get_font_scale_factors (matrix, &xscale, NULL);
- if (xscale) xscale = 1 / xscale;
- }
- }
-
- for (i = 1; i < glyphs->num_glyphs; ++i)
- {
- error = FT_Get_Kerning (face,
- glyphs->glyphs[i-1].glyph,
- glyphs->glyphs[i].glyph,
- ft_kerning_default,
- &kerning);
-
- if (error == FT_Err_Ok) {
- int adjustment = PANGO_UNITS_26_6 (kerning.x);
-
- if (hinting)
- adjustment = PANGO_UNITS_ROUND (adjustment);
- if (G_UNLIKELY (scale))
- adjustment *= xscale;
-
- glyphs->glyphs[i-1].geometry.width += adjustment;
- }
- }
-
- PANGO_FC_FONT_UNLOCK_FACE (font);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]