[stsf-commit] stsf/STClientLibrary/src STGlyphVector.c, 1.3, 1.4 STInternal.c, 1.1.1.1, 1.2 STLine.c, 1.1.1.1, 1.2 connection.h, 1.1.1.1, 1.2 libtest.c, 1.1.1.1, 1.2 serverconnection.c, 1.2, 1.3 stperf.c, 1.2, 1.3

Alexander Gelfenbain stsf-commit at pdx.freedesktop.org
Mon May 24 19:47:27 PDT 2004


Committed by: adg


Index: STGlyphVector.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/STGlyphVector.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/STGlyphVector.c	12 Apr 2004 22:49:24 -0000	1.3
+++ b/STGlyphVector.c	25 May 2004 02:47:24 -0000	1.4
@@ -1234,7 +1234,9 @@
             q->mbcache.valid = 1;
             q->mbcache.start = start;
             q->mbcache.count = count;
-            memcpy(&(q->mbcache.maxbox), maxbox, sizeof(STScaledMaxBox));
+            if (maxbox != NULL) {
+                memcpy(&(q->mbcache.maxbox), maxbox, sizeof(STScaledMaxBox));
+            }
         }
 
     } else {
@@ -1306,6 +1308,7 @@
           case ST_OM_RASTER_MONO:           q->deviceRenderFlags |= FS_RF_BLACKANDWHITE;       break;
           case ST_OM_RASTER_GRAYSCALE:      q->deviceRenderFlags |= FS_RF_GRAYSCALE;           break;
           case ST_OM_RASTER_LCD:            q->deviceRenderFlags |= FS_RF_LCD;                 break;
+          case ST_OM_RASTER_MONO_BITSWAPPED: q->deviceRenderFlags |= (FS_RF_BLACKANDWHITE | FS_RF_BITSWAPPED); break;
           default:
             return ST_RENDER_FLAGS;
         }
@@ -1330,12 +1333,14 @@
     }
 
 #ifdef PREFETCH_GLYPHS
-    gk = alloca(sizeof(STGlyphKey) * count);
+    gk = calloc(count, sizeof(STGlyphKey));
+    // gk = alloca(sizeof(STGlyphKey) * count);
 
     for (i=0; i<count; i++) {
         STStyledGlyphInternal *glyph = q->glyphs[start+i];
         if (glyph->rprops == NULL) {
             if ((ret = GetRenderProps(q, *StyleManagerGetStyle(q->styles, glyph->styleHandle), q->graphics, &glyph->rprops)) != ST_OK) {
+                if (gk != NULL) free(gk);
                 return ret;
             }
         }
@@ -1357,6 +1362,7 @@
             }
         }
     }
+    if (gk != NULL) free(gk);
 #endif
 
     for (i = 0; i < count; i++) {

Index: STInternal.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/STInternal.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/STInternal.c	26 Mar 2004 19:19:55 -0000	1.1.1.1
+++ b/STInternal.c	25 May 2004 02:47:24 -0000	1.2
@@ -140,7 +140,7 @@
     }
     if (o1->matrix.xx != o2->matrix.xx || o1->matrix.xy != o2->matrix.xy || 
         o1->matrix.yx != o2->matrix.yx || o1->matrix.yy != o2->matrix.yy ||
-        DOUBLE_XY_TO_FRACDELTA(o1->matrix.tx, o1->matrix.ty) == DOUBLE_XY_TO_FRACDELTA(o2->matrix.tx, o2->matrix.ty)
+        DOUBLE_XY_TO_FRACDELTA(o1->matrix.tx, o1->matrix.ty) != DOUBLE_XY_TO_FRACDELTA(o2->matrix.tx, o2->matrix.ty)
        ) {
         return FALSE;
     }

