This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui][patch] small fix to graphics2d font sizing


hi,

this patch, which I've just committed to java-gui-branch, fixes a small bug in the font sizing routine of gdkgraphics2d, which I introduced with my recent bigger patch. the semantics of sizing had changed slightly with a patch I'm working on for cairo, and we've actually changed them back to their original meaning, so it wasn't technically a bug when I made the patch, but it is now :)

hopefully there will only be one more go around the font merry-go-round when owen finally gets pango up and running on cairo. sorry about all this.

-graydon

2004-10-06 Graydon Hoare <graydon@redhat.com>

	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
	(install_font_peer): Minor bug fixes to track cairo font
        semantics.

--- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c	4 Oct 2004 16:45:49 -0000	1.5.8.9
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c	6 Oct 2004 23:11:53 -0000
@@ -873,13 +873,17 @@
       ft = cairo_ft_font_create_for_ft_face (face);
       g_assert (ft != NULL);
       
-      if (debug) printf ("install_font_peer made new cairo font for '%s'\n", face->family_name);
+      if (debug) printf ("install_font_peer made new cairo font for '%s' at %f\n", 
+			 face->family_name,
+			 (pango_font_description_get_size (pfont->desc) / 
+			  (double)PANGO_SCALE) * (96.0 / 72.0));
     
       cairo_set_font (cr, ft); 
+      cairo_font_destroy (ft);
       cairo_scale_font (cr, 
 			(pango_font_description_get_size (pfont->desc) / 
 			 (double)PANGO_SCALE) * (96.0 / 72.0));
-      
+      ft = cairo_current_font (cr);
       pfont->graphics_resource = ft;
     }
   else
@@ -887,9 +891,6 @@
       if (debug) printf ("install_font_peer reused existing font resource\n");
       ft = (cairo_font_t *) pfont->graphics_resource;
       cairo_set_font (cr, ft);       
-      cairo_scale_font (cr, 
-			(pango_font_description_get_size (pfont->desc) / 
-			 (double)PANGO_SCALE) * (96.0 / 72.0));
     }
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]