[cairo-commit] cairo/src cairo_ft_font.c,1.11,1.12 cairo_matrix.c,1.6,1.7

Carl Worth commit at pdx.freedesktop.org
Mon Dec 15 18:02:06 PST 2003


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory pdx:/tmp/cvs-serv23322/src

Modified Files:
	cairo_ft_font.c cairo_matrix.c 
Log Message:

        * src/cairo_matrix.c (_cairo_matrix_compute_scale_factors): Move
        this function from cairo_ft_font.c (_get_scale_factors).


Index: cairo_ft_font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ft_font.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** cairo_ft_font.c	16 Dec 2003 01:26:25 -0000	1.11
--- cairo_ft_font.c	16 Dec 2003 02:02:03 -0000	1.12
***************
*** 266,283 ****
  
  static void
- _get_scale_factors(cairo_matrix_t *matrix, double *sx, double *sy)
- {
-     double e0, e1;
-     e1 = 1.; e0 = 0.;
- 
-     cairo_matrix_transform_distance (matrix, &e1, &e0);
-     *sx = sqrt(e1*e1 + e0*e0);
- 
-     e1 = 1.; e0 = 0.;
-     cairo_matrix_transform_distance (matrix, &e0, &e1);
-     *sy = sqrt(e1*e1 + e0*e0);    
- }
- 
- static void
  _install_font_matrix(cairo_matrix_t *matrix, FT_Face face)
  {
--- 266,269 ----
***************
*** 294,298 ****
       */
  
!     _get_scale_factors(matrix, &scale_x, &scale_y);
      
      cairo_matrix_copy (&normalized, matrix);
--- 280,284 ----
       */
  
!     _cairo_matrix_compute_scale_factors (matrix, &scale_x, &scale_y);
      
      cairo_matrix_copy (&normalized, matrix);
***************
*** 373,377 ****
      cairo_status_t status = CAIRO_STATUS_SUCCESS;
  
!     _get_scale_factors(&font->matrix, &scale_x, &scale_y);
  
  #define FONT_UNIT_TO_DEV(x) ((double)(x) / (double)(ft->face->units_per_EM))
--- 359,363 ----
      cairo_status_t status = CAIRO_STATUS_SUCCESS;
  
!     _cairo_matrix_compute_scale_factors (&font->matrix, &scale_x, &scale_y);
  
  #define FONT_UNIT_TO_DEV(x) ((double)(x) / (double)(ft->face->units_per_EM))

Index: cairo_matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_matrix.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cairo_matrix.c	23 Oct 2003 14:47:29 -0000	1.6
--- cairo_matrix.c	16 Dec 2003 02:02:03 -0000	1.7
***************
*** 387,388 ****
--- 387,407 ----
      return CAIRO_STATUS_SUCCESS;
  }
+ 
+ /* Compute the amount that each basis vector is scaled by. */
+ cairo_status_t
+ _cairo_matrix_compute_scale_factors (cairo_matrix_t *matrix, double *sx, double *sy)
+ {
+     double x, y;
+ 
+     x = 1.0;
+     y = 0.0;
+     cairo_matrix_transform_distance (matrix, &x, &y);
+     *sx = sqrt(x*x + y*y);
+ 
+     x = 0.0;
+     y = 1.0;
+     cairo_matrix_transform_distance (matrix, &x, &y);
+     *sy = sqrt(x*x + y*y);
+ 
+     return CAIRO_STATUS_SUCCESS;
+ }





More information about the cairo-commit mailing list