[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_FreetypeFont.c, 1.3, 1.4

Jeffrey Morgan commit at pdx.freedesktop.org
Sat Apr 23 12:49:49 PDT 2005


Committed by: kuzman

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

Modified Files:
	org_freedesktop_cairo_FreetypeFont.c 
Log Message:
updated API to match upstream changes.

Index: org_freedesktop_cairo_FreetypeFont.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_FreetypeFont.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- org_freedesktop_cairo_FreetypeFont.c	11 Apr 2005 00:47:22 -0000	1.3
+++ org_freedesktop_cairo_FreetypeFont.c	23 Apr 2005 19:49:46 -0000	1.4
@@ -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, jobject scale)
+  (JNIEnv *env, jclass cls, jstring family, jint slant, jint weight)
 {
     const char *family_utf = (*env)->GetStringUTFChars(env, family, NULL);
     cairo_font_face_t *font = NULL;
@@ -38,7 +38,6 @@
     int fcslant;
     int fcweight;
     FT_Error error;
-    cairo_matrix_t* s = (cairo_matrix_t*)getPointerFromHandle(env, scale);
 
     pat = FcPatternCreate ();
     if (pat == NULL)
@@ -82,16 +81,10 @@
         ft_lib_init = 1;
     }
 
-    font = cairo_ft_font_create (pat, s);
+    font = cairo_ft_font_face_create_for_pattern(pat);
     if (font == NULL)
 		return 0;
 
-    FT_Set_Char_Size (cairo_ft_font_lock_face(font),
-                      DOUBLE_TO_26_6 (1.0),
-                      DOUBLE_TO_26_6 (1.0),
-                      0, 0);
-
-  
     FcPatternDestroy (pat);
     (*env)->ReleaseStringUTFChars(env, family, family_utf);
     return getHandleFromPointer(env, font);  
@@ -103,7 +96,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, jobject scale)
+  (JNIEnv *env, jclass cls, jstring family, jstring slant, jstring weight)
 {
     const char *family_utf = (*env)->GetStringUTFChars(env, family, NULL);
     const char *slant_utf =  (*env)->GetStringUTFChars(env, slant, NULL);
@@ -111,16 +104,14 @@
     cairo_font_face_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);
     strcat(fontBuf, ":");
     strcat(fontBuf, weight_utf);
     strcat(fontBuf, ":");
     strcat(fontBuf, slant_utf);
     
-
     pat = FcNameParse ((const FcChar8*) fontBuf);
     if (pat == NULL)
         return 0;
@@ -134,15 +125,10 @@
         ft_lib_init = 1;
     }
 
-    font = cairo_ft_font_create (pat, s);
+    font = cairo_ft_font_face_create_for_pattern(pat);
     if (font == NULL)
-	return 0;
+		return 0;
 
-    FT_Set_Char_Size (cairo_ft_font_lock_face(font),
-                      DOUBLE_TO_26_6 (1.0),
-                      DOUBLE_TO_26_6 (1.0),
-                      0, 0);
-  
     FcPatternDestroy (pat);
     (*env)->ReleaseStringUTFChars(env, family, family_utf);
     (*env)->ReleaseStringUTFChars(env, slant, slant_utf);




More information about the cairo-commit mailing list