Index: STLine.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/STLine.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/STLine.c	26 Mar 2004 19:19:55 -0000	1.1.1.1
+++ b/STLine.c	25 May 2004 02:47:24 -0000	1.2
@@ -256,14 +256,14 @@
             styleRenderFlags = 0;
             if (hints == 0 /*** fHintingModeNotSet ***/ ) {
                 /* TODO: Fallback to default style */
-                styleRenderFlags = fEnableHints;
+                styleRenderFlags = FS_RF_HINTS;
             } else if (hints == ST_APPLY_HINTS) {
-                styleRenderFlags = fEnableHints;
+                styleRenderFlags = FS_RF_HINTS;
             } else if (hints == ST_AUTOHINT) {
-                styleRenderFlags = fEnableAutoHinting;
+                styleRenderFlags = FS_RF_AUTOHINT;
             }
             if (sbits == ST_USE_SBITS) {
-                styleRenderFlags |= fEnableSbits;
+                styleRenderFlags |= FS_RF_SBITS;
             }
             if (styleEffects & ST_SE_EMBOLDEN) {
                 styleRenderFlags |= FS_RF_EMBOLDEN;
@@ -670,14 +670,14 @@
             styleRenderFlags = 0;
             if (hints == 0 /*** fHintingModeNotSet ***/ ) {
                 /* TODO: Fallback to default style */
-                styleRenderFlags = fEnableHints;
+                styleRenderFlags = FS_RF_HINTS;
             } else if (hints == ST_APPLY_HINTS) {
-                styleRenderFlags = fEnableHints;
+                styleRenderFlags = FS_RF_HINTS;
             } else if (hints == ST_AUTOHINT) {
-                styleRenderFlags = fEnableAutoHinting;
+                styleRenderFlags = FS_RF_AUTOHINT;
             }
             if (sbits == ST_USE_SBITS) {
-                styleRenderFlags |= fEnableSbits;
+                styleRenderFlags |= FS_RF_SBITS;
             }
 
             if (styleEffects & ST_SE_EMBOLDEN) {

Index: connection.h
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/connection.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/connection.h	26 Mar 2004 19:19:55 -0000	1.1.1.1
+++ b/connection.h	25 May 2004 02:47:24 -0000	1.2
@@ -83,7 +83,7 @@
 
 STStatus FSSessionCreateFontsFromURL(STServerSession session,
                                      STCount iURLCount,
-                                     const char **iURL,
+                                     char **iURL,
                                      STCount *oFontCount,
                                      STFont **oFont);
 
@@ -99,7 +99,7 @@
                                STCount iFontCount,
                                STFont *iFonts);
 
-STStatus FSSessionGetFontsForURL(STServerSession session, const char *url, STCount *fontcount, STFont **font);
+STStatus FSSessionGetFontsForURL(STServerSession session, char *url, STCount *fontcount, STFont **font);
 
 STStatus FSSessionCountObjects(STServerSession session, STTag objectType, STCount *objectCount, STObject **ids);
 
@@ -202,13 +202,13 @@
 
 STStatus FSSessionGetFontExtInfo(STServerSession session,
                                  STFont font,
-                                 const char **oFontName,
-                                 const char **oPSName,
+                                 char **oFontName,
+                                 char **oPSName,
                                  STFontType *oType,
                                  STFontInfoFlags *oFlags,
                                  STCount *glyphcount,
-                                 int *oSbitCount,
-                                 const int **oSbitArray,
+                                 int32_t *oSbitCount,
+                                 int32_t **oSbitArray,
                                  STFontMetrics *oFontMetrics);
 
 STStatus FSSessionKernGlyphPair(STServerSession session, STBoolean isInstance, uint32_t id, STGlyph firstGlyph, STGlyph secondGlyph, STKernData *kern);
@@ -220,9 +220,9 @@
                                 STScaler scalerID,
                                 STTag *tag,
                                 uint32_t *version,
-                                const char **sname,
-                                const char **lname,
-                                const char **notice,
+                                char **sname,
+                                char **lname,
+                                char **notice,
                                 STScalerFlags *sflags,
                                 STFontMask *fflags);
 
@@ -230,9 +230,9 @@
                                       STLayoutEngine leID,
                                       STTag *tag,
                                       uint32_t *version,
-                                      const char **sname,
-                                      const char **lname,
-                                      const char **notice,
+                                      char **sname,
+                                      char **lname,
+                                      char **notice,
                                       STLayoutEngineFlags *leflags);
 
 
@@ -243,13 +243,13 @@
 
 STStatus FSSessionGetFontType(STServerSession session, STFont font, STFontType *oType);
 
-STStatus FSSessionGetFontURL(STServerSession session, STFont iFont, const char **oFontURL);
+STStatus FSSessionGetFontURL(STServerSession session, STFont iFont, char **oFontURL);
 
 STStatus FSSessionGetFontSignature(STServerSession session, STFont iFont, byte **oSignature);
 
-STStatus FSSessionGetFontForSignature(STServerSession session, const byte *iSignature, STFont *oFont);
+STStatus FSSessionGetFontForSignature(STServerSession session, byte *iSignature, STFont *oFont);
 
