diff options
Diffstat (limited to 'src/Type1/hints.c')
-rw-r--r-- | src/Type1/hints.c | 103 |
1 files changed, 54 insertions, 49 deletions
diff --git a/src/Type1/hints.c b/src/Type1/hints.c index c3db5a4..5150647 100644 --- a/src/Type1/hints.c +++ b/src/Type1/hints.c @@ -26,6 +26,8 @@ * 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 $ */ + /* HINTS CWEB V0006 ******** */ /* :h1.HINTS Module - Processing Rasterization Hints @@ -39,12 +41,13 @@ W. Pryor, Jr. The included files are: */ +#include "os.h" #include "objects.h" #include "spaces.h" #include "paths.h" #include "regions.h" #include "hints.h" - + /* :h3.Functions Provided to the TYPE1IMAGER User @@ -81,7 +84,8 @@ static struct { #define FPFLOOR(fp) TOFRACTPEL((fp) >> FRACTBITS) #define FPROUND(fp) FPFLOOR((fp) + FPHALF) -void InitHints() +void +InitHints(void) { int i; @@ -96,8 +100,8 @@ void InitHints() :h3.CloseHints(hintP) - Reverse hints that are still open */ -void CloseHints(hintP) - struct fractpoint *hintP; +void +CloseHints(struct fractpoint *hintP) { int i; @@ -120,10 +124,10 @@ void CloseHints(hintP) :h3.ComputeHint(hP, currX, currY, hintP) - Compute the value of a hint */ -static void ComputeHint(hP, currX, currY, hintP) - struct hintsegment *hP; - fractpel currX, currY; - struct fractpoint *hintP; +static void +ComputeHint(struct hintsegment *hP, + fractpel currX, fractpel currY, + struct fractpoint *hintP) { fractpel currRef, currWidth; int idealWidth; @@ -166,7 +170,7 @@ multiple of 90 degrees. } else /* error */ { - abort("ComputeHint: invalid orientation"); + Abort("ComputeHint: invalid orientation"); } IfTrace4((HintDebug > 1), @@ -200,7 +204,7 @@ multiple of 90 degrees. } else /* error */ { - abort("ComputeHint: invalid hinttype"); + Abort("ComputeHint: invalid hinttype"); } IfTrace1((HintDebug > 1)," hintValue=%p", hintValue); @@ -217,7 +221,7 @@ multiple of 90 degrees. } else /* error */ { - abort("ComputeHint: invalid orientation"); + Abort("ComputeHint: invalid orientation"); } } @@ -225,10 +229,10 @@ multiple of 90 degrees. :h3.ProcessHint(hP, currX, currY, hintP) - Process a rasterization hint */ -void ProcessHint(hP, currX, currY, hintP) - struct hintsegment *hP; - fractpel currX, currY; - struct fractpoint *hintP; +void +ProcessHint(struct hintsegment *hP, + fractpel currX, fractpel currY, + struct fractpoint *hintP) { struct fractpoint thisHint; @@ -266,7 +270,7 @@ void ProcessHint(hP, currX, currY, hintP) } else /* error */ { - abort("ProcessHint: invalid label"); + Abort("ProcessHint: invalid label"); } } else if (hP->adjusttype == 'r') /* Reverse */ @@ -282,18 +286,18 @@ void ProcessHint(hP, currX, currY, hintP) } else /* error */ { - abort("ProcessHint: label is not in use"); + Abort("ProcessHint: label is not in use"); } } else /* error */ { - abort("ProcessHint: invalid label"); + Abort("ProcessHint: invalid label"); } } else /* error */ { - abort("ProcessHint: invalid adjusttype"); + Abort("ProcessHint: invalid adjusttype"); } IfTrace3((HintDebug > 1)," label=%d, thisHint=(%p,%p)\n", hP->label, thisHint.x, thisHint.y); @@ -362,9 +366,9 @@ off of the edge's range; XofY() could be replace by FindXofY() to call ourselves recursively if this were not true. */ -static pel SearchXofY(edge, y) - register struct edgelist *edge; /* represents edge */ - register pel y; /* 'y' value to find edge for */ +static pel +SearchXofY(register struct edgelist *edge, /* represents edge */ + register pel y) /* 'y' value to find edge for */ { register struct edgelist *e; /* loop variable */ @@ -385,7 +389,7 @@ static pel SearchXofY(edge, y) else return(XofY(edge, y)); - abort("bad subpath chain"); + Abort("bad subpath chain"); /*NOTREACHED*/ } /* @@ -413,9 +417,10 @@ are at the top and the first edge is going up. #define BLACKBELOW +1 #define NONE 0 -static int ImpliedHorizontalLine(e1, e2, y) - register struct edgelist *e1,*e2; /* two edges to check */ - register int y; /* y where they might be connected */ +static int +ImpliedHorizontalLine(struct edgelist *e1, /* two edges to check */ + struct edgelist *e2, + int y) /* y where they might be connected */ { register struct edgelist *e3,*e4; @@ -466,7 +471,7 @@ Now we have everything to return the answer: else if (ISBOTTOM(e1->flag) && y == e1->ymax) return(!ISDOWN(e2->flag)); else - abort("ImpliedHorizontalLine: why ask?"); + Abort("ImpliedHorizontalLine: why ask?"); /*NOTREACHED*/ } @@ -483,14 +488,14 @@ routine finds and fixes false breaks. Also, this routine sets the ISTOP and ISBOTTOM flags in the edge lists. */ -static void FixSubPaths(R) - register struct region *R; /* anchor of region */ +static void +FixSubPaths(struct region *R) /* anchor of region */ { register struct edgelist *e; /* fast loop variable */ register struct edgelist *edge; /* current edge in region */ register struct edgelist *next; /* next in subpath after 'edge' */ register struct edgelist *break1; /* first break after 'next' */ - register struct edgelist *break2; /* last break before 'edge' */ + register struct edgelist *break2 = NULL; /* last break before 'edge' */ register struct edgelist *prev; /* previous edge for fixing links */ int left = TRUE; @@ -505,7 +510,7 @@ static void FixSubPaths(R) if (!ISBREAK(edge, next)) continue; if (edge->ymax < next->ymin) - abort("disjoint subpath?"); + Abort("disjoint subpath?"); /* 'edge' now contains an edgelist at the bottom of an edge, and 'next' contains the next subsequent edgelist in the subpath, which must be at @@ -566,7 +571,7 @@ as 'next': break1->subpath = break2->subpath; if (ISBREAK(break1, break1->subpath)) - abort("unable to fix subpath break?"); + Abort("unable to fix subpath break?"); break2->subpath = next; @@ -626,10 +631,10 @@ get all the way to the outside without resolving ambiguity. A debug tool. */ -static struct edgelist *before(); /* subroutine of DumpSubPaths */ +static struct edgelist *before(struct edgelist *e); /* subroutine of DumpSubPaths */ -static void DumpSubPaths(anchor) - struct edgelist *anchor; +static void +DumpSubPaths(struct edgelist *anchor) { register struct edgelist *edge,*e,*e2; @@ -672,8 +677,8 @@ static void DumpSubPaths(anchor) } } -static struct edgelist *before(e) - struct edgelist *e; +static struct edgelist * +before(struct edgelist *e) { struct edgelist *r; for (r = e->subpath; r->subpath != e; r = r->subpath) { ; } @@ -705,10 +710,10 @@ new x might exceed the region's bounds, updating those are the responsibility of the caller. */ -static void writeXofY(e, y, x) - struct edgelist *e; /* relevant edgelist */ - int y; /* y value */ - int x; /* new x value */ +static void +writeXofY(struct edgelist *e,/* relevant edgelist */ + int y, /* y value */ + int x) /* new x value */ { if (e->xmin > x) e->xmin = x; if (e->xmax < x) e->xmax = x; @@ -739,12 +744,12 @@ points (collapses) the white run as necessary if it is not. The goal is to collapse the white run as little as possible. */ -static void CollapseWhiteRun(anchor, yblack, left, right, ywhite) - struct edgelist *anchor; /* anchor of edge list */ - pel yblack; /* y of (hopefully) black run above or below */ - struct edgelist *left; /* edgelist at left of WHITE run */ - struct edgelist *right; /* edgelist at right of WHITE run */ - pel ywhite; /* y location of white run */ +static void +CollapseWhiteRun(struct edgelist *anchor, /* anchor of edge list */ + pel yblack, /* y of (hopefully) black run above or below */ + struct edgelist *left, /* edgelist at left of WHITE run */ + struct edgelist *right, /* edgelist at right of WHITE run */ + pel ywhite) /* y location of white run */ { struct edgelist *edge; struct edgelist *swathstart = anchor; @@ -810,8 +815,8 @@ This is the externally visible routine called from the REGIONS module when the +CONTINUITY flag is on the Interior() fill rule. */ -void ApplyContinuity(R) -struct region *R; +void +ApplyContinuity(struct region *R) { struct edgelist *left; struct edgelist *right; |