summaryrefslogtreecommitdiff
path: root/src/Type1
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:20 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:20 +0000
commitfb0cbe6e7287d635a5f368e055cc0aae6ed50125 (patch)
tree24940f60afb7e084ca0760710bf9d1ffd21c384a /src/Type1
parentca219ad2fc4f392505d378dfa5a2b34d33de6d61 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'src/Type1')
-rw-r--r--src/Type1/arith.c8
-rw-r--r--src/Type1/cidchar.c9
-rw-r--r--src/Type1/hints.c40
-rw-r--r--src/Type1/lines.c5
-rw-r--r--src/Type1/objects.c51
-rw-r--r--src/Type1/objects.h14
-rw-r--r--src/Type1/paths.c106
-rw-r--r--src/Type1/regions.c100
-rw-r--r--src/Type1/scanfont.c12
-rw-r--r--src/Type1/spaces.c20
-rw-r--r--src/Type1/t1funcs.c29
-rw-r--r--src/Type1/t1info.c6
-rw-r--r--src/Type1/token.c12
-rw-r--r--src/Type1/type1.c109
14 files changed, 71 insertions, 450 deletions
diff --git a/src/Type1/arith.c b/src/Type1/arith.c
index 693b970..6caaa3f 100644
--- a/src/Type1/arith.c
+++ b/src/Type1/arith.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/arith.c,v 1.6 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/arith.c,v 1.7 2003/05/27 22:26:45 tsi Exp $ */
/* ARITH CWEB V0006 ******** */
/*
@@ -382,14 +382,12 @@ FPmult(fractpel u, fractpel v)
DLrightshift(w, FRACTBITS);
#ifndef LONG64
if (w.high != 0 || SIGNBITON(w.low)) {
- IfTrace2(TRUE,"FPmult: overflow, %px%p\n", u, v);
w.low = TOFRACTPEL(MAXSHORT);
}
return ((negative) ? -w.low : w.low);
#else
if (w & 0xffffffff80000000L ) {
- IfTrace2(TRUE,"FPmult: overflow, %px%p\n", u, v);
ret = TOFRACTPEL(MAXSHORT);
}
else
@@ -427,7 +425,6 @@ FPdiv(fractpel dividend, fractpel divisor)
w.high = dividend >> (LONGSIZE - FRACTBITS);
DLdiv(&w, divisor);
if (w.high != 0 || SIGNBITON(w.low)) {
- IfTrace2(TRUE,"FPdiv: overflow, %p/%p\n", dividend, divisor);
w.low = TOFRACTPEL(MAXSHORT);
}
return( (negative) ? -w.low : w.low);
@@ -435,7 +432,6 @@ FPdiv(fractpel dividend, fractpel divisor)
w = ((long)dividend) << FRACTBITS;
DLdiv(&w, divisor);
if (w & 0xffffffff80000000L ) {
- IfTrace2(TRUE,"FPdiv: overflow, %p/%p\n", dividend, divisor);
ret = TOFRACTPEL(MAXSHORT);
}
else
@@ -471,13 +467,11 @@ FPstarslash(fractpel a, /* result = a * b / c */
DLdiv(&w, c);
#ifndef LONG64
if (w.high != 0 || SIGNBITON(w.low)) {
- IfTrace3(TRUE,"FPstarslash: overflow, %p*%p/%p\n", a, b, c);
w.low = TOFRACTPEL(MAXSHORT);
}
return((negative) ? -w.low : w.low);
#else
if (w & 0xffffffff80000000L ) {
- IfTrace3(TRUE,"FPstarslash: overflow, %p*%p/%p\n", a, b, c);
ret = TOFRACTPEL(MAXSHORT);
}
else
diff --git a/src/Type1/cidchar.c b/src/Type1/cidchar.c
index e70d371..593337e 100644
--- a/src/Type1/cidchar.c
+++ b/src/Type1/cidchar.c
@@ -15,7 +15,7 @@
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/cidchar.c,v 1.9 2001/10/28 03:32:44 tsi Exp $ */
+/* $XFree86: xc/lib/font/Type1/cidchar.c,v 1.10 2003/05/27 22:26:45 tsi Exp $ */
#ifdef BUILDCID
#ifndef FONTMODULE
@@ -487,7 +487,6 @@ CIDGetCharMetrics(FontPtr pFont, FontInfo *fi, unsigned int charcode, double sxm
int
CIDGetAFM(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding charEncoding, unsigned long *glyphCount, CharInfoPtr *glyphs, char *cidafmfile)
{
- int rc;
FILE *fp;
FontInfo *fi = NULL;
cidglyphs *cid;
@@ -496,7 +495,7 @@ CIDGetAFM(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding
register CharInfoPtr pci;
CharInfoPtr pDefault;
- unsigned int firstRow, firstCol, numRows, code, char_row, char_col;
+ unsigned int firstCol, code, char_row, char_col;
double sxmult;
cid = (cidglyphs *)pFont->fontPrivate;
@@ -505,7 +504,7 @@ CIDGetAFM(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding
if (!(fp = fopen(cidafmfile, "rb")))
return(BadFontName);
- if ((rc = CIDAFM(fp, &fi)) != 0) {
+ if (CIDAFM(fp, &fi) != 0) {
fprintf(stderr,
"There is something wrong with Adobe Font Metric file %s.\n",
cidafmfile);
@@ -579,8 +578,6 @@ CIDGetAFM(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding
break;
case TwoD16Bit:
- firstRow = pFont->info.firstRow;
- numRows = pFont->info.lastRow - firstRow + 1;
while (count--) {
char_row = (*chars++);
char_col = (*chars++);
diff --git a/src/Type1/hints.c b/src/Type1/hints.c
index 5150647..81b8a2c 100644
--- a/src/Type1/hints.c
+++ b/src/Type1/hints.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/hints.c,v 1.7 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/hints.c,v 1.8 2003/05/27 22:26:45 tsi Exp $ */
/* HINTS CWEB V0006 ******** */
/*
@@ -113,9 +113,6 @@ CloseHints(struct fractpoint *hintP)
hintP->y -= oldHint[i].hint.y;
oldHint[i].inuse = FALSE;
-
- IfTrace3((HintDebug > 1)," Hint %d was open, hint=(%p,%p)\n",
- i, hintP->x, hintP->y);
}
}
}
@@ -143,16 +140,13 @@ multiple of 90 degrees.
if (hP->width.y == 0)
{
orientation = 'v'; /* vertical */
- IfTrace0((HintDebug > 0)," vertical hint\n");
}
else if (hP->width.x == 0)
{
orientation = 'h'; /* horizontal */
- IfTrace0((HintDebug > 0)," horizontal hint\n");
}
else
{
- IfTrace0((HintDebug > 0)," hint not vertical or horizontal\n");
hintP->x = hintP->y = 0;
return;
}
@@ -173,11 +167,6 @@ multiple of 90 degrees.
Abort("ComputeHint: invalid orientation");
}
- IfTrace4((HintDebug > 1),
- " currX=%p, currY=%p, currRef=%p, currWidth=%p\n",
- currX, currY,
- currRef, currWidth);
-
if ((hP->hinttype == 'b') /* Bar or stem */
|| (hP->hinttype == 's')) /* Serif */
{
@@ -193,9 +182,6 @@ multiple of 90 degrees.
/* align "ref" on pel boundary */
hintValue = FPROUND(currRef) - currRef;
}
- if (HintDebug > 2) {
- IfTrace1(TRUE," idealWidth=%d, ", idealWidth);
- }
}
else if (hP->hinttype == 'c') /* Curve extrema */
{
@@ -207,8 +193,6 @@ multiple of 90 degrees.
Abort("ComputeHint: invalid hinttype");
}
- IfTrace1((HintDebug > 1)," hintValue=%p", hintValue);
-
if (orientation == 'v') /* vertical */
{
hintP->x = hintValue;
@@ -236,14 +220,6 @@ ProcessHint(struct hintsegment *hP,
{
struct fractpoint thisHint;
- IfTrace4((HintDebug > 1)," ref=(%p,%p), width=(%p,%p)",
- hP->ref.x, hP->ref.y,
- hP->width.x, hP->width.y);
- IfTrace4((HintDebug > 1),", %c %c %c %c",
- hP->orientation, hP->hinttype,
- hP->adjusttype, hP->direction);
- IfTrace1((HintDebug > 1),", label=%d\n", hP->label);
-
if ((hP->adjusttype == 'm') /* Move */
|| (hP->adjusttype == 'a')) /* Adjust */
{
@@ -299,14 +275,9 @@ ProcessHint(struct hintsegment *hP,
{
Abort("ProcessHint: invalid adjusttype");
}
- IfTrace3((HintDebug > 1)," label=%d, thisHint=(%p,%p)\n",
- hP->label, thisHint.x, thisHint.y);
hintP->x += thisHint.x;
hintP->y += thisHint.y;
-
- IfTrace2((HintDebug > 1)," hint=(%p,%p)\n",
- hintP->x, hintP->y);
}
/*
@@ -643,28 +614,19 @@ DumpSubPaths(struct edgelist *anchor)
for (edge = anchor; VALIDEDGE(edge); edge = edge->link) {
if (ISPERMANENT(edge->flag))
continue;
- IfTrace0(TRUE, "BEGIN Subpath\n");
for (e2 = edge; !ISPERMANENT(e2->flag);) {
if (ISDOWN(e2->flag)) {
- IfTrace1(TRUE, ". Downgoing edge's top at %x\n", e2);
for (e = e2;; e = e->subpath) {
- IfTrace4(TRUE, ". . [%5d] %5d @ %x[%x]\n",
- e->ymin, *e->xvalues, e, e->flag);
for (y=e->ymin+1; y < e->ymax; y++)
- IfTrace2(TRUE, ". . [%5d] %5d \"\n", y, e->xvalues[y-e->ymin]);
e->flag |= ISPERMANENT(ON);
if (ISBREAK(e, e->subpath))
break;
}
}
else {
- IfTrace1(TRUE, ". Upgoing edge's top at %x\n", e2);
for (e = e2; !ISBREAK(e, e->subpath); e = e->subpath) { ; }
for (;; e=before(e)) {
- IfTrace4(TRUE, ". . [%5d] %5d @ %x[%x]\n",
- e->ymax-1, e->xvalues[e->ymax-1-e->ymin], e, e->flag);
for (y=e->ymax-2; y >= e->ymin; y--)
- IfTrace2(TRUE, ". . [%5d] %5d \"\n", y, e->xvalues[y-e->ymin]);
e->flag |= ISPERMANENT(ON);
if (e == e2)
break;
diff --git a/src/Type1/lines.c b/src/Type1/lines.c
index dec3f08..197943f 100644
--- a/src/Type1/lines.c
+++ b/src/Type1/lines.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/lines.c,v 1.4 2001/01/17 19:43:22 dawes Exp $ */
+/* $XFree86: xc/lib/font/Type1/lines.c,v 1.5 2003/05/27 22:26:45 tsi Exp $ */
/* LINES CWEB V0003 ******** */
/*
@@ -80,9 +80,6 @@ void StepLine(R, x1, y1, x2, y2)
{
register fractpel dy;
- IfTrace4((LineDebug > 0), ".....StepLine: (%p,%p) to (%p,%p)\n",
- x1, y1, x2, y2);
-
dy = y2 - y1;
/*
diff --git a/src/Type1/objects.c b/src/Type1/objects.c
index 57168b4..2f2d30a 100644
--- a/src/Type1/objects.c
+++ b/src/Type1/objects.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/objects.c,v 1.10 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/objects.c,v 1.11 2003/05/27 22:26:45 tsi Exp $ */
/* OBJECTS CWEB V0025 ******** */
/*
:h1.OBJECTS Module - TYPE1IMAGER Objects Common Routines
@@ -311,8 +311,6 @@ t1_Allocate(int size, /* number of bytes to allocate & initialize */
while (r == NULL) {
if (!GimeSpace()) {
- IfTrace1(TRUE, "malloc attempted %d bytes.\n",
- size + extra);
Abort("We have REALLY run out of memory");
}
r = (struct xobject *) xiMalloc(size + extra);
@@ -339,12 +337,6 @@ t1_Allocate(int size, /* number of bytes to allocate & initialize */
*p1++ = NULL;
}
- if (MemoryDebug > 1) {
- register long *L;
- L = (long *) r;
- IfTrace4(TRUE, "Allocating at %x: %x %x %x\n",
- L, L[-1], L[0], L[1]);
- }
return(r);
}
@@ -369,12 +361,6 @@ Free(pointer objPtr)
Abort("Free of already freed object?");
obj->type = INVALIDTYPE;
- if (MemoryDebug > 1) {
- register long *L;
- L = (long *) obj;
- IfTrace4(TRUE,"Freeing at %x: %x %x %x\n", L, L[-1], L[0], L[1]);
- }
-
xiFree((long *)obj);
}
@@ -407,8 +393,6 @@ t1_Permanent(pointer objPtr)
{
struct xobject *obj = (struct xobject *)objPtr; /* object to be made permanent */
- IfTrace1((MustTraceCalls),"Permanent(%z)\n", obj);
-
if ( (obj != NULL) && ( !(ISPERMANENT(obj->flag)) ) )
{
/* there is a non-NULL, temporary object to be made permanent.
@@ -454,8 +438,6 @@ xiTemporary(pointer objPtr)
{
register struct xobject *obj
= (struct xobject *)objPtr; /* object to be made permanent */
- IfTrace1((MustTraceCalls),"Temporary(%z)\n", obj);
-
if (obj != NULL) {
/* if it's already temporary, there's nothing to do. */
if ISPERMANENT(obj->flag)
@@ -504,8 +486,6 @@ t1_Dup(pointer objPtr)
= (struct xobject *)objPtr; /* object to be duplicated */
register char oldflag; /* copy of original object's flag byte */
- IfTrace1((MustTraceCalls),"Dup(%z)\n", obj);
-
if (obj == NULL)
return(NULL);
/* An immortal object must be Copy'ed, so that we get a mortal
@@ -592,12 +572,9 @@ Destroy(pointer objPtr)
{
register struct xobject *obj
= (struct xobject *)objPtr; /* object to be destroyed */
- IfTrace1((MustTraceCalls),"Destroy(%z)\n", obj);
-
if (obj == NULL)
return(NULL);
if (ISIMMORTAL(obj->flag)) {
- IfTrace1(TRUE,"Destroy of immortal object %z ignored\n", obj);
return(NULL);
}
if (ISPATHTYPE(obj->type))
@@ -937,24 +914,6 @@ Consume(int n, ...)
Destroy(obj);
}
}
-/*
-:h4.ObjectPostMortem() - Prints as Much as We Can About a Bad Object
-
-This is a subroutine of TypeErr() and ArgErr().
-*/
-
-/*ARGSUSED*/
-static void
-ObjectPostMortem(struct xobject *obj)
-{
-
- Pragmatics("Debug", 10);
- IfTrace2(TRUE,"Bad object is of %s type %z\n", TypeFmt(obj->type), obj);
-
- IfTrace0((obj == (struct xobject *) USER),
- "Suspect that InitImager() was omitted.\n");
- Pragmatics("Debug", 0);
-}
/*
:h3.TypeErr() - Handles "Invalid Object Type" Errors
@@ -981,9 +940,6 @@ TypeErr(char *name, /* Name of routine (for error message) */
sprintf(typemsg, "Wrong object type in %s. Expected %s; was %s.\n",
name, TypeFmt(expect), TypeFmt(obj->type));
- IfTrace0(TRUE,typemsg);
-
- ObjectPostMortem(obj);
if (MustCrash)
Abort("Terminating because of CrashOnUserError...");
@@ -1055,14 +1011,11 @@ ArgErr(char *string, /* description of error */
pointer objPtr, /* object, if any, that was in error */
pointer retPtr) /* object returned to caller or NULL */
{
- struct xobject *obj = (struct xobject *)objPtr;
struct xobject *ret = (struct xobject *)retPtr;
if (MustCrash)
LineIOTrace = TRUE;
- IfTrace1(TRUE,"ARGUMENT ERROR-- %s.\n", string);
- if (obj != NULL)
- ObjectPostMortem(obj);
+
if (MustCrash)
Abort("Terminating because of CrashOnUserError...");
else
diff --git a/src/Type1/objects.h b/src/Type1/objects.h
index 984ccbd..e64d00e 100644
--- a/src/Type1/objects.h
+++ b/src/Type1/objects.h
@@ -43,7 +43,7 @@
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/objects.h,v 1.14 2002/12/24 17:42:59 tsi Exp $ */
+/* $XFree86: xc/lib/font/Type1/objects.h,v 1.15 2003/05/27 22:26:45 tsi Exp $ */
/*SHARED*/
/*END SHARED*/
@@ -285,18 +285,6 @@ struct xobject {
/*END SHARED*/
/*SHARED*/
-#define IfTrace0(condition,model)
-#define IfTrace1(condition,model,arg0)
-#define IfTrace2(condition,model,arg0,arg1)
-#define IfTrace3(condition,model,arg0,arg1,arg2)
-#define IfTrace4(condition,model,arg0,arg1,arg2,arg3)
-#define IfTrace5(condition,model,arg0,arg1,arg2,arg3,arg4)
-#define IfTrace6(condition,model,arg0,arg1,arg2,arg3,arg4,arg5)
-
-#if 0
-void Trace0();
-char *Trace1(),*Trace2(),*Trace3(),*Trace4(),*Trace5(),*Trace6();
-#endif
#ifdef GLOBALS
diff --git a/src/Type1/paths.c b/src/Type1/paths.c
index 6291d68..3fec84e 100644
--- a/src/Type1/paths.c
+++ b/src/Type1/paths.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/paths.c,v 1.7 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/paths.c,v 1.8 2003/05/27 22:26:46 tsi Exp $ */
/* PATHS CWEB V0021 ******** */
/*
@@ -211,8 +211,6 @@ t1_Loc(struct XYspace *S, /* coordinate space to interpret X,Y */
register struct segment *r;
- IfTrace3((MustTraceCalls),"..Loc(S=%z, x=%f, y=%f)\n", S, &x, &y);
-
r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0);
TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *);
@@ -232,8 +230,6 @@ ILoc(struct XYspace *S, /* coordinate space to interpret X,Y */
{
register struct segment *r;
- IfTrace3((MustTraceCalls),"..ILoc(S=%z, x=%d, y=%d)\n",
- S, (long) x, (long) y);
r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0);
TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *);
@@ -257,8 +253,6 @@ so it is not provided.
struct segment *
SubLoc(struct segment *p1, struct segment *p2)
{
- IfTrace2((MustTraceCalls),"SubLoc(%z, %z)\n", p1, p2);
-
ARGCHECK(!ISLOCATION(p1), "SubLoc: bad first arg", p1, NULL, (0), struct segment *);
ARGCHECK(!ISLOCATION(p2), "SubLoc: bad second arg", p2, NULL, (0), struct segment *);
p1 = UniquePath(p1);
@@ -301,8 +295,6 @@ This involves just creating and filling out a segment structure:
struct segment *
Line(struct segment *P) /* relevant coordinate space */
{
-
- IfTrace1((MustTraceCalls),"..Line(%z)\n", P);
ARGCHECK(!ISLOCATION(P), "Line: arg not a location", P, NULL, (0), struct segment *);
P = UniquePath(P);
@@ -345,7 +337,6 @@ Bezier(struct segment *B, /* second control point */
register struct beziersegment *r; /* output segment */
- IfTrace3((MustTraceCalls),"..Bezier(%z, %z, %z)\n", B, C, D);
ARGCHECK(!ISLOCATION(B), "Bezier: bad B", B, NULL, (2,C,D), struct beziersegment *);
ARGCHECK(!ISLOCATION(C), "Bezier: bad C", C, NULL, (2,B,D), struct beziersegment *);
ARGCHECK(!ISLOCATION(D), "Bezier: bad D", D, NULL, (2,B,C), struct beziersegment *);
@@ -447,8 +438,6 @@ rules.
struct segment *
Join(struct segment *p1, struct segment *p2)
{
- IfTrace2((MustTraceCalls && PathDebug > 1),"..Join(%z, %z)\n", p1, p2);
- IfTrace2((MustTraceCalls && PathDebug <=1),"..Join(%x, %x)\n", p1, p2);
/*
We start with a whole bunch of very straightforward argument tests:
*/
@@ -603,7 +592,6 @@ t1_ClosePath(struct segment *p0, /* path to close */
register fractpel firstx = 0,firsty = 0; /* start position of sub path */
register struct segment *lastnonhint = NULL; /* last non-hint segment in path */
- IfTrace1((MustTraceCalls),"ClosePath(%z)\n", p0);
if (p0 != NULL && p0->type == TEXTTYPE)
return(UniquePath(p0));
if (p0->type == STROKEPATHTYPE)
@@ -650,9 +638,6 @@ At each break, we insert a close segment.
if (r->dest.x != 0 || r->dest.y != 0) {
if (r->dest.x <= CLOSEFUDGE && r->dest.x >= -CLOSEFUDGE
&& r->dest.y <= CLOSEFUDGE && r->dest.y >= -CLOSEFUDGE) {
- IfTrace2((PathDebug),
- "ClosePath forced closed by (%p,%p)\n",
- r->dest.x, r->dest.y);
lastnonhint->dest.x += r->dest.x;
lastnonhint->dest.y += r->dest.y;
r->dest.x = r->dest.y = 0;
@@ -707,8 +692,6 @@ Reverse(struct segment *p) /* full path to reverse */
register struct segment *r; /* output path built here */
register struct segment *nextp; /* contains next sub-path */
- IfTrace1((MustTraceCalls),"Reverse(%z)\n", p);
-
if (p == NULL)
return(NULL);
@@ -883,8 +866,6 @@ ReverseSubPaths(struct segment *p) /* input path */
register struct segment *nomove; /* the part of sub-path without move segment */
struct fractpoint delta;
- IfTrace1((MustTraceCalls),"ReverseSubPaths(%z)\n", p);
-
if (p == NULL)
return(NULL);
@@ -1024,7 +1005,6 @@ PathTransform(struct segment *p0, /* path to transform */
}
default:
- IfTrace1(TRUE,"path = %z\n", p);
Abort("PathTransform: invalid segment");
}
oldx += savex;
@@ -1091,8 +1071,6 @@ QueryLoc(struct segment *P, /* location to query, not consumed */
struct XYspace *S, /* XY space to return coordinates in */
double *xP, double *yP) /* coordinates returned here */
{
- IfTrace4((MustTraceCalls),"QueryLoc(P=%z, S=%z, (%x, %x))\n",
- P, S, xP, yP);
if (!ISLOCATION(P)) {
ArgErr("QueryLoc: first arg not a location", P, NULL);
return;
@@ -1124,8 +1102,6 @@ QueryPath(struct segment *path, /* path to check */
{
register int coerced = FALSE; /* did I coerce a text path? */
- IfTrace3((MustTraceCalls), "QueryPath(%z, %x, %x, ...)\n",
- path, typeP, Bp);
if (path == NULL) {
*typeP = -1;
return;
@@ -1204,9 +1180,6 @@ QueryBounds(struct segment *p0, /* object to check for bound */
int coerced = FALSE; /* we have coerced the path from another object */
double x1,y1,x2,y2,x3,y3,x4,y4; /* corners of rectangle in space X */
- IfTrace2((MustTraceCalls), "QueryBounds(%z, %z,", p0, S);
- IfTrace4((MustTraceCalls), " %x, %x, %x, %x)\n",
- xminP, yminP, xmaxP, ymaxP);
if (S->type != SPACETYPE) {
ArgErr("QueryBounds: bad XYspace", S, NULL);
return;
@@ -1379,7 +1352,6 @@ to ask about an entire path.
struct segment *
DropSegment(struct segment *path)
{
- IfTrace1((MustTraceCalls),"DropSegment(%z)\n", path);
if (path != NULL && path->type == STROKEPATHTYPE)
path = CoercePath(path);
ARGCHECK((path == NULL || !ISPATHANCHOR(path)),
@@ -1401,7 +1373,6 @@ first segment only.
struct segment *
HeadSegment(struct segment *path) /* input path */
{
- IfTrace1((MustTraceCalls),"HeadSegment(%z)\n", path);
if (path == NULL)
return(NULL);
if (path->type == STROKEPATHTYPE)
@@ -1427,79 +1398,4 @@ HeadSegment(struct segment *path) /* input path */
void
DumpPath(struct segment *p)
{
- register fractpel x,y;
- register fractpel lastx,lasty;
- double roundness;
-
- IfTrace1(TRUE,"Dumping path, anchor=%x:\n", p);
- lastx = lasty = 0;
-
- for (;p != NULL; p=p->link) {
-
- IfTrace0(TRUE,". ");
- x = p->dest.x;
- y = p->dest.y;
- switch (p->type) {
-
- case LINETYPE:
- IfTrace1(TRUE,". line<%x> to", (long) p->flag);
- IfTrace4(TRUE," (%p,%p), delta=(%p,%p)",
- x + lastx, y + lasty, x, y);
- break;
-
- case MOVETYPE:
- IfTrace1(TRUE,"MOVE<%x> to", (long) p->flag);
- IfTrace4(TRUE,"(%p,%p), delta=(%p,%p)",
- x + lastx, y + lasty, x, y);
- break;
-
- case CONICTYPE:
- {
- register struct conicsegment *cp = (struct conicsegment *) p;
-
- roundness = cp->roundness;
- IfTrace2(TRUE, ". conic to (%p,%p),",
- x + lastx, y + lasty);
- IfTrace3(TRUE," M=(%p,%p), r=%f", cp->M.x + lastx,
- cp->M.y + lasty, &roundness);
- }
- break;
-
- case BEZIERTYPE:
- {
- IfTrace4(TRUE,". bezier to (%p,%p), B=(%p,%p)",
- x + lastx, y + lasty,
- bp->B.x + lastx, bp->B.y + lasty);
- IfTrace2(TRUE, ", C=(%p,%p)",
- bp->C.x + lastx, bp->C.y + lasty);
- }
- break;
-
- case HINTTYPE:
- {
- IfTrace4(TRUE,". hint ref=(%p,%p), width=(%p,%p)",
- hp->ref.x + lastx, hp->ref.y + lasty,
- hp->width.x, hp->width.y);
- IfTrace4(TRUE, ", %c %c %c %c",
- hp->orientation, hp->hinttype,
- hp->adjusttype, hp->direction);
- IfTrace1(TRUE, ", %ld", (long) hp->label);
- }
- break;
-
- case TEXTTYPE:
-#ifdef notyet
- DumpText(p);
-#endif
- break;
-
- default:
- IfTrace0(TRUE, "bad path segment?");
- }
- IfTrace1(TRUE," at %x\n", p);
- lastx += x;
- lasty += y;
- }
}
-
-
diff --git a/src/Type1/regions.c b/src/Type1/regions.c
index 724d3f5..e24bacc 100644
--- a/src/Type1/regions.c
+++ b/src/Type1/regions.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/regions.c,v 3.8 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/regions.c,v 3.9 2003/05/27 22:26:46 tsi Exp $ */
/* REGIONS CWEB V0023 LOTS */
/*
:h1 id=regions.REGIONS Module - Regions Operator Handler
@@ -297,8 +297,6 @@ NewEdge(pel xmin, pel xmax, /* X extent of edge */
register struct edgelist *r; /* returned structure */
register int iy; /* ymin adjusted for 'long' alignment purposes */
- IfTrace2((RegionDebug),"....new edge: ymin=%d, ymax=%d ",
- (long)ymin, (long) ymax);
if (ymin >= ymax)
Abort("newedge: height not positive");
/*
@@ -332,7 +330,6 @@ Allocate() makes everything it allocates be in multiples of longs.
*/
LONGCOPY(&r[1], xvalues, (ymax - iy) * sizeof(pel) + sizeof(long) - 1);
- IfTrace1((RegionDebug),"result=%x\n", r);
return(r);
}
@@ -358,8 +355,6 @@ discard(struct edgelist *left, /* all edges between here exclusive */
{
register struct edgelist *beg,*end,*p;
- IfTrace2((RegionDebug > 0),"discard: l=%x, r=%x\n", left, right);
-
beg = left->link;
if (beg == right)
return;
@@ -367,7 +362,6 @@ discard(struct edgelist *left, /* all edges between here exclusive */
for (p = beg; p != right; p = p->link) {
if (p->link == NULL && right != NULL)
Abort("discard(): ran off end");
- IfTrace1((RegionDebug > 0),"discarding %x\n", p);
p->ymin = p->ymax = 32767;
end = p;
}
@@ -400,8 +394,6 @@ Unwind(struct edgelist *area) /* input area modified in place */
register int y; /* ymin of current swath */
register int count,newcount; /* winding count registers */
- IfTrace1((RegionDebug>0),"...Unwind(%z)\n", area);
-
while (VALIDEDGE(area)) {
count = 0;
@@ -469,8 +461,6 @@ Interior(struct segment *p, /* take interior of this path */
char tempflag; /* flag; is path temporary? */
char Cflag; /* flag; should we apply continuity? */
- IfTrace2((MustTraceCalls),". INTERIOR(%z, %d)\n", p, (long) fillrule);
-
if (p == NULL)
return(NULL);
/*
@@ -547,8 +537,6 @@ The hints data structure must be initialized once for each path.
x = lastx + p->dest.x;
y = lasty + p->dest.y;
- IfTrace2((HintDebug > 0),"Ending point = (%p,%p)\n", x, y);
-
nextP = p->link;
/*
@@ -567,8 +555,6 @@ the first on the path), we need to close (reverse) any open hints.
if (ProcessHints)
if ((p->type == MOVETYPE) && (p->last == NULL)) {
CloseHints(&hint);
- IfTrace2((HintDebug>0),"Closed point= (%p,%p)\n",
- x+hint.x, y+hint.y);
}
/*
@@ -599,8 +585,6 @@ We now apply the full hint value to the ending point of the path segment.
x += hint.x;
y += hint.y;
- IfTrace2((HintDebug>0),"Hinted ending point = (%p,%p)\n", x, y);
-
switch(p->type) {
case LINETYPE:
@@ -706,27 +690,19 @@ ChangeDirection(int type, /* CD_FIRST, CD_CONTINUE, or CD_LAST */
fractpel dy) /* direction and magnitude of change in y */
{
register fractpel ymin,ymax; /* minimum and maximum Y since last call */
- register fractpel x_at_ymin,x_at_ymax; /* their respective X's */
register pel iy; /* nearest integer pel to 'y' */
register pel idy; /* nearest integer pel to 'dy' */
register int ydiff; /* allowed Y difference in 'currentworkarea' */
- IfTrace4((RegionDebug>0),"Change Y direction (%d) from (%p,%p), dy=%p\n",
- (long) type, x, y, dy);
-
if (type != CD_FIRST) {
if (R->lastdy > 0) {
ymin = R->firsty;
- x_at_ymin = R->firstx;
ymax = y;
- x_at_ymax = x;
}
else {
ymin = y;
- x_at_ymin = x;
ymax = R->firsty;
- x_at_ymax = R->firstx;
}
if (ymax < ymin)
@@ -850,16 +826,6 @@ SortSwath(struct edgelist *anchor, /* list being built */
register struct edgelist *before,*after;
struct edgelist base;
- if (RegionDebug > 0) {
- if (RegionDebug > 2) {
- IfTrace3(TRUE,"SortSwath(anchor=%z, edge=%z, fcn=%x)\n",
- anchor, edge, swathfcn);
- }
- else {
- IfTrace3(TRUE,"SortSwath(anchor=%x, edge=%x, fcn=%x)\n",
- anchor, edge, swathfcn);
- }
- }
if (anchor == NULL)
return(edge);
@@ -904,8 +870,6 @@ If the bottom of 'after' is above the bottom of the swath,
break;
}
else if (TOP(after) > TOP(edge)) {
- IfTrace0((BOTTOM(edge) < TOP(after) && RegionDebug > 0),
- "SortSwath: disjoint edges\n");
if (BOTTOM(edge) > TOP(after)) {
after = SortSwath(after,
splitedge(edge, TOP(after)), swathfcn);
@@ -934,13 +898,9 @@ contains all the edges before. Whew! A simple matter now of adding
*/
before->link = edge;
if (RegionDebug > 1) {
- IfTrace3(TRUE,"SortSwath: in between %x and %x are %x",
- before, after, edge);
while (edge->link != NULL) {
edge = edge->link;
- IfTrace1(TRUE," and %x", edge);
}
- IfTrace0(TRUE,"\n");
}
else
for (; edge->link != NULL; edge = edge->link) { ; }
@@ -966,8 +926,6 @@ splitedge(struct edgelist *list, /* area to split */
register struct edgelist *r; /* temp pointer to new structure */
register struct edgelist *lastlist; /* temp pointer to last 'list' value */
- IfTrace2((RegionDebug > 1),"splitedge of %x at %d ", list, (long) y);
-
lastlist = new = NULL;
while (list != NULL) {
@@ -1019,7 +977,6 @@ Then, we return the caller a pointer to 'new':
Abort("null splitedge");
lastlist->link = NULL;
last->link = list;
- IfTrace1((RegionDebug > 1),"yields %x\n", new);
return(new);
}
@@ -1099,7 +1056,6 @@ recursively with the part of the edge that is below the crossing point:
y -= TOP(edge);
if (h0 <= 0) {
- IfTrace0((RegionDebug>0),"swathxsort: exactly equal edges\n");
return(before);
}
@@ -1136,9 +1092,6 @@ SwathUnion(struct edgelist *before0, /* edge before the swath */
register struct edgelist *before,*after; /* edge before and after */
int h0; /* saves initial height */
- IfTrace2((RegionDebug > 1),"SwathUnion entered, before=%x, edge=%x\n",
- before0, edge);
-
h0 = h = edge->ymax - edge->ymin;
if (h <= 0)
Abort("SwathUnion: 0 height swath?");
@@ -1176,9 +1129,6 @@ the height by that amount.
if (after == NULL || TOP(after) != TOP(edge) ||
after->xvalues[0] > rightedge->xvalues[0]) {
- IfTrace2((RegionDebug > 1),
- "SwathUnion starts disjoint: before=%x after=%x\n",
- before, after);
/*
On this side of the the above 'if', the new edge is disjoint from the
existing edges in the swath. This is the picture:
@@ -1243,9 +1193,6 @@ out the new situation:
h -= touches(h, rightedge->xvalues, after->xvalues);
- IfTrace3((RegionDebug > 1),
- "SwathUnion is overlapped until %d: before=%x after=%x\n",
- (long) TOP(edge) + h, before, after);
/*
OK, if we touched either of our neighbors we need to split at that point
and recursively sort the split edge onto the list. One tricky part
@@ -1520,7 +1467,6 @@ MoreWorkArea(struct region *R, /* region we are generating */
* need to store:
*/
if (++idy > currentsize) {
- IfTrace1((RegionDebug > 0),"Allocating edge of %d pels\n", idy);
if (currentworkarea != workedge)
NonObjectFree(currentworkarea);
currentworkarea = (pel *)Allocate(0, NULL, idy * sizeof(pel));
@@ -1545,29 +1491,19 @@ BoxClip(struct region *R, /* region to clip */
struct edgelist anchor; /* pretend edgelist to facilitate discards */
register struct edgelist *e,*laste;
- IfTrace1((OffPageDebug),"BoxClip of %z:\n", R);
-
R = UniqueRegion(R);
if (xmin > R->xmin) {
- IfTrace2((OffPageDebug),"BoxClip: left clip old %d new %d\n",
- (long) R->xmin, (long) xmin);
R->xmin = xmin;
}
if (xmax < R->xmax) {
- IfTrace2((OffPageDebug),"BoxClip: right clip old %d new %d\n",
- (long) R->xmax, (long) xmax);
R->xmax = xmax;
}
if (ymin > R->ymin) {
- IfTrace2((OffPageDebug),"BoxClip: top clip old %d new %d\n",
- (long) R->ymin, (long) ymin);
R->ymin = ymin;
}
if (ymax < R->ymax) {
- IfTrace2((OffPageDebug),"BoxClip: bottom clip old %d new %d\n",
- (long) R->ymax, (long) ymax);
R->ymax = ymax;
}
@@ -1653,11 +1589,6 @@ RegionBounds(struct region *R)
void
DumpArea(struct region *area)
{
- IfTrace1(TRUE,"Dumping area %x,", area);
- IfTrace4(TRUE," X %d:%d Y %d:%d;", (long) area->xmin,
- (long) area->xmax, (long) area->ymin,(long) area->ymax);
- IfTrace4(TRUE," origin=(%p,%p), ending=(%p,%p)\n",
- area->origin.x, area->origin.y, area->ending.x, area->ending.y);
DumpEdges(area->anchor);
}
@@ -1684,30 +1615,20 @@ out:
Abort("EDGE ERROR: overlapping swaths"); */
}
-static pel RegionDebugYMin = MINPEL;
-static pel RegionDebugYMax = MAXPEL;
-
void
DumpEdges(struct edgelist *edges)
{
register struct edgelist *p,*p2;
register pel ymin = MINPEL;
register pel ymax = MINPEL;
- register int y;
if (edges == NULL) {
- IfTrace0(TRUE," NULL area.\n");
return;
}
if (RegionDebug <= 1) {
for (p=edges; p != NULL; p = p->link) {
edgecheck(p, ymin, ymax);
ymin = p->ymin; ymax = p->ymax;
- IfTrace3(TRUE,". at %x type=%d flag=%x",
- p, (long) p->type,(long) p->flag);
- IfTrace4(TRUE," bounding box HxW is %dx%d at (%d,%d)\n",
- (long) ymax - ymin, (long) p->xmax - p->xmin,
- (long) p->xmin, (long) ymin);
}
}
else {
@@ -1718,27 +1639,8 @@ DumpEdges(struct edgelist *edges)
ymin = p2->ymin;
ymax = p2->ymax;
- if (RegionDebug > 3 || (ymax > RegionDebugYMin
- && ymin < RegionDebugYMax)) {
- IfTrace2 (TRUE,". Swath from %d to %d:\n",
- ymin, ymax);
- for (p=p2; INSWATH(p,ymin,ymax); p = p->link) {
- IfTrace4(TRUE,". . at %x[%x] range %d:%d, ",
- p, (long) p->flag,
- (long) p->xmin, (long)p->xmax);
- IfTrace1(TRUE, "subpath=%x,\n", p->subpath);
- }
- }
- for (y=MAX(ymin,RegionDebugYMin); y < MIN(ymax, RegionDebugYMax); y++) {
- IfTrace1(TRUE,". . . Y[%5d] ", (long) y);
- for (p=p2; INSWATH(p,ymin,ymax); p = p->link)
- IfTrace1(TRUE,"%5d ",
- (long) p->xvalues[y - ymin]);
- IfTrace0(TRUE,"\n");
- }
while (INSWATH(p2, ymin, ymax))
p2 = p2->link;
}
}
}
-
diff --git a/src/Type1/scanfont.c b/src/Type1/scanfont.c
index b8aff94..7b2db30 100644
--- a/src/Type1/scanfont.c
+++ b/src/Type1/scanfont.c
@@ -45,7 +45,7 @@
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/scanfont.c,v 1.15 2001/07/25 15:04:55 dawes Exp $ */
+/* $XFree86: xc/lib/font/Type1/scanfont.c,v 1.16 2003/05/27 22:26:46 tsi Exp $ */
#ifndef FONTMODULE
#include <string.h>
@@ -74,7 +74,6 @@ static cidrange *notdefrangeP;
static cidrange *cidrangeP;
extern int FDArrayIndex;
static boolean CIDWantFontInfo;
-static boolean InFDArray;
static psobj inputFile1;
#endif
@@ -1621,14 +1620,11 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP)
FILE *fileP;
FILE *fileP1;
char *nameP;
- char *p;
int namelen;
int i, j;
int cread, rangecnt;
unsigned int char_row, char_col;
- InFDArray = FALSE;
-
filetype[0] = 'r';
filetype[1] = 'b';
filetype[2] = '\0';
@@ -1657,7 +1653,7 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP)
fclose(fileP);
if (cread > 17) {
if (strncmp(buf, "%!", 2) ||
- (p = strstr(buf, "Resource-CIDFont")) == NULL)
+ strstr(buf, "Resource-CIDFont") == NULL)
return(SCAN_FILE_OPEN_ERROR);
} else
return(SCAN_FILE_OPEN_ERROR);
@@ -1687,7 +1683,7 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP)
fclose(fileP1);
if (cread > 17) {
if (strncmp(buf, "%!", 2) ||
- (p = strstr(buf, "Resource-CMap")) == NULL)
+ strstr(buf, "Resource-CMap") == NULL)
return(SCAN_FILE_OPEN_ERROR);
} else
return(SCAN_FILE_OPEN_ERROR);
@@ -1984,8 +1980,6 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP)
case TOKEN_LITERAL_NAME:
/* Look up the name */
tokenStartP[tokenLength] = '\0';
- if (0 == strncmp(tokenStartP,"FDArray",7))
- InFDArray = TRUE;
if (CIDWantFontInfo) {
rc = FindDictValue(CIDFontP->CIDfontInfoP);
diff --git a/src/Type1/spaces.c b/src/Type1/spaces.c
index 8eb4b52..9c79954 100644
--- a/src/Type1/spaces.c
+++ b/src/Type1/spaces.c
@@ -26,7 +26,7 @@
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/spaces.c,v 3.10 2002/02/18 20:51:57 herrb Exp $ */
+/* $XFree86: xc/lib/font/Type1/spaces.c,v 3.11 2003/05/27 22:26:47 tsi Exp $ */
/* SPACES CWEB V0021 ******** */
/*
:h1 id=spaces.SPACES Module - Handles Coordinate Spaces
@@ -282,8 +282,6 @@ Context(pointer device, /* device token */
register int n; /* will hold device context number */
register struct XYspace *S; /* XYspace constructed */
- IfTrace2((MustTraceCalls),"Context(%x, %f)\n", device, &units);
-
ARGCHECK((device == NULL), "Context of NULLDEVICE not allowed",
NULL, IDENTITY, (0), struct XYspace *);
ARGCHECK((units == 0.0), "Context: bad units", NULL, IDENTITY, (0), struct XYspace *);
@@ -751,9 +749,6 @@ t1_Transform(struct xobject *obj,
{
double M[2][2];
- IfTrace1((MustTraceCalls),"Transform(%z,", obj);
- IfTrace4((MustTraceCalls)," %f %f %f %f)\n", &cxx, &cyx, &cxy, &cyy);
-
M[0][0] = cxx;
M[0][1] = cyx;
M[1][0] = cxy;
@@ -772,7 +767,7 @@ t1_Scale(struct xobject *obj, /* object to scale */
double sx, double sy) /* scale factors in x and y */
{
double M[2][2];
- IfTrace3((MustTraceCalls),"Scale(%z, %f, %f)\n", obj, &sx, &sy);
+
M[0][0] = sx;
M[1][1] = sy;
M[1][0] = M[0][1] = 0.0;
@@ -794,9 +789,6 @@ xiRotate(struct xobject *obj, /* object to be transformed */
{
double M[2][2];
-
- IfTrace2((MustTraceCalls),"Rotate(%z, %f)\n", obj, &degrees);
-
M[0][0] = M[1][1] = DegreeCos(degrees);
M[1][0] = - (M[0][1] = DegreeSin(degrees));
ConsiderContext(obj, M);
@@ -1000,12 +992,4 @@ FormatFP(char *string, /* output string */
void
DumpSpace(struct XYspace *S)
{
- IfTrace4(TRUE,"--Coordinate space at %x,ID=%d,convert=%x,iconvert=%x\n",
- S, S->ID, S->convert, S->iconvert);
- IfTrace2(TRUE," | %12.3f %12.3f |",
- &S->tofract.normal[0][0], &S->tofract.normal[0][1]);
- IfTrace2(TRUE," [ %p %p ]\n", S->itofract[0][0], S->itofract[0][1]);
- IfTrace2(TRUE," | %12.3f %12.3f |",
- &S->tofract.normal[1][0], &S->tofract.normal[1][1]);
- IfTrace2(TRUE," [ %p %p ]\n", S->itofract[1][0], S->itofract[1][1]);
}
diff --git a/src/Type1/t1funcs.c b/src/Type1/t1funcs.c
index 20b7b66..70da203 100644
--- a/src/Type1/t1funcs.c
+++ b/src/Type1/t1funcs.c
@@ -71,7 +71,7 @@
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/t1funcs.c,v 3.30 2002/12/09 17:29:59 dawes Exp $ */
+/* $XFree86: xc/lib/font/Type1/t1funcs.c,v 3.33 2003/07/19 13:16:40 tsi Exp $ */
/*
@@ -204,7 +204,6 @@ CIDOpenScalable (FontPathElementPtr fpe,
glyph,
scan,
image;
- int pad,wordsize; /* scan & image in bits */
long *pool; /* memory pool for ximager objects */
int size; /* for memory size calculations */
struct XYspace *S; /* coordinate space for character */
@@ -227,8 +226,9 @@ CIDOpenScalable (FontPathElementPtr fpe,
#endif
#if defined(CID_ALL_CHARS)
char *cf;
-#endif
+#else
long sAscent, sDescent;
+#endif
/* check the font name */
len = strlen(fileName);
@@ -325,9 +325,6 @@ CIDOpenScalable (FontPathElementPtr fpe,
if (rc != Successful)
return rc;
- pad = glyph * 8;
- wordsize = scan * 8;
-
#define PAD(bits, pad) (((bits)+(pad)-1)&-(pad))
if (!(pFont = CreateFontRec()))
@@ -461,8 +458,10 @@ CIDOpenScalable (FontPathElementPtr fpe,
/* CID-keyed are not constant-width fonts. */
pFont->info.constantWidth = 0;
+#ifndef CID_ALL_CHARS
sAscent = CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[3].data.integer;
sDescent = -CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[1].data.integer;
+#endif
if (strncmp(entry->name.name, "-bogus", 6)) {
#ifdef CID_ALL_CHARS
@@ -508,8 +507,7 @@ Type1OpenScalable (FontPathElementPtr fpe,
struct XYspace *S; /* coordinate space for character */
struct region *area;
CharInfoRec *glyphs;
- register int i;
- int len, rc, count = 0;
+ int len, rc, count = 0, i = 0;
struct type1font *type1;
char *p;
FontMapPtr mapping = NULL;
@@ -617,6 +615,9 @@ Type1OpenScalable (FontPathElementPtr fpe,
no_mapping=1; /* font's native encoding vector */
}
+ pFont->info.firstCol = 255;
+ pFont->info.lastCol = 0;
+
if(!no_mapping) {
mapping = FontEncMapFind(p,
FONT_ENCODING_POSTSCRIPT, -1, -1,
@@ -626,14 +627,11 @@ Type1OpenScalable (FontPathElementPtr fpe,
FONT_ENCODING_UNICODE, -1, -1,
fileName);
if(!mapping)
- no_mapping=2;
+ goto NoEncoding;
else
no_mapping=0;
}
- pFont->info.firstCol = 255;
- pFont->info.lastCol = 0;
-
for (i=0; i < 256; i++) {
long h,w;
long paddedW;
@@ -757,7 +755,8 @@ Type1OpenScalable (FontPathElementPtr fpe,
Destroy(area);
}
-
+ NoEncoding:
+
delmemory();
xfree(pool);
@@ -948,7 +947,7 @@ CIDGetGlyphs(FontPtr pFont,
unsigned long *glyphCount, /* RETURN */
CharInfoPtr *glyphs) /* RETURN */
{
- unsigned int firstRow, numRows, code, char_row, char_col;
+ unsigned int code, char_row, char_col;
CharInfoPtr *glyphsBase;
register unsigned int c;
CharInfoPtr pci;
@@ -1040,8 +1039,6 @@ CIDGetGlyphs(FontPtr pFont,
break;
case TwoD16Bit:
- firstRow = pFont->info.firstRow;
- numRows = pFont->info.lastRow - firstRow + 1;
while (count--) {
char_row = (*chars++);
char_col = (*chars++);
diff --git a/src/Type1/t1info.c b/src/Type1/t1info.c
index 0ee137f..c1ef5f6 100644
--- a/src/Type1/t1info.c
+++ b/src/Type1/t1info.c
@@ -99,7 +99,7 @@ from The Open Group.
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/t1info.c,v 1.18 2002/09/10 16:14:33 tsi Exp $ */
+/* $XFree86: xc/lib/font/Type1/t1info.c,v 1.19 2003/05/27 22:26:47 tsi Exp $ */
#include "fntfilst.h"
#include "fontutil.h"
@@ -386,7 +386,7 @@ ComputeBoundsAllChars(FontPtr pFont, char *cfmfilename, double sxmult)
k <= cidrangeP->range[j].srcCodeHi; k++) {
ccode[0] = (k >> 8) & 0xff;
ccode[1] = k & 0xff;
- ret = CIDGetMetrics(pFont, 1, ccode, 2, &ccount, &pmetrics);
+ ret = CIDGetMetrics(pFont, 1, ccode, Linear16Bit, &ccount, &pmetrics);
if (ret != Successful || (ret == Successful && pmetrics == NULL))
continue;
total_width += pmetrics->attributes;
@@ -505,7 +505,7 @@ ComputeBoundsAll(FontPtr pFont)
k <= cidrangeP->range[j].srcCodeHi; k++) {
ccode[0] = (k >> 8) & 0xff;
ccode[1] = k & 0xff;
- ret = CIDGetMetrics(pFont, 1, ccode, 2, &ccount, (xCharInfo **)cinfo);
+ ret = CIDGetMetrics(pFont, 1, ccode, Linear16Bit, &ccount, (xCharInfo **)cinfo);
if (ret != Successful || cinfo == NULL)
continue;
pmetrics = &cinfo[0]->metrics;
diff --git a/src/Type1/token.c b/src/Type1/token.c
index ef28990..6fb4109 100644
--- a/src/Type1/token.c
+++ b/src/Type1/token.c
@@ -27,7 +27,7 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
-/* $XFree86: xc/lib/font/Type1/token.c,v 1.5 2001/01/17 19:43:24 dawes Exp $ */
+/* $XFree86: xc/lib/font/Type1/token.c,v 1.6 2003/05/27 22:26:47 tsi Exp $ */
/* Authors: Sig Nin & Carol Thompson IBM Almaden Research Laboratory */
#include "t1stdio.h"
#include "util.h"
@@ -186,7 +186,7 @@ isWHITE_SPACE(ch)\
)
#define save_ch_no_inc(ch) \
-((tokenCharP < tokenMaxP) && (*tokenCharP = ch))
+if (tokenCharP < tokenMaxP) *tokenCharP = ch
/*
* -------------------------------------------------------------------
@@ -253,7 +253,6 @@ static long m_scale;
/* real number exponent */
static int e_sign;
static long e_value;
-static long e_scale;
/* radix number */
static long r_base;
@@ -362,7 +361,6 @@ add_digits(int ch)
/* Initialize for possible real */
e_sign = '+';
e_value = 0;
- e_scale = 0;
return(ch);
}
@@ -476,7 +474,6 @@ add_fraction(int ch)
/* Initialize for possible real */
e_sign = '+';
e_value = 0;
- e_scale = 0;
return(ch);
}
@@ -554,7 +551,6 @@ add_exponent(int ch)
/* Store results */
e_value = value;
- e_scale = scale;
return(ch);
}
@@ -693,10 +689,6 @@ REAL(int ch)
back_ch_not_white(ch);
- /* NOTE: ignore e_scale, since e_value alone will cause
- * exponent overflow if e_scale > 0.
- */
-
/* HAZARD: exponent overflow of intermediate result
* (e.g., in 370 floating point); this should not be a problem
* with IEEE floating point. Reduce exponent overflow hazard by
diff --git a/src/Type1/type1.c b/src/Type1/type1.c
index 5b83dd0..9bb8d00 100644
--- a/src/Type1/type1.c
+++ b/src/Type1/type1.c
@@ -45,7 +45,7 @@
* The Original Software is CID font code that was developed by Silicon
* Graphics, Inc.
*/
-/* $XFree86: xc/lib/font/Type1/type1.c,v 1.9 2001/01/17 19:43:24 dawes Exp $ */
+/* $XFree86: xc/lib/font/Type1/type1.c,v 1.10 2003/05/27 22:26:47 tsi Exp $ */
/*********************************************************************/
/* */
@@ -150,11 +150,6 @@ typedef struct xobject xobject;
#define Error {errflag = TRUE; return;}
#define ErrorRet(ret) {errflag = TRUE; return (ret);}
-#define Error0(errmsg) {IfTrace0(TRUE, errmsg); Error;}
-#define Error0Ret(errmsg, ret) {IfTrace0(TRUE, errmsg); ErrorRet(ret);}
-
-#define Error1(errmsg,arg) {IfTrace1(TRUE, errmsg, arg); Error;}
-
/********************/
/* global variables */
/********************/
@@ -187,8 +182,7 @@ static int errflag;
/*************************************************/
static char *Environment;
static struct XYspace *CharSpace;
-static psobj *CharStringP, *SubrsP, *OtherSubrsP;
-static int *ModeP;
+static psobj *CharStringP, *SubrsP;
/************************/
/* Forward declarations */
@@ -772,7 +766,7 @@ static void
Push(double Num)
{
if (++Top < MAXSTACK) Stack[Top] = Num;
- else Error0("Push: Stack full\n");
+ else Error;
}
static void
@@ -789,7 +783,7 @@ PushCall(psobj *CurrStrP, int CurrIndex, unsigned short CurrKey)
CallStack[CallTop].currindex = CurrIndex; /* save CharString index */
CallStack[CallTop].currkey = CurrKey; /* save decryption key */
}
- else Error0("PushCall: Stack full\n");
+ else Error;
}
static void
@@ -800,7 +794,7 @@ PopCall(psobj **CurrStrPP, int *CurrIndexP, unsigned short *CurrKeyP)
*CurrIndexP = CallStack[CallTop].currindex; /* restore CharString index */
*CurrKeyP = CallStack[CallTop--].currkey; /* restore decryption key */
}
- else Error0("PopCall: Stack empty\n");
+ else Error;
}
static void
@@ -814,7 +808,7 @@ static void
PSFakePush(double Num)
{
if (++PSFakeTop < MAXPSFAKESTACK) PSFakeStack[PSFakeTop] = Num;
- else Error0("PSFakePush: Stack full\n");
+ else Error;
}
/* PSFakePop: Removes a number from the top of the fake PostScript stack */
@@ -822,7 +816,7 @@ static double
PSFakePop (void)
{
if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]);
- else Error0Ret("PSFakePop : Stack empty\n", 0.0);
+ else ErrorRet(0.0);
/*NOTREACHED*/
}
@@ -929,7 +923,7 @@ StartDecrypt(void)
r = KEY; /* Initial key (seed) for CharStrings decryption */
for (strindex = 0; strindex < blues->lenIV;)
if (!DoRead(&Code)) /* Read a byte and update decryption key */
- Error0("StartDecrypt: Premature end of CharString\n");
+ Error;
}
static void
@@ -958,7 +952,7 @@ Decode(int Code)
}
return;
-ended: Error0("Decode: Premature end of Type 1 CharString");
+ended: Error;
}
/* Interpret a command code */
@@ -968,37 +962,37 @@ DoCommand(int Code)
switch(Code) {
case HSTEM: /* |- y dy HSTEM |- */
/* Vertical range of a horizontal stem zone */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
HStem(Stack[0], Stack[1]);
ClearStack();
break;
case VSTEM: /* |- x dx VSTEM |- */
/* Horizontal range of a vertical stem zone */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
VStem(Stack[0], Stack[1]);
ClearStack();
break;
case VMOVETO: /* |- dy VMOVETO |- */
/* Vertical MOVETO, equivalent to 0 dy RMOVETO */
- if (Top < 0) Error0("DoCommand: Stack low\n");
+ if (Top < 0) Error;
RMoveTo(0.0, Stack[0]);
ClearStack();
break;
case RLINETO: /* |- dx dy RLINETO |- */
/* Like RLINETO in PostScript */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
RLineTo(Stack[0], Stack[1]);
ClearStack();
break;
case HLINETO: /* |- dx HLINETO |- */
/* Horizontal LINETO, equivalent to dx 0 RLINETO */
- if (Top < 0) Error0("DoCommand: Stack low\n");
+ if (Top < 0) Error;
RLineTo(Stack[0], 0.0);
ClearStack();
break;
case VLINETO: /* |- dy VLINETO |- */
/* Vertical LINETO, equivalent to 0 dy RLINETO */
- if (Top < 0) Error0("DoCommand: Stack low\n");
+ if (Top < 0) Error;
RLineTo(0.0, Stack[0]);
ClearStack();
break;
@@ -1007,7 +1001,7 @@ DoCommand(int Code)
/* Relative RCURVETO, equivalent to dx1 dy1 */
/* (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) */
/* (dy1+dy2+dy3) RCURVETO in PostScript */
- if (Top < 5) Error0("DoCommand: Stack low\n");
+ if (Top < 5) Error;
RRCurveTo(Stack[0], Stack[1], Stack[2], Stack[3],
Stack[4], Stack[5]);
ClearStack();
@@ -1021,7 +1015,7 @@ DoCommand(int Code)
case CALLSUBR: /* subr# CALLSUBR - */
/* Calls a CharString subroutine with index */
/* subr# from the Subrs array */
- if (Top < 0) Error0("DoCommand: Stack low\n");
+ if (Top < 0) Error;
CallSubr((int)Stack[Top--]);
break;
case RETURN: /* - RETURN - */
@@ -1030,7 +1024,7 @@ DoCommand(int Code)
Return();
break;
case ESCAPE: /* ESCAPE to two-byte command code */
- if (!DoRead(&Code)) Error0("DoCommand: ESCAPE is last byte\n");
+ if (!DoRead(&Code)) Error;
Escape(Code);
break;
case HSBW: /* |- sbx wx HSBW |- */
@@ -1038,7 +1032,7 @@ DoCommand(int Code)
/* set the character width vector to (wx,0). */
/* Equivalent to sbx 0 wx 0 SBW. Space */
/* character should have sbx = 0 */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
Sbw(Stack[0], 0.0, Stack[1], 0.0);
ClearStack();
break;
@@ -1049,20 +1043,20 @@ DoCommand(int Code)
break;
case RMOVETO: /* |- dx dy RMOVETO |- */
/* Behaves like RMOVETO in PostScript */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
RMoveTo(Stack[0], Stack[1]);
ClearStack();
break;
case HMOVETO: /* |- dx HMOVETO |- */
/* Horizontal MOVETO. Equivalent to dx 0 RMOVETO */
- if (Top < 0) Error0("DoCommand: Stack low\n");
+ if (Top < 0) Error;
RMoveTo(Stack[0], 0.0);
ClearStack();
break;
case VHCURVETO: /* |- dy1 dx2 dy2 dx3 VHCURVETO |- */
/* Vertical-Horizontal CURVETO, equivalent to */
/* 0 dy1 dx2 dy2 dx3 0 RRCURVETO */
- if (Top < 3) Error0("DoCommand: Stack low\n");
+ if (Top < 3) Error;
RRCurveTo(0.0, Stack[0], Stack[1], Stack[2],
Stack[3], 0.0);
ClearStack();
@@ -1070,13 +1064,13 @@ DoCommand(int Code)
case HVCURVETO: /* |- dx1 dx2 dy2 dy3 HVCURVETO |- */
/* Horizontal-Vertical CURVETO, equivalent to */
/* dx1 0 dx2 dy2 0 dy3 RRCURVETO */
- if (Top < 3) Error0("DoCommand: Stack low\n");
+ if (Top < 3) Error;
RRCurveTo(Stack[0], 0.0, Stack[1], Stack[2], 0.0, Stack[3]);
ClearStack();
break;
default: /* Unassigned command code */
ClearStack();
- Error1("DoCommand: Unassigned code %d\n", Code);
+ Error;
}
}
@@ -1097,7 +1091,7 @@ Escape(int Code)
/* Declares the horizontal ranges of three */
/* vertical stem zones between x0 and x0+dx0, */
/* x1 and x1+dx1, and x2 and x2+dx2. */
- if (Top < 5) Error0("DoCommand: Stack low\n");
+ if (Top < 5) Error;
if (!wsset && ProcessHints) {
/* Shift the whole character so that the middle stem is centered. */
p = CenterStem(Stack[2] + sidebearingX, Stack[3]);
@@ -1114,7 +1108,7 @@ Escape(int Code)
/* Declares the vertical ranges of three hori- */
/* zontal stem zones between y0 and y0+dy0, */
/* y1 and y1+dy1, and y2 and y2+dy2. */
- if (Top < 5) Error0("DoCommand: Stack low\n");
+ if (Top < 5) Error;
HStem(Stack[0], Stack[1]);
HStem(Stack[2], Stack[3]);
HStem(Stack[4], Stack[5]);
@@ -1122,7 +1116,7 @@ Escape(int Code)
break;
case SEAC: /* |- asb adx ady bchar achar SEAC |- */
/* Standard Encoding Accented Character. */
- if (Top < 4) Error0("DoCommand: Stack low\n");
+ if (Top < 4) Error;
Seac(Stack[0], Stack[1], Stack[2],
(unsigned char) Stack[3],
(unsigned char) Stack[4]);
@@ -1131,22 +1125,22 @@ Escape(int Code)
case SBW: /* |- sbx sby wx wy SBW |- */
/* Set the left sidebearing point to (sbx,sby), */
/* set the character width vector to (wx,wy). */
- if (Top < 3) Error0("DoCommand: Stack low\n");
+ if (Top < 3) Error;
Sbw(Stack[0], Stack[1], Stack[2], Stack[3]);
ClearStack();
break;
case DIV: /* num1 num2 DIV quotient */
/* Behaves like DIV in the PostScript language */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
Stack[Top-1] = Div(Stack[Top-1], Stack[Top]);
Top--;
break;
case CALLOTHERSUBR:
/* arg1 ... argn n othersubr# CALLOTHERSUBR - */
/* Make calls on the PostScript interpreter */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
Num = Stack[Top-1];
- if (Top < Num+1) Error0("DoCommand: Stack low\n");
+ if (Top < Num+1) Error;
for (i = 0; i < Num; i++) PSFakePush(Stack[Top - i - 2]);
Top -= Num + 2;
#ifdef BUILDCID
@@ -1168,13 +1162,13 @@ Escape(int Code)
/* Sets the current point to (x,y) in absolute */
/* character space coordinates without per- */
/* forming a CharString MOVETO command */
- if (Top < 1) Error0("DoCommand: Stack low\n");
+ if (Top < 1) Error;
SetCurrentPoint(Stack[0], Stack[1]);
ClearStack();
break;
default: /* Unassigned escape code command */
ClearStack();
- Error1("Escape: Unassigned code %d\n", Code);
+ Error;
}
}
@@ -1185,9 +1179,8 @@ Escape(int Code)
static void
HStem(double y, double dy)
{
- IfTrace2((FontDebug), "Hstem %f %f\n", &y, &dy);
if (ProcessHints) {
- if (numstems >= MAXSTEMS) Error0("HStem: Too many hints\n");
+ if (numstems >= MAXSTEMS) Error;
if (dy < 0.0) {y += dy; dy = -dy;}
stems[numstems].vertical = FALSE;
stems[numstems].x = 0.0;
@@ -1207,9 +1200,8 @@ HStem(double y, double dy)
static void
VStem(double x, double dx)
{
- IfTrace2((FontDebug), "Vstem %f %f\n", &x, &dx);
if (ProcessHints) {
- if (numstems >= MAXSTEMS) Error0("VStem: Too many hints\n");
+ if (numstems >= MAXSTEMS) Error;
if (dx < 0.0) {x += dx; dx = -dx;}
stems[numstems].vertical = TRUE;
stems[numstems].x = sidebearingX + x + wsoffsetX;
@@ -1228,8 +1220,6 @@ RLineTo(double dx, double dy)
{
struct segment *B;
- IfTrace2((FontDebug), "RLineTo %f %f\n", &dx, &dy);
-
B = Loc(CharSpace, dx, dy);
if (ProcessHints) {
@@ -1252,9 +1242,6 @@ RRCurveTo(double dx1, double dy1, double dx2, double dy2,
{
struct segment *B, *C, *D;
- IfTrace4((FontDebug), "RRCurveTo %f %f %f %f ", &dx1, &dy1, &dx2, &dy2);
- IfTrace2((FontDebug), "%f %f\n", &dx3, &dy3);
-
B = Loc(CharSpace, dx1, dy1);
C = Loc(CharSpace, dx2, dy2);
D = Loc(CharSpace, dx3, dy3);
@@ -1285,7 +1272,6 @@ DoClosePath(void)
{
struct segment *CurrentPoint;
- IfTrace0((FontDebug), "DoClosePath\n");
CurrentPoint = Phantom(path);
path = ClosePath(path);
path = Join(Snap(path), CurrentPoint);
@@ -1297,9 +1283,8 @@ DoClosePath(void)
static void
CallSubr(int subrno)
{
- IfTrace1((FontDebug), "CallSubr %d\n", subrno);
if ((subrno < 0) || (subrno >= SubrsP->len))
- Error0("CallSubr: subrno out of range\n");
+ Error;
PushCall(CharStringP, strindex, r);
CharStringP = &SubrsP->data.arrayP[subrno];
StartDecrypt();
@@ -1311,7 +1296,6 @@ CallSubr(int subrno)
static void
Return(void)
{
- IfTrace0((FontDebug), "Return\n");
PopCall(&CharStringP, &strindex, &r);
}
@@ -1326,8 +1310,6 @@ Return(void)
static void
EndChar(void)
{
- IfTrace0((FontDebug), "EndChar\n");
-
/* There is no need to compute and set bounding box for
the cache, since XIMAGER does that on the fly. */
@@ -1346,8 +1328,6 @@ RMoveTo(double dx, double dy)
{
struct segment *B;
- IfTrace2((FontDebug), "RMoveTo %f %f\n", &dx, &dy);
-
B = Loc(CharSpace, dx, dy);
if (ProcessHints) {
@@ -1366,7 +1346,6 @@ RMoveTo(double dx, double dy)
static void
DotSection(void)
{
- IfTrace0((FontDebug), "DotSection\n");
InDotSection = !InDotSection;
}
@@ -1379,9 +1358,6 @@ Seac(double asb, double adx, double ady,
int Code;
struct segment *mypath;
- IfTrace4((FontDebug), "SEAC %f %f %f %d ", &asb, &adx, &ady, bchar);
- IfTrace1((FontDebug), "%d\n", achar);
-
/* Move adx - asb, ady over and up from base char's sbpoint. */
/* (We use adx - asb to counteract the accents sb shift.) */
/* The variables accentoffsetX/Y modify sidebearingX/Y in Sbw(). */
@@ -1439,8 +1415,6 @@ Seac(double asb, double adx, double ady,
static void
Sbw(double sbx, double sby, double wx, double wy)
{
- IfTrace4((FontDebug), "SBW %f %f %f %f\n", &sbx, &sby, &wx, &wy);
-
escapementX = wx; /* Character width vector */
escapementY = wy;
@@ -1457,7 +1431,6 @@ Sbw(double sbx, double sby, double wx, double wy)
static double
Div(double num1, double num2)
{
- IfTrace2((FontDebug), "Div %f %f\n", &num1, &num2);
return(num1 / num2);
}
@@ -1757,11 +1730,9 @@ HintReplace(void)
static void
CallOtherSubr(int othersubrno)
{
- IfTrace1((FontDebug), "CallOtherSubr %d\n", othersubrno);
-
switch(othersubrno) {
case 0: /* OtherSubrs[0]; Main part of Flex */
- if (PSFakeTop < 16) Error0("CallOtherSubr: PSFakeStack low");
+ if (PSFakeTop < 16) Error;
ClearPSFakeStack();
FlxProc(
PSFakeStack[0], PSFakeStack[1], PSFakeStack[2], PSFakeStack[3],
@@ -1792,8 +1763,6 @@ CallOtherSubr(int othersubrno)
static void
SetCurrentPoint(double x, double y)
{
- IfTrace2((FontDebug), "SetCurrentPoint %f %f\n", &x, &y);
-
currx = x;
curry = y;
}
@@ -1816,8 +1785,6 @@ Type1Char(char *env, struct XYspace *S, psobj *charstrP, psobj *subrsP,
CharSpace = S; /* used when creating path elements */
CharStringP = charstrP;
SubrsP = subrsP;
- OtherSubrsP = osubrsP;
- ModeP = modeP;
blues = bluesP;
@@ -1876,8 +1843,6 @@ CIDChar(char *env, struct XYspace *S,
CharSpace = S; /* used when creating path elements */
CharStringP = charstrP;
SubrsP = subrsP;
- OtherSubrsP = osubrsP;
- ModeP = modeP;
blues = bluesP;