[cairo-commit] src/cairo-ft-font.c

Carl Worth cworth at kemper.freedesktop.org
Fri Sep 1 16:10:32 PDT 2006


 src/cairo-ft-font.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

New commits:
diff-tree 7c97a787ebce4880d6b9fe47a13ad018ff2ecd31 (from 0a1aef157ef6cfea8608e7d037583c29cb2da5fe)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Sep 1 16:10:25 2006 -0700

    bug 8104: Eliminate unused variables. Replicate assert statement to identify branch of interest.

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index eddf715..38897a8 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -603,7 +603,6 @@ _cairo_ft_unscaled_font_set_scale (cairo
 {
     cairo_ft_font_transform_t sf;
     FT_Matrix mat;
-    FT_UInt pixel_width, pixel_height;
     FT_Error error;
 
     assert (unscaled->face != NULL);
@@ -642,19 +641,16 @@ _cairo_ft_unscaled_font_set_scale (cairo
     FT_Set_Transform(unscaled->face, &mat, NULL);
 
     if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) {
-	pixel_width = sf.x_scale;
-	pixel_height = sf.y_scale;
 	error = FT_Set_Char_Size (unscaled->face,
 				  sf.x_scale * 64.0,
 				  sf.y_scale * 64.0,
 				  0, 0);
+	assert (error == 0);
     } else {
 	double min_distance = DBL_MAX;
 	int i;
 	int best_i = 0;
 
-	pixel_width = pixel_height = 0;
-
 	for (i = 0; i < unscaled->face->num_fixed_sizes; i++) {
 #if HAVE_FT_BITMAP_SIZE_Y_PPEM
 	    double size = unscaled->face->available_sizes[i].y_ppem / 64.;
@@ -678,9 +674,8 @@ _cairo_ft_unscaled_font_set_scale (cairo
 	    error = FT_Set_Pixel_Sizes (unscaled->face,
 					unscaled->face->available_sizes[best_i].width,
 					unscaled->face->available_sizes[best_i].height);
+	assert (error == 0);
     }
-
-    assert (error == 0);
 }
 
 /* Empirically-derived subpixel filtering values thanks to Keith


More information about the cairo-commit mailing list