-STStatus FSSessionGetFontData(STServerSession session, STFont iFont, STTag iTable, STSize *oByteCount, const byte **oRawData);
+STStatus FSSessionGetFontData(STServerSession session, STFont iFont, STTag iTable, STSize *oByteCount, byte **oRawData);
 
 STStatus FSSessionLayoutChars(STServerSession session, uint32_t fontInstanceID,
                               STScaler scaler, STLayoutEngine le,

Index: libtest.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/libtest.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/libtest.c	26 Mar 2004 19:19:56 -0000	1.1.1.1
+++ b/libtest.c	25 May 2004 02:47:24 -0000	1.2
@@ -435,7 +435,7 @@
     matrix.xx = 14;    matrix.xy = 0;  matrix.tx = 0;
     matrix.yx = 0;     matrix.yy = 14; matrix.ty = 0;
 
-    if ((s = STIntNewFontInstance(e, f, matrix, 72, 72, fEnableHints | fBlackAndWhite, &instanceID)) != ST_OK) {
+    if ((s = STIntNewFontInstance(e, f, matrix, 72, 72, FS_RF_HINTS | FS_RF_BLACKANDWHITE, &instanceID)) != ST_OK) {
         printf("STIntNewFontInstance: %s.\n", ErrorCodeName(s));
         goto done;
     }
@@ -723,7 +723,7 @@
     matrix.xx = 14;    matrix.xy = 0;  matrix.tx = 0;
     matrix.yx = 0;     matrix.yy = 14; matrix.ty = 0;
 
-    if ((r = STIntNewFontInstance(env, f, matrix, 72, 72, fEnableHints | fBlackAndWhite, &instanceID)) != ST_OK) {
+    if ((r = STIntNewFontInstance(env, f, matrix, 72, 72, FS_RF_HINTS | FS_RF_BLACKANDWHITE, &instanceID)) != ST_OK) {
         printf("STIntNewFontInstance(): %s.\n", ErrorCodeName(r));
         goto done;
     }

Index: serverconnection.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/serverconnection.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/serverconnection.c	22 Apr 2004 20:56:32 -0000	1.2
+++ b/serverconnection.c	25 May 2004 02:47:24 -0000	1.3
@@ -52,6 +52,9 @@
 #include <math.h>
 
 #include <stmath.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
 
 #ifdef HAVE_FONTCONFIG
 #include <fontconfig/fontconfig.h>
@@ -59,10 +62,12 @@
 
[...2270 lines suppressed...]
+    fsexchange3(FS_GETFONTSFORURL_IN, s->fd, &s->doorbuf, &s->doorbufsize);
+    if (ReceiveAndCheck(s, FS_GETFONTSFORURL_OUT, &t)) return ST_PROTO_ERROR;
+
+    q = (fsc_getfontsforurl_out *) s->protobuf;
+
+    *fontcount = q->fontcount;
+    if (q->fontcount != 0) {
+        if ((*font = calloc(q->fontcount, sizeof(STFont))) != NULL) {
+            memcpy(*font, q->fonts, q->fontcount * sizeof(STFont));
+        } else {
+            t = ST_MEMORY;
+        }
+    } else {
+        *font = NULL;
+    }
 
-    TRAILER;
     return t;
 }
 

Index: stperf.c
===================================================================
RCS file: /cvs/stsf/stsf/STClientLibrary/src/stperf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/stperf.c	8 Apr 2004 01:40:55 -0000	1.2
+++ b/stperf.c	25 May 2004 02:47:24 -0000	1.3
@@ -243,7 +243,7 @@
     matrix.xx = 14;    matrix.xy = 0;  matrix.tx = 0;
     matrix.yx = 0;     matrix.yy = 14; matrix.ty = 0;
 
-    if ((s = STIntNewFontInstance(e, f, matrix, 72, 72, fEnableHints | fBlackAndWhite, &instanceID)) != ST_OK) {
+    if ((s = STIntNewFontInstance(e, f, matrix, 72, 72, FS_RF_HINTS | FS_RF_BLACKANDWHITE, &instanceID)) != ST_OK) {
         printf("STIntNewFontInstance: %s.\n", ErrorCodeName(s));
         goto done;
     }
@@ -527,7 +527,7 @@
     matrix.xx = 14;    matrix.xy = 0;  matrix.tx = 0;
     matrix.yx = 0;     matrix.yy = 14; matrix.ty = 0;
 
-    if ((r = STIntNewFontInstance(env, f, matrix, 72, 72, fEnableHints | fBlackAndWhite, &instanceID)) != ST_OK) {
+    if ((r = STIntNewFontInstance(env, f, matrix, 72, 72, FS_RF_HINTS | FS_RF_BLACKANDWHITE, &instanceID)) != ST_OK) {
         printf("STIntNewFontInstance(): %s.\n", ErrorCodeName(r));
         goto done;
     }




More information about the stsf-commit mailing list