[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_PngSurface.c, 1.2, 1.3 org_freedesktop_cairo_FreetypeFont.c, 1.1, 1.2

Jeffrey Morgan commit at pdx.freedesktop.org
Fri Mar 4 15:01:43 PST 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/src/jni
In directory gabe:/tmp/cvs-serv24661/src/jni

Modified Files:
	org_freedesktop_cairo_PngSurface.c 
	org_freedesktop_cairo_FreetypeFont.c 
Log Message:
Fixed for FreeTypeFont, PngSurface, and javadoc cleanup

Index: org_freedesktop_cairo_PngSurface.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_PngSurface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- org_freedesktop_cairo_PngSurface.c	4 Mar 2005 21:03:38 -0000	1.2
+++ org_freedesktop_cairo_PngSurface.c	4 Mar 2005 23:01:41 -0000	1.3
@@ -49,7 +49,7 @@
 {
 	jg_pngsurface_t *s = malloc(sizeof(jg_pngsurface_t));
 	char *fn = (char*)(*env)->GetStringUTFChars(env, filename, NULL);
-	FILE *f = fopen(fn, "w");
+	FILE *f = fopen(fn, "wb");
 	cairo_surface_t *sur = cairo_png_surface_create(f, (cairo_format_t)format, 
 			width, height);
 	(*env)->ReleaseStringUTFChars(env, filename, fn);

Index: org_freedesktop_cairo_FreetypeFont.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_FreetypeFont.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- org_freedesktop_cairo_FreetypeFont.c	23 Feb 2005 18:17:52 -0000	1.1
+++ org_freedesktop_cairo_FreetypeFont.c	4 Mar 2005 23:01:41 -0000	1.2
@@ -30,7 +30,7 @@
  * Signature: (Ljava/lang/String;II)Lorg/gnu/glib/Handle;
  */
 JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_FreetypeFont_cairo_1ft_1font_1create__Ljava_lang_String_2II
-  (JNIEnv *env, jclass cls, jstring family, jint slant, jint weight)
+  (JNIEnv *env, jclass cls, jstring family, jint slant, jint weight, jobject scale)
 {
     const char *family_utf = (*env)->GetStringUTFChars(env, family, NULL);
     cairo_font_t *font = NULL;
@@ -38,6 +38,7 @@
     int fcslant;
     int fcweight;
     FT_Error error;
+    cairo_matrix_t* s = (cairo_matrix_t*)getPointerFromHandle(env, scale);
 
     pat = FcPatternCreate ();
     if (pat == NULL)
@@ -81,11 +82,11 @@
         ft_lib_init = 1;
     }
 
-    font = cairo_ft_font_create (ft_library, pat);
+    font = cairo_ft_font_create (pat, s);
     if (font == NULL)
 		return 0;
 
-    FT_Set_Char_Size (cairo_ft_font_face(font),
+    FT_Set_Char_Size (cairo_ft_font_lock_face(font),
                       DOUBLE_TO_26_6 (1.0),
                       DOUBLE_TO_26_6 (1.0),
                       0, 0);
@@ -102,7 +103,7 @@
  * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/gnu/glib/Handle;
  */
 JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_FreetypeFont_cairo_1ft_1font_1create__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2
-  (JNIEnv *env, jclass cls, jstring family, jstring slant, jstring weight)
+  (JNIEnv *env, jclass cls, jstring family, jstring slant, jstring weight, jobject scale)
 {
     const char *family_utf = (*env)->GetStringUTFChars(env, family, NULL);
     const char *slant_utf =  (*env)->GetStringUTFChars(env, slant, NULL);
@@ -110,6 +111,7 @@
     cairo_font_t *font = NULL;
     FcPattern * pat = NULL;
     FT_Error error;
+    cairo_matrix_t* s = (cairo_matrix_t*)getPointerFromHandle(env, scale);
 
     char fontBuf[256];
     strcpy(fontBuf, family_utf);
@@ -132,11 +134,11 @@
         ft_lib_init = 1;
     }
 
-    font = cairo_ft_font_create (ft_library, pat);
+    font = cairo_ft_font_create (pat, s);
     if (font == NULL)
 	return 0;
 
-    FT_Set_Char_Size (cairo_ft_font_face(font),
+    FT_Set_Char_Size (cairo_ft_font_lock_face(font),
                       DOUBLE_TO_26_6 (1.0),
                       DOUBLE_TO_26_6 (1.0),
                       0, 0);




More information about the cairo-commit mailing list