[pango/harfbuzz-ng-external] Adjust to hb-ng scale cleanup



commit cc66aacf34962b7e874c11da26f2a0c987e69737
Author: Behdad Esfahbod <behdad behdad org>
Date:   Wed May 19 15:54:43 2010 -0400

    Adjust to hb-ng scale cleanup

 modules/basic/basic-fc.c |    7 +++----
 pango/pango-ot-buffer.c  |    6 +++---
 pango/pango-ot-info.c    |    6 +++---
 3 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 2888944..b3619c3 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -33,8 +33,7 @@
 #include <hb-ft.h>
 #include <hb-glib.h>
 
-#define PANGO_SCALE_26_6 (PANGO_SCALE / (1<<6))
-#define PANGO_UNITS_26_6(d)    ((d) * PANGO_SCALE_26_6)
+#define PANGO_UNITS_26_6(d)	((d) << 4)
 
 
 /* No extra fields needed */
@@ -249,8 +248,8 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
 		     &context);
   hb_font_set_scale (hb_font,
 		     /* XXX CTM */
-		     PANGO_UNITS_26_6 (ft_face->size->metrics.x_scale),
-		     PANGO_UNITS_26_6 (ft_face->size->metrics.y_scale));
+		     ((guint64) ft_face->size->metrics.x_scale * ft_face->units_per_EM) >> 12,
+		     ((guint64) ft_face->size->metrics.y_scale * ft_face->units_per_EM) >> 12);
   is_hinted = fc_font->is_hinted;
   hb_font_set_ppem (hb_font,
 		    is_hinted ? ft_face->size->metrics.x_ppem : 0,
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index 2d8d6e6..43dbfb4 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -273,12 +273,12 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer,
       glyphs->glyphs[i].attr.is_cluster_start = glyphs->log_clusters[i] != last_cluster;
       last_cluster = glyphs->log_clusters[i];
 
-      advance = PANGO_UNITS_26_6(hb_position->x_advance);
+      advance = hb_position->x_advance;
       if (is_hinted)
 	advance = PANGO_UNITS_ROUND (advance);
       glyphs->glyphs[i].geometry.width = advance;
-      glyphs->glyphs[i].geometry.x_offset =  PANGO_UNITS_26_6 (hb_position->x_offset);
-      glyphs->glyphs[i].geometry.y_offset = -PANGO_UNITS_26_6 (hb_position->y_offset);
+      glyphs->glyphs[i].geometry.x_offset =  hb_position->x_offset;
+      glyphs->glyphs[i].geometry.y_offset = -hb_position->y_offset;
 
       hb_glyph++;
       hb_position++;
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 961f30f..cdb4d38 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -536,8 +536,8 @@ _pango_ot_info_position    (const PangoOTInfo    *info,
   /* XXX reuse hb_font */
   hb_font = hb_font_create ();
   hb_font_set_scale (hb_font,
-		     info->face->size->metrics.x_scale,
-		     info->face->size->metrics.y_scale);
+		     ((guint64) info->face->size->metrics.x_scale * info->face->units_per_EM) >> 12,
+		     ((guint64) info->face->size->metrics.y_scale * info->face->units_per_EM) >> 12);
   is_hinted = buffer->font->is_hinted;
   hb_font_set_ppem (hb_font,
 		    is_hinted ? info->face->size->metrics.x_ppem : 0,
@@ -558,7 +558,7 @@ _pango_ot_info_position    (const PangoOTInfo    *info,
 	{
 	  PangoRectangle logical_rect;
 	  pango_font_get_glyph_extents ((PangoFont *) buffer->font, hb_glyph->codepoint, NULL, &logical_rect);
-	  hb_position->x_advance = PANGO_UNITS_TO_26_6 (logical_rect.width);
+	  hb_position->x_advance = logical_rect.width;
 	}
       else
 	hb_position->x_advance = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]