[cairo-commit] cairo/src cairo.h,1.37,1.38 cairo_ft_font.c,1.13,1.14 cairo_gstate.c,1.36,1.37

Carl Worth commit at pdx.freedesktop.org
Mon Dec 15 19:00:17 PST 2003


Committed by: cworth

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

Modified Files:
	cairo.h cairo_ft_font.c cairo_gstate.c 
Log Message:

        * src/cairo_gstate.c (_cairo_gstate_text_extents):
        (_cairo_gstate_glyph_extents):
        * src/cairo_ft_font.c (_cairo_ft_font_glyph_extents):
        (_cairo_ft_font_glyph_extents):
        * src/cairo.h: Rename cairo_text_exextents_t fields:
                left_side_bearing -> x_bearing
                ascent -> y_bearing
                right_side_bearing (replaced by) width
                descent (replaced by) height


Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** cairo.h	16 Dec 2003 02:26:51 -0000	1.37
--- cairo.h	16 Dec 2003 03:00:15 -0000	1.38
***************
*** 349,356 ****
  
  typedef struct {
!     double left_side_bearing;
!     double right_side_bearing;
!     double ascent;
!     double descent;
      double x_advance;
      double y_advance;
--- 349,356 ----
  
  typedef struct {
!     double x_bearing;
!     double y_bearing;
!     double width;
!     double height;
      double x_advance;
      double y_advance;

Index: cairo_ft_font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ft_font.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** cairo_ft_font.c	16 Dec 2003 02:26:51 -0000	1.13
--- cairo_ft_font.c	16 Dec 2003 03:00:15 -0000	1.14
***************
*** 388,395 ****
      if (num_glyphs == 0)
      {
! 	extents->left_side_bearing = 0.0;
! 	extents->right_side_bearing = 0.0;
! 	extents->ascent = 0.0;
! 	extents->descent = 0.0;
  	extents->x_advance = 0.0;
  	extents->y_advance = 0.0;
--- 388,395 ----
      if (num_glyphs == 0)
      {
! 	extents->x_bearing = 0.0;
! 	extents->y_bearing = 0.0;
! 	extents->width  = 0.0;
! 	extents->height = 0.0;
  	extents->x_advance = 0.0;
  	extents->y_advance = 0.0;
***************
*** 436,443 ****
      }
  
!     extents->left_side_bearing  = total_min.x - origin.x;
!     extents->right_side_bearing = total_max.x - origin.x;
!     extents->ascent             = total_min.y - origin.y;
!     extents->descent            = total_max.y - origin.y;
      extents->x_advance = glyphs[i-1].x + DOUBLE_FROM_26_6 (metrics->horiAdvance) - origin.x;
      extents->y_advance = glyphs[i-1].y + 0 - origin.y;
--- 436,443 ----
      }
  
!     extents->x_bearing = total_min.x - origin.x;
!     extents->y_bearing = total_min.y - origin.y;
!     extents->width     = total_max.x - total_min.x;
!     extents->height    = total_max.y - total_min.y;
      extents->x_advance = glyphs[i-1].x + DOUBLE_FROM_26_6 (metrics->horiAdvance) - origin.x;
      extents->y_advance = glyphs[i-1].y + 0 - origin.y;

Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** cairo_gstate.c	16 Dec 2003 02:26:51 -0000	1.36
--- cairo_gstate.c	16 Dec 2003 03:00:15 -0000	1.37
***************
*** 1635,1644 ****
      cairo_matrix_copy (&gstate->font->matrix, &saved_font_matrix);
  
      extents->x_advance /= scale_x;
      extents->y_advance /= scale_y;
-     extents->left_side_bearing /= scale_x;
-     extents->right_side_bearing /= scale_x;
-     extents->ascent /= scale_y;
-     extents->descent /= scale_y;
  
      return status;
--- 1635,1644 ----
      cairo_matrix_copy (&gstate->font->matrix, &saved_font_matrix);
  
+     extents->x_bearing /= scale_x;
+     extents->y_bearing /= scale_y;
+     extents->width  /= scale_x;
+     extents->height /= scale_y;
      extents->x_advance /= scale_x;
      extents->y_advance /= scale_y;
  
      return status;
***************
*** 1665,1674 ****
      cairo_matrix_copy (&gstate->font->matrix, &saved_font_matrix);
  
      extents->x_advance /= scale_x;
      extents->y_advance /= scale_y;
-     extents->left_side_bearing /= scale_x;
-     extents->right_side_bearing /= scale_x;
-     extents->ascent /= scale_y;
-     extents->descent /= scale_y;
  
      return status;
--- 1665,1674 ----
      cairo_matrix_copy (&gstate->font->matrix, &saved_font_matrix);
  
+     extents->x_bearing /= scale_x;
+     extents->y_bearing /= scale_y;
+     extents->width  /= scale_x;
+     extents->height /= scale_y;
      extents->x_advance /= scale_x;
      extents->y_advance /= scale_y;
  
      return status;





More information about the cairo-commit mailing list