[gui][PATCH] Fix font size calculations in GTK peers

Thomas Fitzsimmons fitzsim@redhat.com
Thu May 27 19:53:00 GMT 2004


On Thu, 2004-05-27 at 15:13, Thomas Fitzsimmons wrote:
> Hi,
> 
> I committed this patch to java-gui-branch.  It adjusts font size
> calculations in the GTK peers to factor in the screen's DPI.  The AWT
> specifies font sizes in pixels but we were interpreting them as points.
> 

There was a small mistake in this patch.  I've reverted that bit of it.

Tom

2004-05-27  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (drawString):
	Divide baseline y coordinate by PANGO_SCALE, not DPI conversion
	factor.


Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -r1.5.2.2 -r1.5.2.3
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c	27 May 2004 18:40:20 -0000	1.5.2.2
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c	27 May 2004 19:02:48 -0000	1.5.2.3
@@ -228,7 +228,7 @@
 
   gdk_draw_layout (g->drawable, g->gc,
                    x + g->x_offset,
-                   y + g->y_offset - (baseline_y / dpi_conversion_factor),
+                   y + g->y_offset - (baseline_y / PANGO_SCALE),
                    layout);
 
   pango_font_description_free (font_desc);




More information about the Java-patches mailing list