~ubuntu-branches/ubuntu/maverick/pango1.0/maverick-proposed

« back to all changes in this revision

Viewing changes to pango/pangofc-font.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-11-18 07:40:39 UTC
  • mfrom: (1.5.8 upstream) (64.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091118074039-7d88ewja7jajppz6
Tags: 1.26.1-1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
807
807
  FT_Vector kerning;
808
808
  int i;
809
809
  gboolean hinting = font->is_hinted;
 
810
  gboolean scale = FALSE;
 
811
  double xscale = 1;
 
812
  PangoFcFontKey *key;
810
813
 
811
814
  g_return_if_fail (PANGO_IS_FC_FONT (font));
812
815
  g_return_if_fail (glyphs != NULL);
821
824
      return;
822
825
    }
823
826
 
 
827
  /* This is a kludge, and dupped in pango_ot_buffer_output().
 
828
   * Should move the scale factor to PangoFcFont layer. */
 
829
  key = _pango_fc_font_get_font_key (font);
 
830
  if (key) {
 
831
    const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key);
 
832
    PangoMatrix identity = PANGO_MATRIX_INIT;
 
833
    if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 2 * sizeof (double))))
 
834
      {
 
835
        scale = TRUE;
 
836
        pango_matrix_get_font_scale_factors (matrix, &xscale, NULL);
 
837
        if (xscale) xscale = 1 / xscale;
 
838
      }
 
839
  }
 
840
 
824
841
  for (i = 1; i < glyphs->num_glyphs; ++i)
825
842
    {
826
843
      error = FT_Get_Kerning (face,
834
851
 
835
852
        if (hinting)
836
853
          adjustment = PANGO_UNITS_ROUND (adjustment);
 
854
        if (G_UNLIKELY (scale))
 
855
          adjustment *= xscale;
837
856
 
838
857
        glyphs->glyphs[i-1].geometry.width += adjustment;
839
858
      }