[hb-view] Use cached hb-ft face creation
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 4 Apr 2011 18:49:50 +0000 (14:49 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 4 Apr 2011 18:49:50 +0000 (14:49 -0400)
Avoids recreating the face the second time we call draw().

src/hb-view.c

index 0411b56..c4b942f 100644 (file)
@@ -241,7 +241,7 @@ _hb_cr_text_glyphs (cairo_t *cr,
 {
   cairo_scaled_font_t *scaled_font = cairo_get_scaled_font (cr);
   FT_Face ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
-  hb_face_t *hb_face = hb_ft_face_create (ft_face, NULL);
+  hb_face_t *hb_face = hb_ft_face_create_cached (ft_face);
   hb_font_t *hb_font = hb_ft_font_create (ft_face, NULL);
   hb_buffer_t *hb_buffer;
   cairo_glyph_t *cairo_glyphs;