Just some random minor fixes from my tree.
2006-07-25 Sven de Marothy <[EMAIL PROTECTED]>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
(init): Default to the actual depth in the worst case.
* java/awt/Font.java
(createFont(int, File)): New method.
Index: java/awt/Font.java
===================================================================
RCS file: /sources/classpath/classpath/java/awt/Font.java,v
retrieving revision 1.36
diff -U3 -r1.36 Font.java
--- java/awt/Font.java 16 Jun 2006 16:10:22 -0000 1.36
+++ java/awt/Font.java 25 Jul 2006 17:51:21 -0000
@@ -48,6 +48,8 @@
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.peer.FontPeer;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
@@ -583,6 +585,34 @@
}
/**
+ * Creates a new font from a File object.
+ *
+ * @see #layoutGlyphVector(FontRenderContext, char[], int, int, int)
+ *
+ * @param fontFormat - Integer code indicating the format the font data is
+ * in.Currently this can only be [EMAIL PROTECTED] #TRUETYPE_FONT}.
+ * @param file - a [EMAIL PROTECTED] File} from which font data will be read.
+ *
+ * @return A new [EMAIL PROTECTED] Font} of the format indicated.
+ *
+ * @throws IllegalArgumentException if <code>fontType</code> is not
+ * recognized.
+ * @throws NullPointerException if <code>file</code> is <code>null</code>.
+ * @throws FontFormatException if data in the file is invalid or cannot be read..
+ * @throws SecurityException if the caller has no read permission for the file.
+ * @throws IOException if the file cannot be read
+ *
+ * @since 1.5
+ */
+ public static Font createFont (int fontFormat, File file)
+ throws FontFormatException, IOException
+ {
+ if( file == null )
+ throw new NullPointerException("Null file argument");
+ return tk().createFont(fontFormat, new FileInputStream( file ));
+ }
+
+ /**
* Maps characters to glyphs in a one-to-one relationship, returning a new
* [EMAIL PROTECTED] GlyphVector} with a mapped glyph for each input character. This
* sort of mapping is often sufficient for some scripts such as Roman, but
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c,v
retrieving revision 1.5
diff -U3 -r1.5 gnu_java_awt_peer_gtk_GtkVolatileImage.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c 10 Jun 2006 14:16:09 -0000 1.5
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c 25 Jul 2006 17:51:23 -0000
@@ -73,7 +73,8 @@
pixmap = gdk_pixmap_new( widget->window, width, height, -1 );
}
else
- pixmap = gdk_pixmap_new( NULL, width, height, 16 );
+ pixmap = gdk_pixmap_new( NULL, width, height,
+ gdk_rgb_get_visual()->depth );
gdk_threads_leave();