summaryrefslogtreecommitdiff
path: root/x11/xfstt
diff options
context:
space:
mode:
authorkristerw <kristerw@pkgsrc.org>2004-02-14 22:27:30 +0000
committerkristerw <kristerw@pkgsrc.org>2004-02-14 22:27:30 +0000
commitcc321300450125df90da24d09a4be719c5b0f999 (patch)
tree3a875e6527e25d489a0ce6eb121f3ac919e50d10 /x11/xfstt
parent9fdeaeaae7be7eff8a63733eaeaaf51855b2279a (diff)
downloadpkgsrc-cc321300450125df90da24d09a4be719c5b0f999.tar.gz
Convert varargs-macros to old-style macros, to make the package
compile when using gcc 2.95.
Diffstat (limited to 'x11/xfstt')
-rw-r--r--x11/xfstt/distinfo17
-rw-r--r--x11/xfstt/patches/patch-af302
-rw-r--r--x11/xfstt/patches/patch-ag22
-rw-r--r--x11/xfstt/patches/patch-ah13
-rw-r--r--x11/xfstt/patches/patch-ai1217
-rw-r--r--x11/xfstt/patches/patch-aj126
-rw-r--r--x11/xfstt/patches/patch-ak40
-rw-r--r--x11/xfstt/patches/patch-al22
-rw-r--r--x11/xfstt/patches/patch-am69
-rw-r--r--x11/xfstt/patches/patch-an13
-rw-r--r--x11/xfstt/patches/patch-ao13
-rw-r--r--x11/xfstt/patches/patch-ap40
-rw-r--r--x11/xfstt/patches/patch-aq12
-rw-r--r--x11/xfstt/patches/patch-ar13
-rw-r--r--x11/xfstt/patches/patch-as28
-rw-r--r--x11/xfstt/patches/patch-at86
16 files changed, 2032 insertions, 1 deletions
diff --git a/x11/xfstt/distinfo b/x11/xfstt/distinfo
index 8023d0c9c89..b4ba6d191f9 100644
--- a/x11/xfstt/distinfo
+++ b/x11/xfstt/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2004/01/25 20:46:19 wiz Exp $
+$NetBSD: distinfo,v 1.9 2004/02/14 22:27:30 kristerw Exp $
SHA1 (xfstt-1.6.tar.gz) = 7fe623b27d85c5611346376d2b84e549db038c17
Size (xfstt-1.6.tar.gz) = 346346 bytes
@@ -6,3 +6,18 @@ SHA1 (patch-aa) = 771f503ee245ac4dcbbd8adf5f7b1746cb39c6e0
SHA1 (patch-ab) = 18d41c9121c4b95b22a831fb987a97c90a8c0a86
SHA1 (patch-ac) = 0733764a5eae4965120ae43c06e62f8f9e995fe8
SHA1 (patch-ae) = 8765af1c37f1b0efd4107d27758428bccbea364e
+SHA1 (patch-af) = 876e7f631e206c145890ec1e5a4cf40d7ffa2af1
+SHA1 (patch-ag) = 30c5906f533522e354b12016f70954393fcb867a
+SHA1 (patch-ah) = abc3ab3d6760bba444fed6cdd062751c769d5a93
+SHA1 (patch-ai) = a117a6bf3387ec06531c9043dab3e34433fb82e6
+SHA1 (patch-aj) = 3562509882f0fb4504288374560f1613c0f79744
+SHA1 (patch-ak) = 346701fffc5b922865bf5ef6174f9773c72cc285
+SHA1 (patch-al) = 87c30429450e081041aa0313c11dda9f38e9a963
+SHA1 (patch-am) = 0a5526f321d1e0679d27ac7c6b580d01640ae651
+SHA1 (patch-an) = 472d6a0c8f0aacefc58a3e794dc5010223f80c32
+SHA1 (patch-ao) = e005c5305b820fd39af5d4fd5125ba0f537f414e
+SHA1 (patch-ap) = 5daeeb6a0fc26f9caa50bada3cda0a81a0a3695e
+SHA1 (patch-aq) = 5daad9fc85b5265f47a00d7e091ad398022bc5a3
+SHA1 (patch-ar) = 2640fad66919f224c3a4dcf0c79342843fa660bb
+SHA1 (patch-as) = 64339660e6204d9712389429342ebadd96f72cba
+SHA1 (patch-at) = 1a9e7243f2d36b280a3e4baffa3871ec1ee4ed29
diff --git a/x11/xfstt/patches/patch-af b/x11/xfstt/patches/patch-af
new file mode 100644
index 00000000000..f8fdeaee660
--- /dev/null
+++ b/x11/xfstt/patches/patch-af
@@ -0,0 +1,302 @@
+$NetBSD: patch-af,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- src/xfstt.cc.orig Thu Aug 7 08:31:47 2003
++++ src/xfstt.cc Sat Feb 14 23:04:55 2004
+@@ -397,7 +397,7 @@
+ } else
+ mapIndex = 0;
+
+- debug("match\t\"%s\"\n", buf0 + 1);
++ debug1("match\t\"%s\"\n", buf0 + 1);
+
+ *buf0 = buf - buf0;
+ return *buf0 + 1;
+@@ -451,7 +451,7 @@
+ strncpy(buf, (char *)&fn, sizeof(fn));
+ strncpy(buf + sizeof(fn), fontName, ttfn->nameLen);
+ buf[fn.nameLen] = 0;
+- debug("ListFont \"%s\"\n", buf);
++ debug1("ListFont \"%s\"\n", buf);
+
+ return fn.nameLen + 1;
+ }
+@@ -464,7 +464,7 @@
+ if (fid == xfs->fid)
+ return xfs;
+
+- debug("fid = %ld not found!\n", fid);
++ debug1("fid = %ld not found!\n", fid);
+
+ if (sd) {
+ fsError reply;
+@@ -482,7 +482,7 @@
+ openFont(TTFont *ttFont, FontParams *fp, Rasterizer *raster,
+ int fid, Encoding *encoding)
+ {
+- debug("point %d, pixel %d, res %d\n",
++ debug3("point %d, pixel %d, res %d\n",
+ fp->point[0], fp->pixel[0], fp->resolution[0]);
+
+ if (!ttFont || ttFont->badFont())
+@@ -536,7 +536,7 @@
+ fp->point[3] = (fp->pixel[3] * 72 + 36) / fp->resolution[1];
+ }
+
+- debug("point %d, pixel %d, res %d\n", fp->point[0], fp->pixel[0],
++ debug3("point %d, pixel %d, res %d\n", fp->point[0], fp->pixel[0],
+ fp->resolution[0]);
+
+ // init rasterizer
+@@ -576,7 +576,7 @@
+ return 0;
+
+ // parse attributes
+- debug("point %d, pixel %d, res %d\n",
++ debug3("point %d, pixel %d, res %d\n",
+ fp->point[0], fp->pixel[0], fp->resolution[0]);
+
+ int m_index = 0, p_index = 0, r_index = 0;
+@@ -701,8 +701,8 @@
+ if (!encoding)
+ encoding = encodings[0];
+
+- debug("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->strName);
+- debug("size %d, resx %d, resy %d\n",
++ debug2("\nopenXLFD(\"%s\"), %s\n", xlfdName, encoding->strName);
++ debug3("size %d, resx %d, resy %d\n",
+ fp->point[0], fp->resolution[0], fp->resolution[1]);
+
+ TTFNdata* ttfn = (TTFNdata *)(infoBase + sizeof(TTFNheader));
+@@ -876,7 +876,7 @@
+ sd = accept(sd_unix, (struct sockaddr *)&s_unix, &saLength);
+ else if (!noTCP && FD_ISSET(sd_inet, &sdlist))
+ sd = accept(sd_inet, (struct sockaddr *)&s_inet, &saLength);
+- debug("accept(saLength = %d) = %d\n", saLength, sd);
++ debug2("accept(saLength = %d) = %d\n", saLength, sd);
+
+ return sd;
+ }
+@@ -901,9 +901,9 @@
+ return 0;
+ }
+
+- debug("%s endian connection\n",
++ debug1("%s endian connection\n",
+ (req->byteOrder == 'l') ? "little" : "big");
+- debug("version %d.%d\n", req->major_version, req->minor_version);
++ debug2("version %d.%d\n", req->major_version, req->minor_version);
+
+ if ((req->byteOrder == 'l' && (*(U32 *)req & 0xff) != 'l')
+ || (req->byteOrder == 'B' && ((*(U32 *)req >> 24) & 0xff) != 'B')) {
+@@ -955,7 +955,7 @@
+
+ register U8 *p, *end = fe->bitmaps + fe->bmplen;
+ if ((fe->bmpFormat ^ hint) & BitmapFormatMaskByte) {
+- debug("slpswap SLP=%d\n", LOGSLP);
++ debug1("slpswap SLP=%d\n", LOGSLP);
+ p = fe->bitmaps;
+ switch (LOGSLP) {
+ case 3:
+@@ -987,7 +987,7 @@
+ }
+
+ if ((format != LOGSLP) && (hint & BitmapFormatByteOrderMask == 0)) {
+- debug("fmtswap SLP=%d -> fmt=%d\n", LOGSLP, format);
++ debug2("fmtswap SLP=%d -> fmt=%d\n", LOGSLP, format);
+ p = fe->bitmaps;
+ if (LOGSLP == 3 && format == 4) {
+ for (; p < end; p += 2)
+@@ -1045,7 +1045,7 @@
+ check_length(int sd, int seqno, fsReq *req, int expected_size)
+ {
+ if (req->length < (expected_size >> 2)) {
+- debug("packet size mismatch: %d received bytes, "
++ debug2("packet size mismatch: %d received bytes, "
+ "%d expected bytes\n", req->length << 2, expected_size);
+ send_fserror(sd, seqno);
+ return 0;
+@@ -1080,7 +1080,7 @@
+ fsReq *fsreq = (fsReq *)buf;
+ int length = fsreq->length << 2;
+ if (length > MAXREQSIZE) {
+- debug("too much data: %d bytes (max=%d)\n",
++ debug2("too much data: %d bytes (max=%d)\n",
+ length, MAXREQSIZE);
+ send_fserror(sd, seqno);
+ break;
+@@ -1182,12 +1182,12 @@
+ {
+ fsSetEventMaskReq *req = (fsSetEventMaskReq *)buf;
+ event_mask = req->event_mask;
+- debug("FS_SetEventMask %04X\n", event_mask);
++ debug1("FS_SetEventMask %04X\n", event_mask);
+ }
+ break;
+
+ case FS_GetEventMask:
+- debug("FS_GetEventMask = %04X\n", event_mask);
++ debug1("FS_GetEventMask = %04X\n", event_mask);
+ {
+ fsGetEventMaskReply reply;
+ reply.type = FS_Reply;
+@@ -1241,7 +1241,7 @@
+
+ fsResolution *res = (fsResolution *)(req + 1);
+
+- debug("FS_SetResolution * %d\n", numres);
++ debug1("FS_SetResolution * %d\n", numres);
+ for (; --numres >= 0; ++res) {
+ if (!defaultres) {
+ fp0.resolution[0] = res->x_resolution;
+@@ -1250,7 +1250,7 @@
+ res->point_size /= 10;
+ fp0.point[0] = fp0.point[1] = res->point_size;
+ fp0.point[2] = fp0.point[3] = 0;
+- debug("xres = %d, yres = %d, size = %d\n",
++ debug3("xres = %d, yres = %d, size = %d\n",
+ res->x_resolution, res->y_resolution,
+ res->point_size / 10);
+ }
+@@ -1289,7 +1289,7 @@
+ break;
+
+ pattern[req->nbytes] = 0;
+- debug("FS_ListFonts \"%s\" * %ld\n",
++ debug2("FS_ListFonts \"%s\" * %ld\n",
+ pattern, req->maxNames);
+
+ fsListFontsReply reply;
+@@ -1323,7 +1323,7 @@
+ buf += len;
+ ++reply.nFonts;
+ }
+- debug("Found %ld fonts\n", reply.nFonts);
++ debug1("Found %ld fonts\n", reply.nFonts);
+ reply.length = (sizeof(reply) + (buf - replybuf)
+ + 3) >> 2;
+
+@@ -1358,7 +1358,7 @@
+ error.sequenceNumber = seqno;
+ error.length = sizeof(error) >> 2;
+
+- debug(" fsError size = %u bytes, %u ints\n",
++ debug2(" fsError size = %u bytes, %u ints\n",
+ sizeof(error), error.length);
+ write(sd, (void *)&error, sizeof(error));
+ #endif
+@@ -1370,7 +1370,7 @@
+ fsOpenBitmapFontReq *req = (fsOpenBitmapFontReq *)buf;
+ char *fontName = (char *)(req + 1) + 1;
+ fontName[*(U8 *)(req + 1)] = 0;
+- debug("FS_OpenBitmapFont \"%s\"", fontName);
++ debug1("FS_OpenBitmapFont \"%s\"", fontName);
+
+ raster->format = (req->format_hint >> 8) & 3;
+ if (req->format_hint & 0x0c)
+@@ -1399,7 +1399,7 @@
+ write(sd, (void *)&reply, sizeof(reply));
+ debug(" not found\n");
+ }
+- debug("fhint = %04lX, fmask = %04lX, fid = %ld\n",
++ debug3("fhint = %04lX, fmask = %04lX, fid = %ld\n",
+ req->format_hint, req->format_mask, req->fid);
+ }
+ break;
+@@ -1407,7 +1407,7 @@
+ case FS_QueryXInfo:
+ {
+ fsQueryXInfoReq *req = (fsQueryXInfoReq *)buf;
+- debug("FS_QueryXInfo fid = %ld\n", req->id);
++ debug1("FS_QueryXInfo fid = %ld\n", req->id);
+
+ struct {
+ fsQueryXInfoReply s1;
+@@ -1439,10 +1439,10 @@
+ reply.s1.font_hdr_char_range_max_char_low
+ = (U8)fi->lastChar;
+
+- debug("minchar = 0x%02X%02X, ",
++ debug2("minchar = 0x%02X%02X, ",
+ reply.s1.font_hdr_char_range_min_char_high,
+ reply.s1.font_hdr_char_range_min_char_low);
+- debug("maxchar = 0x%02X%02X\n",
++ debug2("maxchar = 0x%02X%02X\n",
+ reply.s1.font_hdr_char_range_max_char_high,
+ reply.s1.font_hdr_char_range_max_char_low);
+
+@@ -1466,11 +1466,11 @@
+ reply.s1.font_header_font_ascent = fe->yWinAscent;
+ reply.s1.font_header_font_descent = fe->yWinDescent;
+
+- debug("FM= (asc= %d, dsc= %d, ",
++ debug2("FM= (asc= %d, dsc= %d, ",
+ fe->yAscentMax, fe->yDescentMax);
+- debug("wasc= %d, wdsc= %d, ",
++ debug2("wasc= %d, wdsc= %d, ",
+ fe->yWinAscent, fe->yWinDescent);
+- debug("wmin= %d, wmax= %d)\n",
++ debug2("wmin= %d, wmax= %d)\n",
+ fe->xAdvanceMin, fe->xAdvanceMax);
+
+ // we need to have some property data, otherwise
+@@ -1494,10 +1494,10 @@
+ {
+ fsQueryXExtents16Req *req = (fsQueryXExtents16Req *)buf;
+
+- debug("FS_QueryXExtents%s fid = %ld, ",
++ debug2("FS_QueryXExtents%s fid = %ld, ",
+ (req->reqType == FS_QueryXExtents8 ? "8" : "16"),
+ req->fid);
+- debug("range=%d, nranges=%ld\n",
++ debug2("range=%d, nranges=%ld\n",
+ req->range, req->num_ranges);
+
+ int item_size = (req->reqType == FS_QueryXExtents8)
+@@ -1535,7 +1535,7 @@
+ for (; nranges > 0; nranges -= 2, ptr += 2) {
+ ptr[0] = ntohs(ptr[0]);
+ ptr[1] = ntohs(ptr[1]);
+- debug("rg %d..%d\n",ptr[0],ptr[1]);
++ debug2("rg %d..%d\n",ptr[0],ptr[1]);
+ for (U16 j = ptr[0]; j <= ptr[1]; ++j)
+ (ext++)->left = j;
+ }
+@@ -1591,9 +1591,9 @@
+ {
+ fsQueryXBitmaps16Req *req = (fsQueryXBitmaps16Req *)buf;
+
+- debug("FS_QueryXBitmaps16 fid = %ld, fmt = %04lX\n",
++ debug2("FS_QueryXBitmaps16 fid = %ld, fmt = %04lX\n",
+ req->fid, req->format);
+- debug("range=%d, nranges=%ld\n",
++ debug2("range=%d, nranges=%ld\n",
+ req->range, req->num_ranges);
+
+ int item_size = (req->reqType == FS_QueryXExtents8)
+@@ -1633,7 +1633,7 @@
+ for (; nranges > 0; nranges -= 2, ptr += 2) {
+ ptr[0] = ntohs(ptr[0]);
+ ptr[1] = ntohs(ptr[1]);
+- debug("rg %d..%d\n",ptr[0],ptr[1]);
++ debug2("rg %d..%d\n",ptr[0],ptr[1]);
+ for (U16 j = ptr[0]; j <= ptr[1]; ++j)
+ (ofs++)->position = j;
+ }
+@@ -1713,7 +1713,7 @@
+ case FS_CloseFont:
+ {
+ fsCloseReq *req = (fsCloseReq *)buf;
+- debug("FS_CloseFont fid = %ld\n", req->id);
++ debug1("FS_CloseFont fid = %ld\n", req->id);
+
+ XFSFont *xfs = findFont(req->id, sd, seqno);
+ if (xfs) {
+@@ -1725,7 +1725,7 @@
+ break;
+
+ default:
+- debug("Unknown FS request 0x%02X !\n", fsreq->reqType);
++ debug1("Unknown FS request 0x%02X !\n", fsreq->reqType);
+ {
+ fsRequestError reply;
+ reply.type = FS_Error;
diff --git a/x11/xfstt/patches/patch-ag b/x11/xfstt/patches/patch-ag
new file mode 100644
index 00000000000..858245ed5de
--- /dev/null
+++ b/x11/xfstt/patches/patch-ag
@@ -0,0 +1,22 @@
+$NetBSD: patch-ag,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/rafile.cc.orig Sat Feb 14 22:06:38 2004
++++ libfstt/rafile.cc Sat Feb 14 22:07:03 2004
+@@ -200,7 +200,7 @@
+ #else
+ int fd = open(fileName, O_RDONLY);
+ if (fd <= 0) {
+- debug("Cannot open \"%s\"\n", fileName);
++ debug1("Cannot open \"%s\"\n", fileName);
+ ptr = base = 0;
+ return;
+ }
+@@ -237,7 +237,7 @@
+ checksum += readUInt() & (-1 << ((-length & 3) << 3));
+ ptr = saveptr;
+
+- debug("Checksum is %08X\n", calcChecksum());
++ debug1("Checksum is %08X\n", calcChecksum());
+
+ return checksum;
+ }
diff --git a/x11/xfstt/patches/patch-ah b/x11/xfstt/patches/patch-ah
new file mode 100644
index 00000000000..55b2970d741
--- /dev/null
+++ b/x11/xfstt/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/raster_draw.cc.orig Sat Feb 14 22:09:49 2004
++++ libfstt/raster_draw.cc Sat Feb 14 22:10:01 2004
+@@ -228,7 +228,7 @@
+ Rasterizer::drawBitmap(U8 *const bmp, int height, int dX)
+ {
+ // sort horizontal/vertical dots
+- debug("dropoutControl = %d\n", gs.dropout_control);
++ debug1("dropoutControl = %d\n", gs.dropout_control);
+ if (dots[0] + 1 < dots0) {
+ preSort(dots[0] + 1, dots0);
+ endSort(dots[0] + 1, dots0);
diff --git a/x11/xfstt/patches/patch-ai b/x11/xfstt/patches/patch-ai
new file mode 100644
index 00000000000..666cb480598
--- /dev/null
+++ b/x11/xfstt/patches/patch-ai
@@ -0,0 +1,1217 @@
+$NetBSD: patch-ai,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/raster_hints.cc.orig Sat Feb 14 22:10:14 2004
++++ libfstt/raster_hints.cc Sat Feb 14 22:39:52 2004
+@@ -123,7 +123,7 @@
+ int val = cvtTab->nextVal();
+ // (ld 2048 = 11) - (SHIFT = 6) = 5
+ cvt[i] = ((val * scale + 32) >> 6) << xxexp;
+- debug("cvt[%3d] = %5d -> %5d\n", i, val, cvt[i]);
++ debug3("cvt[%3d] = %5d -> %5d\n", i, val, cvt[i]);
+ }
+
+ if (ttFont->prepTable == 0)
+@@ -198,13 +198,13 @@
+ y -= gs.round_phase - gs.round_thold;
+ y &= -gs.round_period;
+ y += gs.round_phase;
+- debug("\tsround(%d) = %d\t", x, (x<0)?-y:+y);
++ debug2("\tsround(%d) = %d\t", x, (x<0)?-y:+y);
+ break;
+ case ROUND_SUPER45:
+ y -= gs.round_phase - gs.round_thold;
+ y -= y % gs.round_period;
+ y += gs.round_phase;
+- debug("\tsround45(%d) = %d\t", x, (x<0)?-y:+y);
++ debug2("\tsround45(%d) = %d\t", x, (x<0)?-y:+y);
+ break;
+ }
+ if (y < 0) return 0;
+@@ -214,8 +214,8 @@
+ inline int
+ GraphicsState::absNewMeasure(int dx11D6, int dy11D6)
+ {
+- debug("\ndx = %d, dy = %d", dx11D6, dy11D6);
+- debug(",\tpx = %d, py = %d", p_vec_x, p_vec_y);
++ debug2("\ndx = %d, dy = %d", dx11D6, dy11D6);
++ debug2(",\tpx = %d, py = %d", p_vec_x, p_vec_y);
+
+ int dist = dx11D6 * p_vec_x + dy11D6 * p_vec_y + 0x2000;
+ dist >>= 14;
+@@ -225,8 +225,8 @@
+ inline int
+ GraphicsState::absOldMeasure(int dx11D6, int dy11D6)
+ {
+- debug("\ndx = %d, dy = %d", dx11D6, dy11D6);
+- debug(",\tdpx = %d, dpy = %d", dp_vec_x, dp_vec_y);
++ debug2("\ndx = %d, dy = %d", dx11D6, dy11D6);
++ debug2(",\tdpx = %d, dpy = %d", dp_vec_x, dp_vec_y);
+
+ int dist = dx11D6 * dp_vec_x + dy11D6 * dp_vec_y + 0x2000;
+ dist >>= 14;
+@@ -237,7 +237,7 @@
+ Rasterizer::newMeasure(const point& p2, const point& p1)
+ {
+ int dist = gs.absNewMeasure(p2.xnow - p1.xnow, p2.ynow - p1.ynow);
+- debug("\nnewMeasure p[%d]-p[%d] = %f",
++ debug3("\nnewMeasure p[%d]-p[%d] = %f",
+ &p2 - p[1], &p1 - p[1], dist / FSHIFT);
+
+ return dist;
+@@ -247,7 +247,7 @@
+ Rasterizer::oldMeasure(const point& p2, const point& p1)
+ {
+ int dist = gs.absOldMeasure(p2.xold - p1.xold, p2.yold - p1.yold);
+- debug("\noldMeasure p[%d]-p[%d] = %f",
++ debug3("\noldMeasure p[%d]-p[%d] = %f",
+ &p2 - p[1], &p1 - p[1], dist / FSHIFT);
+ return dist;
+ }
+@@ -271,9 +271,9 @@
+ vx = 0;
+ vy = 0;
+ }
+- debug("\t(%d %d) - ", p2.xnow, p2.ynow);
+- debug("(%d %d)", p1.xnow, p1.ynow);
+- debug("\nvx vy = %f %f", vx / FSHIFT, vy / FSHIFT);
++ debug2("\t(%d %d) - ", p2.xnow, p2.ynow);
++ debug2("(%d %d)", p1.xnow, p1.ynow);
++ debug2("\nvx vy = %f %f", vx / FSHIFT, vy / FSHIFT);
+ }
+
+ void
+@@ -295,22 +295,22 @@
+ vx = 0;
+ vy = 0;
+ }
+- debug("\t(%d %d) - ", p2.xold, p2.yold);
+- debug("(%d %d)", p1.xold, p1.yold);
+- debug("\nvx vy = %f %f", vx / FSHIFT, vy / FSHIFT);
++ debug2("\t(%d %d) - ", p2.xold, p2.yold);
++ debug2("(%d %d)", p1.xold, p1.yold);
++ debug2("\nvx vy = %f %f", vx / FSHIFT, vy / FSHIFT);
+ }
+
+ inline void
+ GraphicsState::movePoint(point& pp, int len11D6)
+ {
+- debug("\nmovePoint by %f", len11D6 / FSHIFT);
+- debug("\t(%d %d)", pp.xnow, pp.ynow);
++ debug1("\nmovePoint by %f", len11D6 / FSHIFT);
++ debug2("\t(%d %d)", pp.xnow, pp.ynow);
+
+ pp.xnow += (len11D6 * move_x) >> 14;
+ pp.ynow += (len11D6 * move_y) >> 14;
+ pp.flags |= flags;
+
+- debug("\t-> (%d %d)\n", pp.xnow, pp.ynow);
++ debug2("\t-> (%d %d)\n", pp.xnow, pp.ynow);
+ }
+
+ void
+@@ -350,7 +350,7 @@
+ assert(stack >= stackbase);
+
+ int opc = f->readUByte();
+- debug("\n::%05X %02X\t", f->fileOffset() - 1, opc);
++ debug2("\n::%05X %02X\t", f->fileOffset() - 1, opc);
+ switch (opc) {
+
+ // pushing onto the stack
+@@ -363,11 +363,11 @@
+ case PUSHB04: case PUSHB05:
+ case PUSHB06: case PUSHB07:
+ m = opc - (PUSHB00 - 1);
+- debug("PUSHB * %d\n>\t\t", m);
++ debug1("PUSHB * %d\n>\t\t", m);
+ while (--m >= 0) {
+ ++stack;
+ *stack = f->readUByte();
+- debug("%d,\t", *stack);
++ debug1("%d,\t", *stack);
+ if ((m & 7) == 0)
+ debug("\n>\t\t");
+ }
+@@ -381,10 +381,10 @@
+ case PUSHW04: case PUSHW05:
+ case PUSHW06: case PUSHW07:
+ m = opc - (PUSHW00 - 1);
+- debug("PUSHW * %d\n>\t\t", m);
++ debug1("PUSHW * %d\n>\t\t", m);
+ while (--m >= 0) {
+ *(++stack) = f->readSShort();
+- debug("%d,\t", *stack);
++ debug1("%d,\t", *stack);
+ if ((m & 7) == 0)
+ debug("\n>\t\t");
+ }
+@@ -396,12 +396,12 @@
+ m = *stack;
+ assert(m >= 0 && m < sizeStor);
+ *stack = stor[m];
+- debug("RS store[%d] = %d", m, *stack);
++ debug2("RS store[%d] = %d", m, *stack);
+ break;
+ case WS:
+ m = *(stack--);
+ n = *(stack--);
+- debug("WS %d -> store[%d]", m, n);
++ debug2("WS %d -> store[%d]", m, n);
+ assert(n >= 0 && n < sizeStor);
+ stor[n] = m;
+ break;
+@@ -413,7 +413,7 @@
+ n = *(stack--);
+ assert(n >= 0 && n < sizeCvt);
+ cvt[n] = m;
+- debug("WCVTP %d -> cvt[%d] = %d", m, n, cvt[n]);
++ debug3("WCVTP %d -> cvt[%d] = %d", m, n, cvt[n]);
+ break;
+ case WCVTF:
+ m = *(stack--);
+@@ -421,13 +421,13 @@
+ assert(n >= 0 && n < sizeCvt);
+ //XXX: how does one scale a scalar with the ((xx,xy),(yx,yy)) matrix???
+ cvt[n] = ((m * (xx + yy) + 32) >> 6) << xxexp;
+- debug("#WCVTF %d -> cvt[%d] = %d\n", m, n, cvt[n]);
++ debug3("#WCVTF %d -> cvt[%d] = %d\n", m, n, cvt[n]);
+ break;
+ case RCVT:
+ m = *stack;
+ assert(m >= 0 && m < sizeCvt);
+ *stack = cvt[m];
+- debug("RCVT cvt[%d] = %d", m, *stack);
++ debug2("RCVT cvt[%d] = %d", m, *stack);
+ break;
+
+ // accessing the graphics state
+@@ -493,7 +493,7 @@
+ case SDPVTL0:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SDPVTL0 p[%d] p[%d]", m, n);
++ debug2("SDPVTL0 p[%d] p[%d]", m, n);
+ oldLine2vector(gs.zp1[n], gs.zp2[m], gs.dp_vec_x, gs.dp_vec_y);
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.p_vec_x, gs.p_vec_y);
+ gs.recalc();
+@@ -501,7 +501,7 @@
+ case SDPVTL1:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SDPVTL1 p[%d] p[%d]", m, n);
++ debug2("SDPVTL1 p[%d] p[%d]", m, n);
+ oldLine2vector(gs.zp1[n], gs.zp2[m], gs.dp_vec_y, gs.dp_vec_x);
+ gs.dp_vec_x = -gs.dp_vec_x;
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.p_vec_y, gs.p_vec_x);
+@@ -511,7 +511,7 @@
+ case SPVTL0:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SPVTL0 p[%d] p[%d]", m, n);
++ debug2("SPVTL0 p[%d] p[%d]", m, n);
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.p_vec_x, gs.p_vec_y);
+ gs.dp_vec_x = gs.p_vec_x;
+ gs.dp_vec_y = gs.p_vec_y;
+@@ -520,7 +520,7 @@
+ case SPVTL1:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SPVTL1 p[%d] p[%d]\t", m, n);
++ debug2("SPVTL1 p[%d] p[%d]\t", m, n);
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.p_vec_y, gs.p_vec_x);
+ gs.dp_vec_y = gs.p_vec_y = -gs.p_vec_y;
+ gs.dp_vec_x = gs.p_vec_x;
+@@ -529,14 +529,14 @@
+ case SFVTL0:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SFVTL0 p[%d] p[%d]\t", m, n);
++ debug2("SFVTL0 p[%d] p[%d]\t", m, n);
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.f_vec_x, gs.f_vec_y);
+ gs.recalc();
+ break;
+ case SFVTL1:
+ m = *(stack--);
+ n = *(stack--);
+- debug("SFVTL1 p[%d] p[%d]", m, n);
++ debug2("SFVTL1 p[%d] p[%d]", m, n);
+ newLine2vector(gs.zp1[n], gs.zp2[m], gs.f_vec_y, gs.f_vec_x);
+ gs.f_vec_y = -gs.f_vec_y;
+ gs.recalc();
+@@ -550,58 +550,58 @@
+ case SPVFS:
+ gs.dp_vec_y = gs.p_vec_y = *(stack--);
+ gs.dp_vec_x = gs.p_vec_x = *(stack--);
+- debug("#SPVFS = %d %d", gs.p_vec_x, gs.p_vec_y);
++ debug2("#SPVFS = %d %d", gs.p_vec_x, gs.p_vec_y);
+ gs.recalc();
+ break;
+ case SFVFS:
+ gs.f_vec_y = *(stack--);
+ gs.f_vec_x = *(stack--);
+- debug("#SFVFS = %d %d", gs.f_vec_x, gs.f_vec_y);
++ debug2("#SFVFS = %d %d", gs.f_vec_x, gs.f_vec_y);
+ gs.recalc();
+ break;
+ case GPV:
+ *(++stack) = gs.p_vec_x;
+ *(++stack) = gs.p_vec_y;
+- debug("GPV = %d %d", gs.p_vec_x, gs.p_vec_y);
++ debug2("GPV = %d %d", gs.p_vec_x, gs.p_vec_y);
+ break;
+ case GFV:
+ *(++stack) = gs.f_vec_x;
+ *(++stack) = gs.f_vec_y;
+- debug("GFV = %d %d", gs.f_vec_x, gs.f_vec_y);
++ debug2("GFV = %d %d", gs.f_vec_x, gs.f_vec_y);
+ break;
+ case SRP0:
+ gs.rp0 = *(stack--);
+- debug("SRP0 p[%d]", gs.rp0);
++ debug1("SRP0 p[%d]", gs.rp0);
+ break;
+ case SRP1:
+ gs.rp1 = *(stack--);
+- debug("SRP1 p[%d]", gs.rp1);
++ debug1("SRP1 p[%d]", gs.rp1);
+ break;
+ case SRP2:
+ gs.rp2 = *(stack--);
+- debug("SRP2 p[%d]", gs.rp2);
++ debug1("SRP2 p[%d]", gs.rp2);
+ break;
+ case SZP0:
+ m = *(stack--);
+ assert(m >= 0 && m <= 1);
+ gs.zp0 = p[m];
+- debug("SZP0 %d", m);
++ debug1("SZP0 %d", m);
+ break;
+ case SZP1:
+ m = *(stack--);
+ assert(m >= 0 && m <= 1);
+ gs.zp1 = p[m];
+- debug("SZP1 %d", m);
++ debug1("SZP1 %d", m);
+ break;
+ case SZP2:
+ m = *(stack--);
+ assert(m >= 0 && m <= 1);
+ gs.zp2 = p[m];
+- debug("SZP2 %d", m);
++ debug1("SZP2 %d", m);
+ break;
+ case SZPS:
+ m = *(stack--);
+- debug("SZPS %d", m);
++ debug1("SZPS %d", m);
+ assert(m >= 0 && m <= 1);
+ gs.zp2 = gs.zp1 = gs.zp0 = p[m];
+ break;
+@@ -631,7 +631,7 @@
+ break;
+ case SROUND:
+ m = *(stack--);
+- debug("SROUND %d %d %d", (m >> 6) & 3, (m >> 4) & 3, m);
++ debug3("SROUND %d %d %d", (m >> 6) & 3, (m >> 4) & 3, m);
+ gs.round_state = ROUND_SUPER;
+ n = (m >> 6) & 3;
+ gs.round_period = 0x20 << n;
+@@ -643,12 +643,12 @@
+ gs.round_thold = (gs.round_period >> 3) * (m - 4);
+ else
+ gs.round_thold = gs.round_period - 1;
+- debug("-> period 0x%02X, thold 0x%02X, phase 0x%02X",
++ debug3("-> period 0x%02X, thold 0x%02X, phase 0x%02X",
+ gs.round_period, gs.round_thold, gs.round_phase);
+ break;
+ case S45ROUND:
+ m = *(stack--);
+- debug("SROUND45 %d %d %d", (m >> 6) & 3, (m >> 4) & 3, m);
++ debug3("SROUND45 %d %d %d", (m >> 6) & 3, (m >> 4) & 3, m);
+ gs.round_state = ROUND_SUPER45;
+ gs.round_period = 1444 >> (7 - ((m >> 6) & 3));
+ gs.round_phase = (gs.round_period * (m & 0x30)) >> 6;
+@@ -657,21 +657,21 @@
+ gs.round_thold = (gs.round_period * (m - 4)) >> 3;
+ else
+ gs.round_thold = gs.round_period - 1;
+- debug("-> period 0x%02X, thold 0x%02X, phase 0x%02X",
++ debug3("-> period 0x%02X, thold 0x%02X, phase 0x%02X",
+ gs.round_period, gs.round_thold, gs.round_phase);
+ break;
+ case SLOOP:
+ gs.loop = *(stack--);
+- debug("SLOOP %d", gs.loop);
++ debug1("SLOOP %d", gs.loop);
+ break;
+ case SMD:
+ gs.min_distance = *(stack--);
+- debug("SMD %d", gs.min_distance);
++ debug1("SMD %d", gs.min_distance);
+ break;
+ case INSTCTRL:
+ gs.instr_control = *(stack--);
+ m = *(stack--);
+- debug("###INSTCTRL %d %d", gs.instr_control, m);
++ debug2("###INSTCTRL %d %d", gs.instr_control, m);
+ if (gs.instr_control == 1)
+ if (m && grid_fitting >= 0)
+ grid_fitting = -grid_fitting;
+@@ -685,24 +685,24 @@
+ if (m & 0x0800 && mppem > (m & 0xff)) gs.dropout_control = 0;
+ if (m & 0x1000 && (xy || yx)) gs.dropout_control = 0;
+ if (m & 0x2000 && xx == yy) gs.dropout_control = 0;
+- debug("SCANCTRL %04X -> %d", m, gs.dropout_control);
++ debug2("SCANCTRL %04X -> %d", m, gs.dropout_control);
+ break;
+ case SCANTYPE:
+ m = *(stack--);
+- debug("###SCANTYPE %d", m);
++ debug1("###SCANTYPE %d", m);
+ // TODO
+ break;
+ case SCVTCI:
+ gs.cvt_cut_in = *(stack--);
+- debug("SCVTCI %d", gs.cvt_cut_in);
++ debug1("SCVTCI %d", gs.cvt_cut_in);
+ break;
+ case SSWCI:
+ gs.swidth_cut_in = *(stack--);
+- debug("SSWCI %d", gs.swidth_cut_in);
++ debug1("SSWCI %d", gs.swidth_cut_in);
+ break;
+ case SSW:
+ gs.swidth_value = *(stack--);
+- debug("SSW %d", gs.swidth_value);
++ debug1("SSW %d", gs.swidth_value);
+ break;
+ case FLIPON:
+ gs.auto_flip = 1;
+@@ -715,37 +715,37 @@
+ case SANGW:
+ // angle_weight is obsolete!
+ m = *(stack--);
+- debug("SANGW %d is obsolete", m);
++ debug1("SANGW %d is obsolete", m);
+ break;
+ case SDB:
+ gs.delta_base = *(stack--);
+- debug("SDB %d", gs.delta_base);
++ debug1("SDB %d", gs.delta_base);
+ break;
+ case SDS:
+ gs.delta_shift = *(stack--);
+- debug("SDS %d", gs.delta_shift);
++ debug1("SDS %d", gs.delta_shift);
+ break;
+
+ // do some measurements
+
+ case GC0:
+ pp = &gs.zp2[*stack];
+- debug("GC0 p[%d][%d]\t", gs.zp2 == p[1], pp - gs.zp2);
++ debug2("GC0 p[%d][%d]\t", gs.zp2 == p[1], pp - gs.zp2);
+ *stack = gs.absNewMeasure(pp->xnow, pp->ynow);
+- debug("\t=> %d", *stack);
++ debug1("\t=> %d", *stack);
+ break;
+ case GC1:
+ pp = &gs.zp2[*stack];
+- debug("GC1 p[%d][%d]\t", gs.zp2 == p[1], pp - gs.zp2);
++ debug2("GC1 p[%d][%d]\t", gs.zp2 == p[1], pp - gs.zp2);
+ *stack = gs.absOldMeasure(pp->xold, pp->yold);
+- debug("\t=> %d", *stack);
++ debug1("\t=> %d", *stack);
+ break;
+ case SCFS:
+ // move point along freedom vector, so that
+ // projection gets desired length
+ m = *(stack--);
+ n = *(stack--);
+- debug("SCFS p[%d][%d] to %f", gs.zp2 == p[1], n, m / FSHIFT);
++ debug3("SCFS p[%d][%d] to %f", gs.zp2 == p[1], n, m / FSHIFT);
+ pp = &gs.zp2[n];
+ if (gs.zp2 == p[1]) {
+ int i = gs.absNewMeasure(pp->xnow, pp->ynow);
+@@ -758,15 +758,15 @@
+ case MD0:
+ m = *(stack--);
+ n = *stack;
+- debug("MD0 p[%d][%d] ", gs.zp1 == p[1], m);
+- debug("- p[%d][%d]", gs.zp0 == p[1], n);
++ debug2("MD0 p[%d][%d] ", gs.zp1 == p[1], m);
++ debug2("- p[%d][%d]", gs.zp0 == p[1], n);
+ *stack = newMeasure(gs.zp0[n], gs.zp1[m]);
+ break;
+ case MD1:
+ m = *(stack--);
+ n = *stack;
+- debug("MD1 p[%d][%d] ", gs.zp1 == p[1], m);
+- debug("- p[%d][%d]", gs.zp0 == p[1], n);
++ debug2("MD1 p[%d][%d] ", gs.zp1 == p[1], m);
++ debug2("- p[%d][%d]", gs.zp0 == p[1], n);
+ *stack = oldMeasure(gs.zp0[n], gs.zp1[m]); // Thanks David
+ break;
+ case MPPEM:
+@@ -775,11 +775,11 @@
+ if (m < 0)
+ m = -m;
+ *(++stack) = m;
+- debug("\t => mppem = %d", m);
++ debug1("\t => mppem = %d", m);
+ break;
+ case MPS:
+ *(++stack) = pointSize;
+- debug("MPS %d", *stack);
++ debug1("MPS %d", *stack);
+ break;
+
+ // outline manipulation
+@@ -787,7 +787,7 @@
+ case FLIPPT:
+ for (m = gs.loop; --m >= 0;) {
+ n = *(stack--);
+- debug("FLIPPT * %d p[%d][%d]", m, gs.zp0 == p[1], n);
++ debug3("FLIPPT * %d p[%d][%d]", m, gs.zp0 == p[1], n);
+ gs.zp1[n].flags ^= ON_CURVE;
+ }
+ gs.loop = 1;
+@@ -795,7 +795,7 @@
+ case FLIPRGON:
+ m = *(stack--);
+ n = *(stack--);
+- debug("FLIPRGON p[%d][%d .. %d]", gs.zp0 == p[1], n, m);
++ debug3("FLIPRGON p[%d][%d .. %d]", gs.zp0 == p[1], n, m);
+ pp = &gs.zp1[n];
+ for (m -= n-1; --m >= 0; ++pp)
+ pp->flags |= ON_CURVE;
+@@ -803,7 +803,7 @@
+ case FLIPRGOFF:
+ m = *(stack--);
+ n = *(stack--);
+- debug("FLIPRGOFF p[%d][%d .. %d]", gs.zp0 == p[1], n, m);
++ debug3("FLIPRGOFF p[%d][%d .. %d]", gs.zp0 == p[1], n, m);
+ pp = &gs.zp1[n];
+ for (m -= n-1; --m >= 0; ++pp)
+ pp->flags &= ~ON_CURVE;
+@@ -814,8 +814,8 @@
+ n = gs.absNewMeasure(pp->xnow - pp->xold, pp->ynow - pp->yold);
+ for (m = gs.loop; --m >= 0;) {
+ int i = *(stack--);
+- debug("SHP * %d p[%d], rp = p[%d]", m, i, pp-p[1]);
+- debug(" moved by %f", n / FSHIFT);
++ debug3("SHP * %d p[%d], rp = p[%d]", m, i, pp-p[1]);
++ debug1(" moved by %f", n / FSHIFT);
+ gs.movePoint(gs.zp2[i], n);
+ }
+ gs.loop = 1;
+@@ -826,14 +826,14 @@
+ m = *(stack--);
+ assert(m >= 0 && m < sizeContours);
+ pp = (opc & 1) ? &gs.zp0[gs.rp1] : &gs.zp1[gs.rp2];
+- debug("SHC%d rp[%d]", opc & 1, pp - p[1]);
++ debug2("SHC%d rp[%d]", opc & 1, pp - p[1]);
+ n = gs.absNewMeasure(pp->xnow - pp->xold, pp->ynow - pp->yold);
+ int i = (m <= 0) ? 0 : endPoints[m-1] + 1;
+ m = (gs.zp2 == p[0]) ? nPoints[0] : endPoints[m];
+ for (; i <= m; ++i) {
+ if (pp == &gs.zp2[i])
+ continue;
+- debug("SHC%d p[%d] by %f\n", opc & 1, i, n / FSHIFT);
++ debug3("SHC%d p[%d] by %f\n", opc & 1, i, n / FSHIFT);
+ gs.movePoint(gs.zp2[i], n);
+ }
+ }
+@@ -841,32 +841,32 @@
+ case SHZ0:
+ case SHZ1:
+ m = *(stack--);
+- debug("SHZ%d rp = p[%d]\n ", opc & 1,
++ debug2("SHZ%d rp = p[%d]\n ", opc & 1,
+ (opc & 1) ? gs.rp1 : gs.rp2);
+ pp = (opc & 1) ? &gs.zp0[gs.rp1] : &gs.zp1[gs.rp2];
+ n = gs.absNewMeasure(pp->xnow - pp->xold, pp->ynow - pp->yold);
+ assert(m >= 0 && m <= 1);
+ for (point *pp1 = p[m], *pp2 = pp1 + nPoints[m]; pp1 < pp2; ++pp1) {
+ if (pp1 == pp) continue;
+- debug("\nSHZ p[%d] by %f", pp1 - p[m], n / FSHIFT);
+- debug("\t(%d %d) -> ", pp1->xnow, pp1->ynow);
++ debug2("\nSHZ p[%d] by %f", pp1 - p[m], n / FSHIFT);
++ debug2("\t(%d %d) -> ", pp1->xnow, pp1->ynow);
+ pp1->xnow += (n * gs.move_x) >> 14;
+ pp1->ynow += (n * gs.move_y) >> 14;
+- debug("(%d %d)\n", pp1->xnow, pp1->ynow);
++ debug2("(%d %d)\n", pp1->xnow, pp1->ynow);
+ }
+ break;
+ case SHPIX:
+ m = *(stack--);
+ for (n = gs.loop; --n >= 0;) {
+ int i = *(stack--);
+- debug("SHPIX * %d p[%d][%d] ", n, gs.zp2 == p[1], i);
+- debug("by %f", m / FSHIFT);
++ debug3("SHPIX * %d p[%d][%d] ", n, gs.zp2 == p[1], i);
++ debug1("by %f", m / FSHIFT);
+ pp = &gs.zp2[i];
+- debug("\n%d %d ->", pp->xnow, pp->ynow);
++ debug2("\n%d %d ->", pp->xnow, pp->ynow);
+ pp->xnow += (m * gs.f_vec_x) >> 14;
+ pp->ynow += (m * gs.f_vec_y) >> 14;
+ pp->flags |= gs.flags;
+- debug("\t%d %d", pp->xnow, pp->ynow);
++ debug2("\t%d %d", pp->xnow, pp->ynow);
+ }
+ gs.loop = 1;
+ break;
+@@ -876,8 +876,8 @@
+ n = *(stack--);
+ gs.rp2 = n;
+ gs.rp1 = gs.rp0;
+- debug("MSIRP%d p[%d][%d] ", opc & 1, gs.zp1 == p[1], n);
+- debug("to %f, rp = p[%d][%d]", m / FSHIFT,
++ debug3("MSIRP%d p[%d][%d] ", opc & 1, gs.zp1 == p[1], n);
++ debug3("to %f, rp = p[%d][%d]", m / FSHIFT,
+ gs.zp0 == p[1], gs.rp0);
+ if (gs.zp1 == p[1]) {
+ int i = newMeasure(p[1][n], gs.zp0[gs.rp0]);
+@@ -895,9 +895,9 @@
+ case MDAP0:
+ case MDAP1:
+ gs.rp0 = gs.rp1 = *(stack--);
+- debug("MDAP%d p[%d]", opc & 1, gs.rp0);
++ debug2("MDAP%d p[%d]", opc & 1, gs.rp0);
+ pp = &gs.zp0[gs.rp0];
+- debug("\nxy %d %d", pp->xnow, pp->ynow);
++ debug2("\nxy %d %d", pp->xnow, pp->ynow);
+ pp->flags |= gs.flags;
+ if (opc & 1) {
+ #if 0 // XXX
+@@ -905,11 +905,11 @@
+ pp->xnow = round(pp->xnow);
+ if (gs.f_vec_y)
+ pp->ynow = round(pp->ynow);
+- debug("\t-> %d %d", pp->xnow, pp->ynow);
++ debug2("\t-> %d %d", pp->xnow, pp->ynow);
+ #else
+ m = gs.absNewMeasure(pp->xnow, pp->ynow);
+ gs.movePoint(*pp, round(m) - m);
+- debug("\t-> %d %d", pp->xnow, pp->ynow);
++ debug2("\t-> %d %d", pp->xnow, pp->ynow);
+ #endif
+ }
+ break;
+@@ -917,10 +917,10 @@
+ case MIAP1:
+ m = *(stack--);
+ gs.rp0 = gs.rp1 = *(stack--);
+- debug("MIAP%d p[%d][%d] ", opc & 1, gs.zp0 == p[1], gs.rp0);
+- debug("to cvt[%d] = ", m);
++ debug3("MIAP%d p[%d][%d] ", opc & 1, gs.zp0 == p[1], gs.rp0);
++ debug1("to cvt[%d] = ", m);
+ m = cvt[m];
+- debug("%f", m / FSHIFT);
++ debug1("%f", m / FSHIFT);
+ if (gs.zp0 != p[0]) {
+ pp = &p[1][gs.rp0];
+ int i = gs.absNewMeasure(pp->xnow, pp->ynow);
+@@ -929,7 +929,7 @@
+ m = i;
+ m = round(m);
+ }
+- debug("\nabsdist = %f", i / FSHIFT);
++ debug1("\nabsdist = %f", i / FSHIFT);
+ gs.movePoint(gs.zp0[gs.rp0], m - i);
+ } else { // magic in the twilight zone
+ pp = &p[0][gs.rp0];
+@@ -959,18 +959,18 @@
+ case MDRP1E: case MDRP1F:
+ gs.rp2 = *(stack--);
+ gs.rp1 = gs.rp0;
+- debug("#MDRP%02X p[%d], rp = p[%d]", opc & 15, gs.rp2, gs.rp0);
++ debug3("#MDRP%02X p[%d], rp = p[%d]", opc & 15, gs.rp2, gs.rp0);
+ n = oldMeasure(gs.zp1[gs.rp2], gs.zp0[gs.rp0]);
+ m = newMeasure(gs.zp1[gs.rp2], gs.zp0[gs.rp0]);
+- debug("\nwgoaldist = %f, nowdist = %f", n / FSHIFT, m / FSHIFT);
+- debug("\n(%d %d)-", gs.zp1[gs.rp2].xnow, gs.zp1[gs.rp2].ynow);
+- debug("rp0(%d %d)", gs.zp0[gs.rp0].xnow, gs.zp0[gs.rp0].ynow);
++ debug2("\nwgoaldist = %f, nowdist = %f", n / FSHIFT, m / FSHIFT);
++ debug2("\n(%d %d)-", gs.zp1[gs.rp2].xnow, gs.zp1[gs.rp2].ynow);
++ debug2("rp0(%d %d)", gs.zp0[gs.rp0].xnow, gs.zp0[gs.rp0].ynow);
+
+ if (((n >= 0) ? +n : -n) < gs.swidth_cut_in)
+ n = (n >= 0) ? +gs.swidth_value : -gs.swidth_value;
+ if (opc & 0x10)
+ gs.rp0 = gs.rp2;
+- debug("\nmdrp1.wanted = %d", n);
++ debug1("\nmdrp1.wanted = %d", n);
+ if (opc & 0x08)
+ if (n >= 0) {
+ if (n < +gs.min_distance)
+@@ -981,7 +981,7 @@
+ }
+ if (opc & 0x04)
+ n = round(n);
+- debug("\nmdrp2.wanted = %d", n);
++ debug1("\nmdrp2.wanted = %d", n);
+ // XXX: ignore black/gray/white for now
+ gs.movePoint(gs.zp1[gs.rp2], n - m);
+ break;
+@@ -1005,10 +1005,10 @@
+ m = *(stack--);
+ gs.rp2 = *(stack--);
+ pp = &gs.zp1[gs.rp2];
+- debug("#MIRP%02X p[%d] with cvt[%d]", opc & 15, gs.rp2, m);
++ debug3("#MIRP%02X p[%d] with cvt[%d]", opc & 15, gs.rp2, m);
+
+ m = cvt[m];
+- debug(" = %f, rp = p[%d]", m / FSHIFT, gs.rp0);
++ debug2(" = %f, rp = p[%d]", m / FSHIFT, gs.rp0);
+ if (((m >= 0)? +m : -m) < +gs.swidth_cut_in)
+ m = (m >= 0) ? +gs.swidth_value : -gs.swidth_value;
+
+@@ -1016,7 +1016,7 @@
+
+ if ((n^m) < 0 && gs.auto_flip) {
+ m = -m;
+- debug("\nautoflip m = %f", m / FSHIFT);
++ debug1("\nautoflip m = %f", m / FSHIFT);
+ }
+ if (opc & 0x04) {
+ if (((m>n) ? m - n : n - m) >= +gs.cvt_cut_in)
+@@ -1041,7 +1041,7 @@
+ case ALIGNRP:
+ for (m = gs.loop; --m >= 0;) {
+ int n = *(stack--);
+- debug("ALIGNRP * %d p[%d], rp0 = p[%d]", m, n, gs.rp0);
++ debug3("ALIGNRP * %d p[%d], rp0 = p[%d]", m, n, gs.rp0);
+ int i = newMeasure(gs.zp0[gs.rp0], gs.zp1[n]);
+ gs.movePoint(gs.zp1[n], i);
+ }
+@@ -1051,7 +1051,7 @@
+ {
+ m = *(stack--);
+ n = *(stack--);
+- debug("ALIGNPTS %d %d", m, n);
++ debug2("ALIGNPTS %d %d", m, n);
+ int i = newMeasure(gs.zp0[m], gs.zp1[n]) >> 1;
+ gs.movePoint(gs.zp0[m], -i);
+ gs.movePoint(gs.zp1[n], +i);
+@@ -1065,9 +1065,9 @@
+ point* pp4 = &gs.zp0[*(stack--)];
+ m = *(stack--);
+
+- debug("ISECT p[%d] ", m);
+- debug("between p[%d]-p[%d] ", pp1-gs.zp1, pp2-gs.zp1);
+- debug("and p[%d]-p[%d] ", pp3-gs.zp0, pp4-gs.zp0);
++ debug1("ISECT p[%d] ", m);
++ debug2("between p[%d]-p[%d] ", pp1-gs.zp1, pp2-gs.zp1);
++ debug2("and p[%d]-p[%d] ", pp3-gs.zp0, pp4-gs.zp0);
+
+ int f1 = (pp1->xnow - pp3->xnow) * (pp4->ynow - pp3->ynow) -
+ (pp1->ynow - pp3->ynow) * (pp4->xnow - pp3->xnow);
+@@ -1087,7 +1087,7 @@
+ MULDIV(f1, pp2->ynow - pp1->ynow, f2);
+ }
+
+- debug("\n-> %d %d", pp3->xnow, pp3->ynow);
++ debug2("\n-> %d %d", pp3->xnow, pp3->ynow);
+ }
+ break;
+ case AA:
+@@ -1097,9 +1097,9 @@
+ case IP:
+ for (m = gs.loop; --m >= 0;) {
+ int n = *(stack--);
+- debug("IP * %d p[%d] ", m, n);
+- debug("between p[%d][%d] ", gs.zp1 == p[1], gs.rp2);
+- debug("and p[%d][%d]", gs.zp0 == p[1], gs.rp1);
++ debug2("IP * %d p[%d] ", m, n);
++ debug2("between p[%d][%d] ", gs.zp1 == p[1], gs.rp2);
++ debug2("and p[%d][%d]", gs.zp0 == p[1], gs.rp1);
+ interpolate(gs.zp2[n], gs.zp1[gs.rp2], gs.zp0[gs.rp1]);
+ debug("\n");
+ }
+@@ -1108,13 +1108,13 @@
+ case UTP:
+ m = *(stack--);
+ gs.zp0[m].flags &= ~(X_TOUCHED | Y_TOUCHED);
+- debug("UTP p[%d]", m);
++ debug1("UTP p[%d]", m);
+ break;
+ case IUP0:
+ pp = p[1];
+ for (m = 0; m < nEndPoints; ++m) {
+ point* last = p[1] + endPoints[m];
+- debug("IUP0 p[%d .. %d]", pp - p[1], last - p[1]);
++ debug2("IUP0 p[%d .. %d]", pp - p[1], last - p[1]);
+ doIUP0(pp, last);
+ pp = last + 1;
+ }
+@@ -1123,7 +1123,7 @@
+ pp = p[1];
+ for (m = 0; m < nEndPoints; ++m) {
+ point* last = p[1] + endPoints[m];
+- debug("IUP1 p[%d .. %d]", pp - p[1], last - p[1]);
++ debug2("IUP1 p[%d .. %d]", pp - p[1], last - p[1]);
+ doIUP1(pp, last);
+ pp = last + 1;
+ }
+@@ -1138,11 +1138,11 @@
+ n = 0;
+ deltap_label:
+ m = *(stack--);
+- debug("DELTAP%d * %d", (-n >> 4) + 1, m);
+- debug("\tmppem=%d, deltabase=%d", mppem, gs.delta_base);
++ debug2("DELTAP%d * %d", (-n >> 4) + 1, m);
++ debug2("\tmppem=%d, deltabase=%d", mppem, gs.delta_base);
+ n += mppem - gs.delta_base;
+ if (n < 0 || n > 15) {
+- debug("\n=> skipping %d exceptions", m);
++ debug1("\n=> skipping %d exceptions", m);
+ stack -= m << 1;
+ break;
+ }
+@@ -1150,8 +1150,8 @@
+ while (--m >= 0) {
+ int pno = *(stack--);
+ int arg = *(stack--);
+- debug("\np[%d] arg %04X", pno, arg);
+- debug("\targ.n=%d, n=%d", arg >> 4, n >> 4);
++ debug2("\np[%d] arg %04X", pno, arg);
++ debug2("\targ.n=%d, n=%d", arg >> 4, n >> 4);
+ if (n > (arg & 0xf0))
+ break;
+ if (n == (arg & 0xf0)) {
+@@ -1159,7 +1159,7 @@
+ if (arg >= 0)
+ ++arg;
+ arg <<= (SHIFT - gs.delta_shift);
+- debug("\tmoving by %f from (%d %d) ",
++ debug3("\tmoving by %f from (%d %d) ",
+ arg / FSHIFT,
+ gs.zp0[pno].xnow, gs.zp0[pno].ynow);
+ #if 0
+@@ -1169,7 +1169,7 @@
+ gs.zp0[pno].ynow += (arg * gs.f_vec_y) >> 14;
+ gs.zp0[pno].flags |= gs.flags;
+ #endif
+- debug("to (%d %d)\n",
++ debug2("to (%d %d)\n",
+ gs.zp0[pno].xnow, gs.zp0[pno].ynow);
+ }
+ }
+@@ -1198,8 +1198,8 @@
+ n = 0;
+ deltac_label:
+ m = *(stack--);
+- debug("DELTAC%d * %d", (-n >> 4) + 1, m);
+- debug("\tmppem=%d, deltabase=%d", mppem, gs.delta_base);
++ debug2("DELTAC%d * %d", (-n >> 4) + 1, m);
++ debug2("\tmppem=%d, deltabase=%d", mppem, gs.delta_base);
+ n += mppem - gs.delta_base;
+ if (n < 0 || n > 15) {
+ stack -= m << 1;
+@@ -1209,7 +1209,7 @@
+ while (--m >= 0) {
+ int cno = *(stack--);
+ int arg = *(stack--);
+- debug("\ncvt[%d] arg = %04X, n = %d",
++ debug3("\ncvt[%d] arg = %04X, n = %d",
+ cno, arg, n >> 4);
+ if (n > (arg & 0xf0))
+ break;
+@@ -1217,10 +1217,10 @@
+ arg = (arg & 15) - 8;
+ if (arg >= 0) ++arg;
+ arg <<= SHIFT - gs.delta_shift;
+- debug("\tmoved by %f,\t%d ",
++ debug2("\tmoved by %f,\t%d ",
+ arg / FSHIFT, cvt[cno]);
+ cvt[cno] += arg;
+- debug("-> %d", cvt[cno]);
++ debug1("-> %d", cvt[cno]);
+ }
+ }
+ #ifndef DEBUG
+@@ -1230,8 +1230,8 @@
+ while (--m >= 0) {
+ int cno = *(stack--);
+ int arg = *(stack--);
+- debug("\n(cvt[%d] arg %04X", cno, arg);
+- debug("\targ.n=%d, n=%d)", arg >> 4, n >> 4);
++ debug2("\n(cvt[%d] arg %04X", cno, arg);
++ debug2("\targ.n=%d, n=%d)", arg >> 4, n >> 4);
+ };
+ #endif
+ break;
+@@ -1241,7 +1241,7 @@
+ case DUP:
+ m = *stack;
+ *(++stack) = m;
+- debug("DUP = %d", m);
++ debug1("DUP = %d", m);
+ break;
+ case POP:
+ debug("POP");
+@@ -1260,20 +1260,20 @@
+ case DEPTH:
+ m = stack - stackbase;
+ *(++stack) = m;
+- debug("DEPTH = %d", m);
++ debug1("DEPTH = %d", m);
+ break;
+ case CINDEX:
+ m = *stack;
+ assert(stack - m >= stackbase);
+ *stack = *(stack - m);
+- debug("CINDEX %d = %d", m, *stack);
++ debug2("CINDEX %d = %d", m, *stack);
+ break;
+ case MINDEX:
+ m = *stack;
+ stack -= m;
+ assert(stack >= stackbase);
+ n = *stack;
+- debug("MINDEX %d = %d", m, n);
++ debug2("MINDEX %d = %d", m, n);
+ for (; --m > 0; ++stack)
+ stack[0] = stack[1];
+ *stack = n;
+@@ -1283,15 +1283,15 @@
+ *(stack - 0) = *(stack - 2);
+ *(stack - 2) = *(stack - 1);
+ *(stack - 1) = m;
+- debug("ROLL %d %d %d", m, *(stack - 2), *stack);
+- debug(" => %d %d %d", *stack, m, *(stack - 2));
++ debug3("ROLL %d %d %d", m, *(stack - 2), *stack);
++ debug3(" => %d %d %d", *stack, m, *(stack - 2));
+ break;
+
+ // control flow
+
+ case IF:
+ m = *(stack--);
+- debug("IF %d", m);
++ debug1("IF %d", m);
+ if (!m)
+ skipHints(f);
+ break;
+@@ -1305,7 +1305,7 @@
+ break;
+ case JROT:
+ m = *(stack--);
+- debug("JROT %d -> ", m);
++ debug1("JROT %d -> ", m);
+ if (m)
+ goto jump_relative;
+ debug("not taken");
+@@ -1313,7 +1313,7 @@
+ break;
+ case JROF:
+ m = *(stack--);
+- debug("JROF %d -> ", m);
++ debug1("JROF %d -> ", m);
+ if (!m)
+ goto jump_relative;
+ debug("not taken");
+@@ -1322,81 +1322,81 @@
+ case JMPR:
+ jump_relative:
+ m = *(stack--);
+- debug("JMPR %d", m);
++ debug1("JMPR %d", m);
+ f->seekRelative(m-1);
+ break;
+ case LT:
+ m = *(stack--);
+ n = *stack;
+ *stack = (n < m);
+- debug("LT %d %d = %d", m, n, *stack);
++ debug3("LT %d %d = %d", m, n, *stack);
+ break;
+ case LTEQ:
+ m = *(stack--);
+ n = *stack;
+ *stack = (n <= m);
+- debug("LTEQ %d %d = %d", m, n, *stack);
++ debug3("LTEQ %d %d = %d", m, n, *stack);
+ break;
+ case GT:
+ m = *(stack--);
+ n = *stack;
+ *stack = (n > m);
+- debug("GT %d %d = %d", m, n, *stack);
++ debug3("GT %d %d = %d", m, n, *stack);
+ break;
+ case GTEQ:
+ m = *(stack--);
+ n = *stack;
+ *stack = (n >= m);
+- debug("GTEQ %d %d = %d", m, n, *stack);
++ debug3("GTEQ %d %d = %d", m, n, *stack);
+ break;
+ case EQ:
+ m = *(stack--);
+ n = *stack;
+ *stack = (m == n);
+- debug("EQ %d %d = %d", m, n, *stack);
++ debug3("EQ %d %d = %d", m, n, *stack);
+ break;
+ case NEQ:
+ m = *(stack--);
+ n = *stack;
+ *stack = (m != n);
+- debug("NEQ %d %d = %d", m, n, *stack);
++ debug3("NEQ %d %d = %d", m, n, *stack);
+ break;
+ case ODD:
+ m = *stack;
+ *stack = (round(m) >> SHIFT) & 1;
+- debug("ODD %d = %d", m, *stack);
++ debug2("ODD %d = %d", m, *stack);
+ break;
+ case EVEN:
+ m = *stack;
+ *stack = ((~round(m)) >> SHIFT) & 1;
+- debug("EVEN %d = %d", m, *stack);
++ debug2("EVEN %d = %d", m, *stack);
+ break;
+ case AND:
+ m = *(stack--);
+ n = *stack;
+ *stack = n && m;
+- debug("AND %d %d = %d", m, n, *stack);
++ debug3("AND %d %d = %d", m, n, *stack);
+ break;
+ case OR:
+ m = *(stack--);
+ n = *stack;
+ *stack = n || m;
+- debug("OR %d %d = %d", m, n, *stack);
++ debug3("OR %d %d = %d", m, n, *stack);
+ break;
+ case NOT:
+ m = *stack;
+ *stack = !m;
+- debug("NOT %d = %d", m, *stack);
++ debug2("NOT %d = %d", m, *stack);
+ break;
+ case ADD:
+ m = *(stack--);
+ *stack += m;
+- debug("ADD %d %d = %d", m, *stack - m, *stack);
++ debug3("ADD %d %d = %d", m, *stack - m, *stack);
+ break;
+ case SUB:
+ m = *(stack--);
+ *stack -= m;
+- debug("SUB %d %d = %d", m, *stack + m, *stack);
++ debug3("SUB %d %d = %d", m, *stack + m, *stack);
+ break;
+ case DIV:
+ m = *(stack--);
+@@ -1405,46 +1405,46 @@
+ *stack = (n << SHIFT) / m;
+ else
+ *stack = (n >= 0) ? 0x7ffffff : -0x7ffffff;
+- debug("DIV %d %d = %d", m, n, *stack);
++ debug3("DIV %d %d = %d", m, n, *stack);
+ break;
+ case MUL:
+ m = *(stack--);
+ n = *stack;
+ *stack = (m * n + 32) >> SHIFT;
+- debug("MUL %d %d = %d", m, n, *stack);
++ debug3("MUL %d %d = %d", m, n, *stack);
+ break;
+ case ABS:
+ m = *stack;
+ if (m < 0) *stack = -m;
+- debug("ABS %d = %d", m, *stack);
++ debug2("ABS %d = %d", m, *stack);
+ break;
+ case NEG:
+ *stack = -*stack;
+- debug("NEG %d = %d", -*stack, *stack);
++ debug2("NEG %d = %d", -*stack, *stack);
+ break;
+ case FLOOR:
+ m = *stack;
+ *stack = m & -64;
+- debug("FLOOR %d = %d", m, *stack);
++ debug2("FLOOR %d = %d", m, *stack);
+ break;
+ case CEILING:
+ m = *stack;
+ *stack = (m + 63) & -64;
+- debug("CEILING %d = %d", m, *stack);
++ debug2("CEILING %d = %d", m, *stack);
+ break;
+ case MAX:
+ m = *(stack--);
+ n = *stack;
+ if (m > n)
+ *stack = m;
+- debug("MAX %d %d = %d", m, n, *stack);
++ debug3("MAX %d %d = %d", m, n, *stack);
+ break;
+ case MIN:
+ m = *(stack--);
+ n = *stack;
+ if (m < n)
+ *stack = m;
+- debug("MIN %d %d = %d", m, n, *stack);
++ debug3("MIN %d %d = %d", m, n, *stack);
+ break;
+ case ROUND00: case ROUND01:
+ case ROUND02: case ROUND03:
+@@ -1452,7 +1452,7 @@
+ m = *stack;
+ // XXX: ignore black/gray/white for now
+ *stack = round(m);
+- debug("#ROUND%02X %d = %d", opc & 3, m, *stack);
++ debug3("#ROUND%02X %d = %d", opc & 3, m, *stack);
+ break;
+ case NROUND00: case NROUND01:
+ case NROUND02: case NROUND03:
+@@ -1460,11 +1460,11 @@
+ m = *stack;
+ // XXX: ignore black/gray/white for now
+ *stack = m;
+- debug("#NROUND%02X %d = %d", opc & 3, m, *stack);
++ debug3("#NROUND%02X %d = %d", opc & 3, m, *stack);
+ break;
+ case FDEF:
+ m = *(stack--);
+- debug("FDEF %d", m);
++ debug1("FDEF %d", m);
+ assert(m >= 0 && m < sizeFDefs);
+ fdefs[m].f = f;
+ fdefs[m].offset = f->tell();
+@@ -1476,7 +1476,7 @@
+ return;
+ case IDEF:
+ m = *(stack--);
+- debug("IDEF %02X", m);
++ debug1("IDEF %02X", m);
+ assert(m >= 0 && m < sizeIDefs);
+ idefs[m].f = f;
+ idefs[m].offset = f->tell();
+@@ -1486,7 +1486,7 @@
+ case CALL:
+ {
+ m = *(stack--);
+- debug("CALL %d\n", m);
++ debug1("CALL %d\n", m);
+ assert(m >= 0 && m < sizeFDefs);
+
+ int ofs = f->tell();
+@@ -1500,7 +1500,7 @@
+ {
+ m = *(stack--);
+ n = *(stack--);
+- debug("LOOPCALL %d * %d\n", m, n);
++ debug2("LOOPCALL %d * %d\n", m, n);
+
+ int ofs = f->tell();
+ FDefs* fd = &fdefs[m];
+@@ -1524,19 +1524,19 @@
+ if (m & GLYPH_STRETCHED)
+ if (xx != yy)
+ *stack |= IS_STRETCHED;
+- debug("GETINFO %d = 0x%03X", m, *stack);
++ debug2("GETINFO %d = 0x%03X", m, *stack);
+ break;
+ default:
+ {
+ int ofs = f->tell();
+ IDefs* idef = &idefs[opc];
+- debug("IDEF_CALL 0x%02X, ofs = %05X, len = %d\n",
++ debug3("IDEF_CALL 0x%02X, ofs = %05X, len = %d\n",
+ opc, idef->offset, idef->length);
+
+ if (idef->length) // Thanks Colin McCormack
+ execHints(idef->f, idef->offset, idef->length);
+ else
+- debug("illegal instruction %02X\n", opc);
++ debug1("illegal instruction %02X\n", opc);
+ f->seekAbsolute(ofs);
+ }
+
+@@ -1578,7 +1578,7 @@
+ debug("\nskipping...");
+ for (int depth = 0;;) {
+ int opc = f->readUByte();
+- debug(" %02X ", opc);
++ debug1(" %02X ", opc);
+ switch (opc) {
+ case NPUSHB:
+ opc = f->readUByte() + PUSHB00 - 1;
+@@ -1642,7 +1642,7 @@
+ dist = MULDIV(doldp1, dnew21, dold21) - dnewp1;
+ }
+
+- debug("\nmove by %f", dist / FSHIFT);
++ debug1("\nmove by %f", dist / FSHIFT);
+ gs.movePoint(pp, dist);
+ }
+
+@@ -1653,11 +1653,11 @@
+ int dold21 = p2->yold - p1->yold;
+ int doldp1 = pp->yold - p1->yold;
+
+- debug("\np[%d] between p[%d] and p[%d]", pp - p[1], p1 - p[1],
++ debug3("\np[%d] between p[%d] and p[%d]", pp - p[1], p1 - p[1],
+ p2 - p[1]);
+- debug("\nd21o dp1o %f %f", dold21 / FSHIFT, doldp1 / FSHIFT);
++ debug2("\nd21o dp1o %f %f", dold21 / FSHIFT, doldp1 / FSHIFT);
+
+- debug("\tchanging y: %d %d", pp->xnow, pp->ynow);
++ debug2("\tchanging y: %d %d", pp->xnow, pp->ynow);
+
+ if ((dold21 ^ doldp1) < 0 || doldp1 == 0)
+ pp->ynow = pp->yold + p1->ynow - p1->yold;
+@@ -1666,11 +1666,11 @@
+ pp->ynow = pp->yold + p2->ynow - p2->yold;
+ else {
+ int dnew21 = p2->ynow - p1->ynow;
+- debug("\nd21n %8.3f", dnew21 / FSHIFT);
++ debug1("\nd21n %8.3f", dnew21 / FSHIFT);
+ pp->ynow = MULDIV(doldp1 + 1, dnew21, dold21) + p1->ynow;
+ }
+
+- debug(" -> %d %d\n", pp->xnow, pp->ynow);
++ debug2(" -> %d %d\n", pp->xnow, pp->ynow);
+ }
+
+
+@@ -1680,11 +1680,11 @@
+ int dold21 = p2->xold - p1->xold;
+ int doldp1 = pp->xold - p1->xold;
+
+- debug("\np[%d] between p[%d] and p[%d]", pp - p[1], p1 - p[1],
++ debug3("\np[%d] between p[%d] and p[%d]", pp - p[1], p1 - p[1],
+ p2 - p[1]);
+- debug("\nd21o dp1o %f %f", dold21 / FSHIFT, doldp1 / FSHIFT);
++ debug2("\nd21o dp1o %f %f", dold21 / FSHIFT, doldp1 / FSHIFT);
+
+- debug("\nchanging x: %d %d", pp->xnow, pp->ynow);
++ debug2("\nchanging x: %d %d", pp->xnow, pp->ynow);
+
+ if ((dold21 ^ doldp1) < 0 || doldp1 == 0)
+ pp->xnow = pp->xold + p1->xnow - p1->xold;
+@@ -1693,11 +1693,11 @@
+ pp->xnow = pp->xold + p2->xnow - p2->xold;
+ else {
+ int dnew21 = p2->xnow - p1->xnow;
+- debug("\t(d21n %8.3f)", dnew21 / FSHIFT);
++ debug1("\t(d21n %8.3f)", dnew21 / FSHIFT);
+ pp->xnow = MULDIV(doldp1 + 1, dnew21, dold21) + p1->xnow;
+ }
+
+- debug(" -> %d %d\n", pp->xnow, pp->ynow);
++ debug2(" -> %d %d\n", pp->xnow, pp->ynow);
+ }
+
+
diff --git a/x11/xfstt/patches/patch-aj b/x11/xfstt/patches/patch-aj
new file mode 100644
index 00000000000..e28ef8cc321
--- /dev/null
+++ b/x11/xfstt/patches/patch-aj
@@ -0,0 +1,126 @@
+$NetBSD: patch-aj,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/raster_scale.cc.orig Sat Feb 14 22:41:45 2004
++++ libfstt/raster_scale.cc Sat Feb 14 22:48:38 2004
+@@ -102,8 +102,8 @@
+ void
+ Rasterizer::setPointSize(int _xx, int _xy, int _yx, int _yy, int xres, int yres)
+ {
+- debug("_xx = %d,\t_xy = %d\n", _xx, _xy);
+- debug("_yx = %d,\t_yy = %d\n", _xy, _yy);
++ debug2("_xx = %d,\t_xy = %d\n", _xx, _xy);
++ debug2("_yx = %d,\t_yy = %d\n", _xy, _yy);
+
+ if (!(_xx | _xy) || !(_yx | _yy))
+ _xx = _yy = 12;
+@@ -135,9 +135,9 @@
+ xx >>= 1; xy >>= 1;
+ yx >>= 1; yy >>= 1;
+ }
+- debug("xx = %d, xy = %d\n", xx, xy);
+- debug("yx = %d, yy = %d\n", yx, yy);
+- debug("exp = %d\n", xxexp);
++ debug2("xx = %d, xy = %d\n", xx, xy);
++ debug2("yx = %d, yy = %d\n", yx, yy);
++ debug1("exp = %d\n", xxexp);
+
+ if (ttFont)
+ applyTransformation();
+@@ -153,7 +153,7 @@
+ Rasterizer::applyTransformation()
+ {
+ int emUnits = ttFont->getEmUnits();
+- debug("emUnits = %d\n", emUnits);
++ debug1("emUnits = %d\n", emUnits);
+
+ for (; emUnits > 2048 && xxexp > 0; --xxexp)
+ emUnits >>= 1;
+@@ -168,11 +168,11 @@
+
+ mppem = (mppemx + mppemy) >> 1;
+
+- debug("xx = %d, xy = %d\n", xx, xy);
+- debug("yx = %d, yy = %d\n", yx, yy);
+- debug("exp = %d\n", xxexp);
++ debug2("xx = %d, xy = %d\n", xx, xy);
++ debug2("yx = %d, yy = %d\n", yx, yy);
++ debug1("exp = %d\n", xxexp);
+
+- debug("mppem = %d, mppemx = %d, mppemy = %d\n", mppem, mppemx, mppemy);
++ debug3("mppem = %d, mppemx = %d, mppemy = %d\n", mppem, mppemx, mppemy);
+
+ if (grid_fitting)
+ calcCVT();
+@@ -265,7 +265,7 @@
+ int
+ Rasterizer::putChar8Bitmap(char c, U8 *bmp, U8 *endbmp, GlyphMetrics *gm)
+ {
+- debug("charNo8 = %d", c);
++ debug1("charNo8 = %d", c);
+ int glyphNo = ttFont->getGlyphNo8(c);
+ return putGlyphBitmap(glyphNo, bmp, endbmp, gm);
+ }
+@@ -275,7 +275,7 @@
+ Rasterizer::putChar16Bitmap(int c, U8 *bmp, U8 *endbmp, GlyphMetrics *gm)
+ {
+ int glyphNo = ttFont->getGlyphNo16(c);
+- debug("charNo16 = %d", c);
++ debug1("charNo16 = %d", c);
+ return putGlyphBitmap(glyphNo, bmp, endbmp, gm);
+ }
+
+@@ -283,7 +283,7 @@
+ int
+ Rasterizer::putGlyphBitmap(int glyphNo, U8 *bmp, U8 *endbmp, GlyphMetrics *gm)
+ {
+- debug("\n=============== glyphNo %d ==================\n", glyphNo);
++ debug1("\n=============== glyphNo %d ==================\n", glyphNo);
+
+ GlyphTable *g = ttFont->glyphTable;
+ g->setupGlyph(ttFont->points, ttFont->endPoints);
+@@ -374,8 +374,8 @@
+ gm->xAdvance = hdmx;
+ }
+
+- debug("width = %d, dX = %d, height = %d\n", width, dX, height);
+- debug("gn=%d, length= %d\n", glyphNo, length);
++ debug3("width = %d, dX = %d, height = %d\n", width, dX, height);
++ debug2("gn=%d, length= %d\n", glyphNo, length);
+
+ drawGlyph(bmp, endbmp);
+
+@@ -400,7 +400,7 @@
+ int val = xmin - lsb;
+ pp->xold = scaleX(val, 0);
+ pp->yold = scaleY(0, val);
+- debug("xmin = %d, adv = %d, lsb = %d\n", xmin, advanceWidth, lsb);
++ debug3("xmin = %d, adv = %d, lsb = %d\n", xmin, advanceWidth, lsb);
+ pp->xnow = (pp->xold + 32) & -64;
+ pp->ynow = (pp->yold + 32) & -64;
+ #if 0
+@@ -408,7 +408,7 @@
+ val = pp->xnow = pp->ynow = 0;
+ pp->xold = pp->yold = 0;
+ #endif
+- debug("phantom[0] = %5d -> %5d -> %5d\n", val, pp->xold, pp->xnow);
++ debug3("phantom[0] = %5d -> %5d -> %5d\n", val, pp->xold, pp->xnow);
+
+ // prepare phantom point 1
+ val += advanceWidth;
+@@ -456,12 +456,12 @@
+ debug("\n=== grid fitted outline ===\n");
+ point *pp = p[1];
+ for (int i = 0, j = 0; i < nPoints[1] + 2; ++i, ++pp) {
+- debug("p[%d]\t%6d %6d ", i, pp->xold, pp->yold);
+- debug("-> %6d %6d", pp->xnow, pp->ynow);
+- debug(" %d%d", (pp->flags & X_TOUCHED) != 0,
++ debug3("p[%d]\t%6d %6d ", i, pp->xold, pp->yold);
++ debug2("-> %6d %6d", pp->xnow, pp->ynow);
++ debug2(" %d%d", (pp->flags & X_TOUCHED) != 0,
+ (pp->flags & Y_TOUCHED) != 0);
+
+- debug(" %c", (pp->flags & ON_CURVE) ? '*' : ' ');
++ debug1(" %c", (pp->flags & ON_CURVE) ? '*' : ' ');
+
+ #ifdef WIN32
+ debug(" (%6d %6d)", pp->xgoal, pp->ygoal);
diff --git a/x11/xfstt/patches/patch-ak b/x11/xfstt/patches/patch-ak
new file mode 100644
index 00000000000..fd7b089ac75
--- /dev/null
+++ b/x11/xfstt/patches/patch-ak
@@ -0,0 +1,40 @@
+$NetBSD: patch-ak,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_cmap.cc.orig Sat Feb 14 22:49:01 2004
++++ libfstt/table_cmap.cc Sat Feb 14 22:49:28 2004
+@@ -76,7 +76,7 @@
+ case -1: // no encoding tables
+ break;
+ default: // unknown table format
+- debug("CMAP table format = %d\n", format);
++ debug1("CMAP table format = %d\n", format);
+ break;
+ }
+ }
+@@ -97,7 +97,7 @@
+ return 0;
+ seekAbsolute(subtableOffset + 6 + unicode);
+ int glyphNo = readUByte();
+- debug("MAC.cmap[%d] = %d\n", unicode, glyphNo);
++ debug2("MAC.cmap[%d] = %d\n", unicode, glyphNo);
+ return glyphNo;
+ } else if (format == TRIMMED_MAPPING) {
+ if ((unicode < f6FirstCode)
+@@ -200,7 +200,7 @@
+
+ seekAbsolute(subtableOffset + 16 + (f4NSegments << 1));
+ U16 i = readUShort();
+- debug("First Unicode = %d\n", i);
++ debug1("First Unicode = %d\n", i);
+ return i;
+ }
+
+@@ -216,7 +216,7 @@
+
+ seekAbsolute(subtableOffset + 14 + ((f4NSegments - 2) << 1));
+ U16 i = readUShort();
+- debug("Last Unicode = %d\n", i);
++ debug1("Last Unicode = %d\n", i);
+ return i;
+ }
+
diff --git a/x11/xfstt/patches/patch-al b/x11/xfstt/patches/patch-al
new file mode 100644
index 00000000000..ab7d81156a0
--- /dev/null
+++ b/x11/xfstt/patches/patch-al
@@ -0,0 +1,22 @@
+$NetBSD: patch-al,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_ebdt.cc.orig Sat Feb 14 22:50:02 2004
++++ libfstt/table_ebdt.cc Sat Feb 14 22:50:21 2004
+@@ -52,7 +52,7 @@
+ case 3: // obsolete
+ case 4: // unsupported
+ default:
+- debug("EBDT table bitmap format = %d\n", format);
++ debug1("EBDT table bitmap format = %d\n", format);
+ return -1;
+ case 5: // metrics in EBLC instead
+ debug("EBDT table bitmap format = 5\n");
+@@ -102,7 +102,7 @@
+ }
+ case 8:
+ case 9: // composite bitmap
+- debug("EBDT table bitmap format = %d\n", format);
++ debug1("EBDT table bitmap format = %d\n", format);
+ break;
+ }
+
diff --git a/x11/xfstt/patches/patch-am b/x11/xfstt/patches/patch-am
new file mode 100644
index 00000000000..6a9f9d7cb36
--- /dev/null
+++ b/x11/xfstt/patches/patch-am
@@ -0,0 +1,69 @@
+$NetBSD: patch-am,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_eblc.cc.orig Sat Feb 14 22:50:50 2004
++++ libfstt/table_eblc.cc Sat Feb 14 22:52:29 2004
+@@ -76,7 +76,7 @@
+ /* bitDepth = */ readUByte(); // should be 1
+ int flags = readSByte(); // 1 hmetric, 2 vmetric
+
+- debug("EBLC\nglyph(%3d - %3d), size(%2d, %2d), flags %d\n",
++ debug5("EBLC\nglyph(%3d - %3d), size(%2d, %2d), flags %d\n",
+ startGlyph, endGlyph, ppemx, ppemy, flags);
+
+ int ofs = tell();
+@@ -92,7 +92,7 @@
+ int firstGlyph = readUShort();
+ int lastGlyph = readUShort();
+ int addOffset = readUInt();
+- debug("SubTable glyphs %3d - %3d, addofs 0x%04X\n",
++ debug3("SubTable glyphs %3d - %3d, addofs 0x%04X\n",
+ firstGlyph, lastGlyph, addOffset);
+ int ofs = tell();
+ seekAbsolute(ofsSTA + addOffset);
+@@ -107,37 +107,37 @@
+ int imgFormat = readUShort();
+ int imageOffset = readUInt();
+
+- debug("idxfmt %d, imgfmt %d, imgofs 0x%05X\n",
++ debug3("idxfmt %d, imgfmt %d, imgofs 0x%05X\n",
+ idxFormat, imgFormat, imageOffset);
+
+ int i;
+ switch (idxFormat) {
+ case 1:
+ for (i = first; i <= last; ++i)
+- debug("ofs%02X = %04X\n", i, readUInt());
++ debug2("ofs%02X = %04X\n", i, readUInt());
+ break;
+ case 2:
+- debug("imgsize %d\n", readUInt());
++ debug1("imgsize %d\n", readUInt());
+ debug("bigGlyphMetrics\n");
+ break;
+ case 3:
+ for (i = first; i <= last; ++i)
+- debug("ofs%04X = %04X\n", i, readUShort());
++ debug2("ofs%04X = %04X\n", i, readUShort());
+ break;
+ case 4:
+ i = readUInt();
+- debug("numGlyphs %d\n", i);
++ debug1("numGlyphs %d\n", i);
+ while (--i >= 0)
+- debug("ofs%04X = %04X\n", readUShort(), readUShort());
++ debug2("ofs%04X = %04X\n", readUShort(), readUShort());
+ break;
+ case 5:
+- debug("imgsize %d\n", readUInt());
++ debug1("imgsize %d\n", readUInt());
+ debug("bigGlyphMetrics\n");
+ seekRelative(8);
+ i = readUInt();
+- debug("numGlyphs %d\n", i);
++ debug1("numGlyphs %d\n", i);
+ while (--i >= 0)
+- debug("ofs%04X = %04X\n", readUShort(), readUShort());
++ debug2("ofs%04X = %04X\n", readUShort(), readUShort());
+ break;
+ default:
+ debug("Illegal index format!\n");
diff --git a/x11/xfstt/patches/patch-an b/x11/xfstt/patches/patch-an
new file mode 100644
index 00000000000..bdcca8e70b4
--- /dev/null
+++ b/x11/xfstt/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_gasp.cc.orig Sat Feb 14 22:55:38 2004
++++ libfstt/table_gasp.cc Sat Feb 14 22:55:52 2004
+@@ -44,7 +44,7 @@
+ break;
+ }
+
+- debug("gasp::getFlags(mppem = %d) = 0x%02X\n", mppem, flags);
++ debug2("gasp::getFlags(mppem = %d) = 0x%02X\n", mppem, flags);
+
+ return flags;
+ }
diff --git a/x11/xfstt/patches/patch-ao b/x11/xfstt/patches/patch-ao
new file mode 100644
index 00000000000..29871ea57fd
--- /dev/null
+++ b/x11/xfstt/patches/patch-ao
@@ -0,0 +1,13 @@
+$NetBSD: patch-ao,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_glyf.cc.orig Sat Feb 14 22:56:09 2004
++++ libfstt/table_glyf.cc Sat Feb 14 22:56:19 2004
+@@ -219,7 +219,7 @@
+ codeLength = readUShort();
+ codeOffset = tell();
+ seekRelative(codeLength);
+- debug("Composite Hints: ofs %05X, len %d\n",
++ debug2("Composite Hints: ofs %05X, len %d\n",
+ codeOffset, codeLength);
+ } else
+ codeLength = 0;
diff --git a/x11/xfstt/patches/patch-ap b/x11/xfstt/patches/patch-ap
new file mode 100644
index 00000000000..b43103538a4
--- /dev/null
+++ b/x11/xfstt/patches/patch-ap
@@ -0,0 +1,40 @@
+$NetBSD: patch-ap,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_hdmx.cc.orig Sat Feb 14 22:56:47 2004
++++ libfstt/table_hdmx.cc Sat Feb 14 22:57:11 2004
+@@ -36,7 +36,7 @@
+ int
+ HdmxTable::getMaxWidth(int mppemx)
+ {
+- debug("hdmx(mppemx = %d) ", mppemx);
++ debug1("hdmx(mppemx = %d) ", mppemx);
+
+ seekAbsolute(8);
+ // XXX: is it possible to avoid the linear search?
+@@ -47,7 +47,7 @@
+ int maxWidth = readUByte();
+ if (ppem > mppemx)
+ debug("<");
+- debug("= %d\n", maxWidth);
++ debug1("= %d\n", maxWidth);
+
+ return maxWidth;
+ }
+@@ -61,7 +61,7 @@
+ int
+ HdmxTable::getGlyphWidth(int mppemx, int glyphNo)
+ {
+- debug("hdmx(mppemx = %d, glyphNo = %d)", mppemx, glyphNo);
++ debug2("hdmx(mppemx = %d, glyphNo = %d)", mppemx, glyphNo);
+
+ seekAbsolute(8);
+ // XXX: is it possible to avoid the linear search?
+@@ -78,7 +78,7 @@
+
+ seekRelative(glyphNo + 1);
+ int width = readUByte();
+- debug(" = %d\n", width);
++ debug1(" = %d\n", width);
+
+ return width;
+ }
diff --git a/x11/xfstt/patches/patch-aq b/x11/xfstt/patches/patch-aq
new file mode 100644
index 00000000000..1947902b9ea
--- /dev/null
+++ b/x11/xfstt/patches/patch-aq
@@ -0,0 +1,12 @@
+$NetBSD: patch-aq,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_hmtx.cc.orig Sat Feb 14 22:57:32 2004
++++ libfstt/table_hmtx.cc Sat Feb 14 22:57:41 2004
+@@ -41,6 +41,6 @@
+ *advWidth = readUShort();
+ }
+ *lsdBear = readSShort();
+- debug("hmtx(%d) = {%d, %d}\n", glyphNo, *advWidth, *lsdBear);
++ debug3("hmtx(%d) = {%d, %d}\n", glyphNo, *advWidth, *lsdBear);
+ }
+
diff --git a/x11/xfstt/patches/patch-ar b/x11/xfstt/patches/patch-ar
new file mode 100644
index 00000000000..21b384986ec
--- /dev/null
+++ b/x11/xfstt/patches/patch-ar
@@ -0,0 +1,13 @@
+$NetBSD: patch-ar,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/table_ltsh.cc.orig Sat Feb 14 22:58:03 2004
++++ libfstt/table_ltsh.cc Sat Feb 14 22:58:12 2004
+@@ -39,7 +39,7 @@
+ seekAbsolute(4 + glyphNo);
+
+ int yPel = readUByte();
+- debug("ltsh::getThreshold(glyphNo = %d) = %d\n", glyphNo, yPel);
++ debug2("ltsh::getThreshold(glyphNo = %d) = %d\n", glyphNo, yPel);
+
+ return yPel;
+ }
diff --git a/x11/xfstt/patches/patch-as b/x11/xfstt/patches/patch-as
new file mode 100644
index 00000000000..60b33a34f87
--- /dev/null
+++ b/x11/xfstt/patches/patch-as
@@ -0,0 +1,28 @@
+$NetBSD: patch-as,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/ttf.h.orig Sat Feb 14 22:04:00 2004
++++ libfstt/ttf.h Sat Feb 14 22:55:14 2004
+@@ -49,10 +49,21 @@
+ #endif
+
+ #ifndef DEBUG
+-# define debug(format, ...)
++# define debug(format)
++# define debug1(format, X1)
++# define debug2(format, X1, X2)
++# define debug3(format, X1, X2, X3)
++# define debug4(format, X1, X2, X3, X4)
++# define debug5(format, X1, X2, X3, X4, X5)
+ # define STATIC static
+ #else
+-# define debug(format, ...) fprintf(outfile, format, ##__VA_ARGS__)
++# define debug(format) fprintf(outfile, format)
++# define debug1(format, X1) fprintf(outfile, format, X1)
++# define debug2(format, X1, X2) fprintf(outfile, format, X1, X2)
++# define debug3(format, X1, X2, X3) fprintf(outfile, format, X1, X2, X3)
++# define debug4(format, X1, X2, X3, X4) fprintf(outfile, format, X1, X2, X3, X4)
++# define debug5(format, X1, X2, X3, X4, X5) fprintf(outfile, format, X1, X2, X3, X4, X5)
++# defube debug4(
+ # define STATIC
+ #endif
+
diff --git a/x11/xfstt/patches/patch-at b/x11/xfstt/patches/patch-at
new file mode 100644
index 00000000000..e9be7e93ef4
--- /dev/null
+++ b/x11/xfstt/patches/patch-at
@@ -0,0 +1,86 @@
+$NetBSD: patch-at,v 1.1 2004/02/14 22:27:30 kristerw Exp $
+
+--- libfstt/ttfont.cc.orig Thu Aug 7 08:20:44 2003
++++ libfstt/ttfont.cc Sat Feb 14 23:17:22 2004
+@@ -37,7 +37,7 @@
+ ebdtTable(0), eblcTable(0),
+ mortTable(0), vheaTable(0)
+ {
+- debug("TTFont(\"%s\");\n", fileName);
++ debug1("TTFont(\"%s\");\n", fileName);
+
+ if (openError())
+ return;
+@@ -296,7 +296,7 @@
+ maxWidth = headTable->xmax - headTable->xmin;
+ maxWidth += headTable->emUnits >> 5; // +3%
+ maxWidth = maxWidth * mppemx / headTable->emUnits;
+- debug("using maxWidth %d instead\n", maxWidth);
++ debug1("using maxWidth %d instead\n", maxWidth);
+ }
+
+ return maxWidth;
+@@ -317,7 +317,7 @@
+ // XXX: width = getMaxWidth(mppemx):
+ width += headTable->emUnits >> 5; // +3%
+ width = width * mppemx / headTable->emUnits;
+- debug("using width %d instead\n", width);
++ debug1("using width %d instead\n", width);
+ }
+
+ return width;
+@@ -352,7 +352,7 @@
+ U8 *headTable = 0;
+ int nTables = (buf[4] << 8) + buf[5];
+
+- debug("nTables = %d\n", nTables);
++ debug1("nTables = %d\n", nTables);
+
+ for (int i = 0; i < nTables; ++i) {
+ U8 *b = &buf[12 + i * 16];
+@@ -361,24 +361,24 @@
+ int length = (b[12] << 24) + (b[13] << 16) + (b[14] << 8) + b[15];
+ int check = checksum(buf + offset, length);
+
+- debug("offset = %08X, length = %08X\n", offset, length);
++ debug2("offset = %08X, length = %08X\n", offset, length);
+
+ b[4] = (U8)(check >> 24);
+ b[5] = (U8)(check >> 16);
+ b[6] = (U8)(check >> 8);
+ b[7] = (U8)check;
+
+- debug("checksum[%d] = %08X\n", i, check);
++ debug2("checksum[%d] = %08X\n", i, check);
+
+ if (name == 0x68656164) {
+ headTable = buf + offset;
+- debug("headOffset = %08X\n", offset);
++ debug1("headOffset = %08X\n", offset);
+ }
+ }
+
+ int check = checksum(buf, getLength()) - 0xB1B0AFBA;
+
+- debug("csAdjust = %08X\n", check);
++ debug1("csAdjust = %08X\n", check);
+
+ headTable[8] = (U8)(check >> 24);
+ headTable[9] = (U8)(check >> 16);
+@@ -458,14 +458,14 @@
+ xlfd += "-normal-" + strSubFamily + '-';
+
+ for (i = xlfd.begin(); i < xlfd.end(); i++)
+- *i = std::tolower(*i);
++ *i = tolower(*i);
+
+ if (p_strFamily)
+ delete p_strFamily;
+ if (p_strSubFamily)
+ delete p_strSubFamily;
+
+- debug("xlfd = \"%s\"\n", xlfd.c_str());
++ debug1("xlfd = \"%s\"\n", xlfd.c_str());
+
+ return xlfd;
+ }