diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 15:13:44 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 15:13:44 -0400 |
commit | d50de26430c1a114a22597de40a3e5ac3c8e1ab7 (patch) | |
tree | b0875e1308bd70baba95661daf70ae83538eddca /src | |
parent | 3fd7a510b5467479d6e2559819b96b222c7328e8 (diff) |
Dead code cull from Speedo.
Diffstat (limited to 'src')
-rw-r--r-- | src/Speedo/do_char.c | 207 | ||||
-rw-r--r-- | src/Speedo/do_trns.c | 14 | ||||
-rw-r--r-- | src/Speedo/out_scrn.c | 172 | ||||
-rw-r--r-- | src/Speedo/out_util.c | 196 | ||||
-rw-r--r-- | src/Speedo/reset.c | 2 | ||||
-rw-r--r-- | src/Speedo/set_spcs.c | 10 | ||||
-rw-r--r-- | src/Speedo/set_trns.c | 234 | ||||
-rw-r--r-- | src/Speedo/spdo_prv.h | 161 | ||||
-rw-r--r-- | src/Speedo/speedo.h | 16 | ||||
-rw-r--r-- | src/Speedo/spglyph.c | 2 | ||||
-rw-r--r-- | src/Speedo/spint.h | 2 |
11 files changed, 247 insertions, 769 deletions
diff --git a/src/Speedo/do_char.c b/src/Speedo/do_char.c index 410d633..076b413 100644 --- a/src/Speedo/do_char.c +++ b/src/Speedo/do_char.c @@ -63,35 +63,6 @@ static fix15 sp_get_posn_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 static fix15 sp_get_scale_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format); -FUNCTION ufix16 get_char_id( -GDECL -ufix16 char_index) /* Index to character in char directory */ -/* - * Returns character id for specified character index in currently - * selected font. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 12 and returns 0 if character data not available. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return (ufix16)0; /* Return zero character id */ - } - -pointer = sp_get_char_org(char_index, TRUE); /* Get pointer to character data */ -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return (ufix16)0; /* Return zero character id */ - } - -return 0xffff & NEXT_WORD(pointer); /* Return character id */ -} - - #if INCL_METRICS FUNCTION fix31 get_char_width( GDECL @@ -125,184 +96,6 @@ set_width = ((set_width << 16) + (sp_globals.metric_resolution >> 1)) / sp_globa return set_width; /* Return in 1/65536 em units */ } #endif - -#if INCL_METRICS -FUNCTION fix15 get_track_kern( -GDECL -fix15 track, /* Track required (0 - 3) */ -fix15 point_size) /* Point size (units of whole points) */ -/* - * Returns inter-character spacing adjustment in units of 1/256 - * points for the specified kerning track and point size. - * If the specified point size is larger than the maximum point - * size for the specified track, the adjustment for the maximum - * point size is used. - * If the specified point size is smaller than the minimum point - * size for the specified track, the adjustment for the minimum - * point size is used. - * If the specified point size is between the minimum point size - * and the maximum point size for the specified track, the - * adjustment is interpolated linearly between the minimum and - * maximum adjustments. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 13 and returns 0 if track kerning data not in font. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -fix15 no_tracks; /* Number of kerning tracks in font */ -ufix8 format; /* Track kerning format byte */ -fix15 i; /* Track counter */ -fix15 min_pt_size = 0; /* Minimum point size for track */ -fix15 max_pt_size = 0; /* Maximum point size for track */ -fix15 min_adj = 0; /* Adjustment for min point size */ -fix15 max_adj = 0; /* Adjustment for max point size */ -fix31 delta_pt_size; /* Max point size - min point size */ -fix31 delta_adj; /* Min adjustment - max adjustment */ -fix15 adj = 0; /* Interpolated adjustment */ - -if (track == 0) /* Track zero selected? */ - { - return adj; /* Return zero track kerning adjustment */ - } - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return adj; /* Return zero track kerning adjustment */ - } - -no_tracks = sp_globals.kern.no_tracks; /* Number of kerning tracks */ -if (track > no_tracks) /* Required track not available? */ - { - report_error(13); /* Report track kerning data not avail */ - return adj; /* Return zero track kerning adjustment */ - } - -pointer = sp_globals.kern.tkorg; /* Point to start of track kern data */ -for (i = 0; i < track; i++) /* Read until track required is read */ - { - format = NEXT_BYTE(pointer); /* Read track kerning format byte */ - min_pt_size = (format & BIT0)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - min_adj = (format & BIT1)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - max_pt_size = (format & BIT2)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - max_adj = (format & BIT3)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - } - -if (point_size <= min_pt_size) /* Smaller than minimum point size? */ - { - return min_adj; /* Return minimum adjustment (1/256 points) */ - } - -if (point_size >= max_pt_size) /* Larger than maximum point size? */ - { - return max_adj; /* Return maximum adjustment (1/256 points) */ - } - -delta_pt_size = (fix31)(max_pt_size - min_pt_size); -delta_adj = (fix31)(min_adj - max_adj); -adj = (fix15)(min_adj - - (((fix31)(point_size - min_pt_size) * delta_adj + - (delta_pt_size >> 1)) / delta_pt_size)); -return adj; /* Return interpolated adjustment (1/256 points) */ -} -#endif - -#if INCL_METRICS -FUNCTION fix31 get_pair_kern( -GDECL -ufix16 char_index1, /* Index to first character in char directory */ -ufix16 char_index2) /* Index to second character in char directory */ -/* - * Returns inter-character spacing adjustment in units of 1/65536 em - * for the specified pair of characters. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 14 and returns 0 if pair kerning data not in font. - */ -{ -ufix8 FONTFAR *origin; /* Pointer to first kerning pair record */ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -ufix16 tmpufix16; /* Temporary workspace */ -fix15 no_pairs; /* Number of kerning pairs in font */ -ufix8 format; /* Track kerning format byte */ -boolean long_id; /* TRUE if 2-byte character ids */ -fix15 rec_size; /* Number of bytes in kern pair record */ -fix15 n; /* Number of remaining kern pairs */ -fix15 nn; /* Number of kern pairs in first partition */ -fix15 base; /* Index to first record in rem kern pairs */ -fix15 i; /* Index to kern pair being tested */ -fix31 adj = 0; /* Returned value of adjustment */ -fix15 adj_base = 0; /* Adjustment base for relative adjustments */ - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return adj; /* Return zero pair kerning adjustment */ - } - -no_pairs = sp_globals.kern.no_pairs; /* Number of kerning pairs */ -if (no_pairs == 0) /* Pair kerning data not available? */ - { - report_error(14); /* Report pair kerning data not avail */ - return adj; /* Return zero pair kerning adjustment */ - } - -pointer = sp_globals.kern.pkorg; /* Point to start of pair kern data */ -format = NEXT_BYTE(pointer); /* Read pair kerning format byte */ -if (!(format & BIT0)) /* One-byte adjustment values? */ - adj_base = NEXT_WORD(pointer); /* Read base adjustment */ -origin = pointer; /* First byte of kerning pair data */ -rec_size = format + 3; /* Compute kerning pair record size */ -long_id = format & BIT1; /* Set flag for 2-byte char index */ - -n = no_pairs; /* Consider all kerning pairs */ -base = 0; /* Set base at first kern pair record */ -while (n != 0) /* While 1 or more kern pairs remain ... */ - { - nn = n >> 1; /* Size of first partition */ - i = base + nn; /* Index to record to be tested */ - pointer = origin + (i * rec_size); - tmpufix16 = NEXT_CHNDX(pointer, long_id); - if (char_index1 < tmpufix16) - { - n = nn; /* Number remaining in first partition */ - continue; - } - if (char_index1 > tmpufix16) - { - n -= nn + 1; /* Number remaining in second partition */ - base = i + 1; /* Base index for second partition */ - continue; - } - tmpufix16 = NEXT_CHNDX(pointer, long_id); - if (char_index2 < tmpufix16) - { - n = nn; /* Number remaining in first partition */ - continue; - } - if (char_index2 > tmpufix16) - { - n -= nn + 1; /* Number remaining in second partition */ - base = i + 1; /* Base index for second partition */ - continue; - } - adj = (format & BIT0)? - (fix31)NEXT_WORD(pointer): - (fix31)(adj_base + (fix15)NEXT_BYTE(pointer)); - adj = ((adj << 16) + (sp_globals.orus_per_em >> 1)) / sp_globals.orus_per_em; /* Convert units */ - n = 0; /* No more to consider */ - } -return adj; /* Return pair kerning adjustment */ -} -#endif - #if INCL_METRICS #ifdef old diff --git a/src/Speedo/do_trns.c b/src/Speedo/do_trns.c index 2e0f1db..95ab102 100644 --- a/src/Speedo/do_trns.c +++ b/src/Speedo/do_trns.c @@ -401,9 +401,7 @@ switch(format & 0x03) case 0: /* Index to controlled oru */ edge = NEXT_BYTE(pointer); sp_globals.x_orus = sp_plaid.orus[edge]; -#if INCL_RULES sp_globals.x_pix = sp_plaid.pix[edge]; -#endif break; case 1: /* 2 byte interpolated oru value */ @@ -413,9 +411,7 @@ case 1: /* 2 byte interpolated oru value */ case 2: /* 1 byte signed oru increment */ sp_globals.x_orus += (fix15)((fix7)NEXT_BYTE(pointer)); L1: -#if INCL_RULES sp_globals.x_pix = TRANS(sp_globals.x_orus, sp_plaid.mult[sp_globals.x_int], sp_plaid.offset[sp_globals.x_int], sp_globals.mpshift); -#endif break; default: /* No change in X value */ @@ -428,9 +424,7 @@ switch((format >> 2) & 0x03) case 0: /* Index to controlled oru */ edge = sp_globals.Y_edge_org + NEXT_BYTE(pointer); sp_globals.y_orus = sp_plaid.orus[edge]; -#if INCL_RULES sp_globals.y_pix = sp_plaid.pix[edge]; -#endif break; case 1: /* 2 byte interpolated oru value */ @@ -440,16 +434,13 @@ case 1: /* 2 byte interpolated oru value */ case 2: /* 1 byte signed oru increment */ sp_globals.y_orus += (fix15)((fix7)NEXT_BYTE(pointer)); L2: -#if INCL_RULES sp_globals.y_pix = TRANS(sp_globals.y_orus, sp_plaid.mult[sp_globals.y_int], sp_plaid.offset[sp_globals.y_int], sp_globals.mpshift); -#endif break; default: /* No change in X value */ break; } -#if INCL_RULES switch(sp_globals.tcb.xmode) { case 0: /* X mode 0 */ @@ -469,11 +460,9 @@ case 3: /* X mode 3 */ break; default: /* X mode 4 */ -#endif pP->x = (MULT16(sp_globals.x_orus, sp_globals.tcb.xxmult) + MULT16(sp_globals.y_orus, sp_globals.tcb.xymult) + sp_globals.tcb.xoffset) >> sp_globals.mpshift; -#if INCL_RULES break; } @@ -496,14 +485,11 @@ case 3: /* Y mode 3 */ break; default: /* Y mode 4 */ -#endif pP->y = (MULT16(sp_globals.x_orus, sp_globals.tcb.yxmult) + MULT16(sp_globals.y_orus, sp_globals.tcb.yymult) + sp_globals.tcb.yoffset) >> sp_globals.mpshift; -#if INCL_RULES break; } -#endif return pointer; } diff --git a/src/Speedo/out_scrn.c b/src/Speedo/out_scrn.c index 0ea3b19..172386a 100644 --- a/src/Speedo/out_scrn.c +++ b/src/Speedo/out_scrn.c @@ -129,64 +129,58 @@ sp_globals.y_pxl = (sp_globals.y0_spxl + sp_globals.pixrnd) >> sp_globals.pixshi #endif #if INCL_SCREEN -FUNCTION void curve_screen( + +static FUNCTION void vert_line_screen( GDECL -point_t P1, point_t P2, point_t P3, -fix15 depth) -{ -fix31 X0; -fix31 Y0; -fix31 X1; -fix31 Y1; -fix31 X2; -fix31 Y2; -fix31 X3; -fix31 Y3; -#if DEBUG -printf("CURVE_SCREEN(%6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, - (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, - (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix); +fix31 x, +fix15 y1, fix15 y2) +{ + +#ifdef DBGCRV +printf("VERT_LINE_SCREEN(%6.4f, %6.4f, %6.4f)\n", + (real)(x - 32768) / 65536.0, + (real)(y1 - 32768) / 65536.0, + (real)(y2 - 32768) / 65536.0); #endif +if (sp_globals.intercept_oflo) + return; -if (sp_globals.extents_running) /* Accumulate actual character extents if required */ - { - if (P3.x > sp_globals.bmap_xmax) - sp_globals.bmap_xmax = P3.x; - if (P3.x < sp_globals.bmap_xmin) - sp_globals.bmap_xmin = P3.x; - if (P3.y > sp_globals.bmap_ymax) - sp_globals.bmap_ymax = P3.y; - if (P3.y < sp_globals.bmap_ymin) - sp_globals.bmap_ymin = P3.y; - } +if (y1 > y2) /* Line goes downwards ? */ + { + if (y1 > (sp_globals.y_band.band_max + 1)) /* Start point above top of band? */ + y1 = sp_globals.y_band.band_max + 1; /* Adjust start point to top of band */ + if (y2 < sp_globals.y_band.band_min) /* End point below bottom of band? */ + y2 = sp_globals.y_band.band_min; /* Adjust end point bottom of band */ -X0 = ((fix31)sp_globals.x0_spxl << sp_globals.poshift) + (fix31)32768; -Y0 = ((fix31)sp_globals.y0_spxl << sp_globals.poshift) + (fix31)32768; -X1 = ((fix31)P1.x << sp_globals.poshift) + (fix31)32768; -Y1 = ((fix31)P1.y << sp_globals.poshift) + (fix31)32768; -X2 = ((fix31)P2.x << sp_globals.poshift) + (fix31)32768; -Y2 = ((fix31)P2.y << sp_globals.poshift) + (fix31)32768; -X3 = ((fix31)P3.x << sp_globals.poshift) + (fix31)32768; -Y3 = ((fix31)P3.y << sp_globals.poshift) + (fix31)32768; + y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ + y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ -if (((Y0 - Y3) * sp_globals.tcb.mirror) > 0) - { - sp_intercepts.leftedge = LEFT_INT; + while (y2 < y1) /* At least one intercept left? */ + { + sp_add_intercept_screen(--y1, x); /* Add intercept */ + } } -else +else if (y2 > y1) /* Line goes upwards ? */ { - sp_intercepts.leftedge = 0; + if (y1 < sp_globals.y_band.band_min) /* Start point below bottom of band? */ + y1 = sp_globals.y_band.band_min; /* Adjust start point to bottom of band */ + if (y2 > (sp_globals.y_band.band_max + 1)) /* End point above top of band? */ + y2 = sp_globals.y_band.band_max + 1; /* Adjust end point to top of band */ + + y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ + y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ + + while (y1 < y2) /* At least one intercept left? */ + { + sp_add_intercept_screen(y1++, x); /* Add intercept */ + } } -scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3); -sp_globals.x0_spxl = P3.x; -sp_globals.y0_spxl = P3.y; -sp_globals.y_pxl = (P3.y + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */ + } -FUNCTION void scan_curve_screen( +static FUNCTION void scan_curve_screen( GDECL fix31 X0, fix31 Y0, fix31 X1, fix31 Y1, fix31 X2, fix31 Y2, fix31 X3, fix31 Y3) /* Called for each curve in the transformed character if curves out enabled @@ -231,57 +225,63 @@ Pctrl2x = (X2 + X3 + 1 ) >> 1; Pctrl2y = (Y2 + Y3 + 1 ) >> 1; scan_curve_screen(Pmidx,Pmidy, Pctrl1x,Pctrl1y, Pctrl2x,Pctrl2y, X3,Y3); } - -FUNCTION void vert_line_screen( -GDECL -fix31 x, -fix15 y1, fix15 y2) -{ -#ifdef DBGCRV -printf("VERT_LINE_SCREEN(%6.4f, %6.4f, %6.4f)\n", - (real)(x - 32768) / 65536.0, - (real)(y1 - 32768) / 65536.0, - (real)(y2 - 32768) / 65536.0); +FUNCTION void curve_screen( +GDECL +point_t P1, point_t P2, point_t P3, +fix15 depth) +{ +fix31 X0; +fix31 Y0; +fix31 X1; +fix31 Y1; +fix31 X2; +fix31 Y2; +fix31 X3; +fix31 Y3; +#if DEBUG +printf("CURVE_SCREEN(%6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f)\n", + (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, + (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, + (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix); #endif -if (sp_globals.intercept_oflo) - return; -if (y1 > y2) /* Line goes downwards ? */ - { - if (y1 > (sp_globals.y_band.band_max + 1)) /* Start point above top of band? */ - y1 = sp_globals.y_band.band_max + 1; /* Adjust start point to top of band */ - if (y2 < sp_globals.y_band.band_min) /* End point below bottom of band? */ - y2 = sp_globals.y_band.band_min; /* Adjust end point bottom of band */ +if (sp_globals.extents_running) /* Accumulate actual character extents if required */ + { + if (P3.x > sp_globals.bmap_xmax) + sp_globals.bmap_xmax = P3.x; + if (P3.x < sp_globals.bmap_xmin) + sp_globals.bmap_xmin = P3.x; + if (P3.y > sp_globals.bmap_ymax) + sp_globals.bmap_ymax = P3.y; + if (P3.y < sp_globals.bmap_ymin) + sp_globals.bmap_ymin = P3.y; + } - y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ - y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ +X0 = ((fix31)sp_globals.x0_spxl << sp_globals.poshift) + (fix31)32768; +Y0 = ((fix31)sp_globals.y0_spxl << sp_globals.poshift) + (fix31)32768; +X1 = ((fix31)P1.x << sp_globals.poshift) + (fix31)32768; +Y1 = ((fix31)P1.y << sp_globals.poshift) + (fix31)32768; +X2 = ((fix31)P2.x << sp_globals.poshift) + (fix31)32768; +Y2 = ((fix31)P2.y << sp_globals.poshift) + (fix31)32768; +X3 = ((fix31)P3.x << sp_globals.poshift) + (fix31)32768; +Y3 = ((fix31)P3.y << sp_globals.poshift) + (fix31)32768; - while (y2 < y1) /* At least one intercept left? */ - { - sp_add_intercept_screen(--y1, x); /* Add intercept */ - } +if (((Y0 - Y3) * sp_globals.tcb.mirror) > 0) + { + sp_intercepts.leftedge = LEFT_INT; } -else if (y2 > y1) /* Line goes upwards ? */ +else { - if (y1 < sp_globals.y_band.band_min) /* Start point below bottom of band? */ - y1 = sp_globals.y_band.band_min; /* Adjust start point to bottom of band */ - if (y2 > (sp_globals.y_band.band_max + 1)) /* End point above top of band? */ - y2 = sp_globals.y_band.band_max + 1; /* Adjust end point to top of band */ - - y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ - y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ - - while (y1 < y2) /* At least one intercept left? */ - { - sp_add_intercept_screen(y1++, x); /* Add intercept */ - } + sp_intercepts.leftedge = 0; } - +scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3); +sp_globals.x0_spxl = P3.x; +sp_globals.y0_spxl = P3.y; +sp_globals.y_pxl = (P3.y + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */ } - #endif diff --git a/src/Speedo/out_util.c b/src/Speedo/out_util.c index 1712410..baf9427 100644 --- a/src/Speedo/out_util.c +++ b/src/Speedo/out_util.c @@ -40,7 +40,103 @@ WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. /* absolute value function */ #define ABS(X) ( (X < 0) ? -X : X) #if INCL_BLACK || INCL_2D || INCL_SCREEN - + +static FUNCTION void restart_intercepts_out(void) +GDECL +/* Called by sp_make_char when a new sub character is started + * Freezes current sorted lists + */ +{ +#if DEBUG +printf(" Restart intercepts:\n"); +#endif +sp_globals.first_offset = sp_globals.next_offset; +} + +static FUNCTION void set_first_band_out( +GDECL +point_t Pmin, +point_t Pmax) +{ + +sp_globals.ymin = Pmin.y; +sp_globals.ymax = Pmax.y; + +sp_globals.ymin = (sp_globals.ymin - sp_globals.onepix + 1) >> sp_globals.pixshift; +sp_globals.ymax = (sp_globals.ymax + sp_globals.onepix - 1) >> sp_globals.pixshift; + +#if INCL_CLIPPING + switch(sp_globals.tcb0.xtype) + { + case 1: /* 180 degree rotation */ + if (sp_globals.specs.flags & CLIP_TOP) + { + sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); + sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift; + sp_globals.clip_ymin = -1* sp_globals.clip_ymin; + if (sp_globals.ymin < sp_globals.clip_ymin) + sp_globals.ymin = sp_globals.clip_ymin; + } + if (sp_globals.specs.flags & CLIP_BOTTOM) + { + sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); + sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift; + if (sp_globals.ymax > sp_globals.clip_ymax) + sp_globals.ymax = sp_globals.clip_ymax; + } + break; + case 2: /* 90 degree rotation */ + sp_globals.clip_ymax = 0; + if ((sp_globals.specs.flags & CLIP_TOP) && + (sp_globals.ymax > sp_globals.clip_ymax)) + sp_globals.ymax = sp_globals.clip_ymax; + sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); + if ((sp_globals.specs.flags & CLIP_BOTTOM) && + (sp_globals.ymin < sp_globals.clip_ymin)) + sp_globals.ymin = sp_globals.clip_ymin; + break; + case 3: /* 270 degree rotation */ + sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); + if ((sp_globals.specs.flags & CLIP_TOP) && + (sp_globals.ymax > sp_globals.clip_ymax)) + sp_globals.ymax = sp_globals.clip_ymax; + sp_globals.clip_ymin = 0; + if ((sp_globals.specs.flags & CLIP_BOTTOM) && + (sp_globals.ymin < sp_globals.clip_ymin)) + sp_globals.ymin = sp_globals.clip_ymin; + break; + default: /* this is for zero degree rotation and arbitrary rotation */ + if (sp_globals.specs.flags & CLIP_TOP) + { + sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); + sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift; + if (sp_globals.ymax > sp_globals.clip_ymax) + sp_globals.ymax = sp_globals.clip_ymax; + } + if (sp_globals.specs.flags & CLIP_BOTTOM) + { + sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); + sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift; + sp_globals.clip_ymin = - sp_globals.clip_ymin; + if (sp_globals.ymin < sp_globals.clip_ymin) + sp_globals.ymin = sp_globals.clip_ymin; + } + break; + } +#endif +sp_globals.y_band.band_min = sp_globals.ymin; +sp_globals.y_band.band_max = sp_globals.ymax - 1; + +sp_globals.xmin = (Pmin.x + sp_globals.pixrnd) >> sp_globals.pixshift; +sp_globals.xmax = (Pmax.x + sp_globals.pixrnd) >> sp_globals.pixshift; + + +#if INCL_2D +sp_globals.x_band.band_min = sp_globals.xmin - 1; /* subtract one pixel of "safety margin" */ +sp_globals.x_band.band_max = sp_globals.xmax /* - 1 + 1 */; /* Add one pixel of "safety margin" */ +#endif +} + FUNCTION void init_char_out( GDECL point_t Psw, point_t Pmin, point_t Pmax) @@ -203,107 +299,9 @@ sp_intercepts.inttype[sp_globals.no_y_lists-1] = END_INT; } -FUNCTION void restart_intercepts_out() -GDECL - -/* Called by sp_make_char when a new sub character is started - * Freezes current sorted lists - */ - -{ - -#if DEBUG -printf(" Restart intercepts:\n"); -#endif -sp_globals.first_offset = sp_globals.next_offset; -} -FUNCTION void set_first_band_out( -GDECL -point_t Pmin, -point_t Pmax) -{ - -sp_globals.ymin = Pmin.y; -sp_globals.ymax = Pmax.y; - -sp_globals.ymin = (sp_globals.ymin - sp_globals.onepix + 1) >> sp_globals.pixshift; -sp_globals.ymax = (sp_globals.ymax + sp_globals.onepix - 1) >> sp_globals.pixshift; - -#if INCL_CLIPPING - switch(sp_globals.tcb0.xtype) - { - case 1: /* 180 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); - sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift; - sp_globals.clip_ymin = -1* sp_globals.clip_ymin; - if (sp_globals.ymin < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); - sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift; - if (sp_globals.ymax > sp_globals.clip_ymax) - sp_globals.ymax = sp_globals.clip_ymax; - } - break; - case 2: /* 90 degree rotation */ - sp_globals.clip_ymax = 0; - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - case 3: /* 270 degree rotation */ - sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = 0; - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - default: /* this is for zero degree rotation and arbitrary rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); - sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift; - if (sp_globals.ymax > sp_globals.clip_ymax) - sp_globals.ymax = sp_globals.clip_ymax; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2)); - sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift; - sp_globals.clip_ymin = - sp_globals.clip_ymin; - if (sp_globals.ymin < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - } - break; - } -#endif -sp_globals.y_band.band_min = sp_globals.ymin; -sp_globals.y_band.band_max = sp_globals.ymax - 1; - -sp_globals.xmin = (Pmin.x + sp_globals.pixrnd) >> sp_globals.pixshift; -sp_globals.xmax = (Pmax.x + sp_globals.pixrnd) >> sp_globals.pixshift; - - -#if INCL_2D -sp_globals.x_band.band_min = sp_globals.xmin - 1; /* subtract one pixel of "safety margin" */ -sp_globals.x_band.band_max = sp_globals.xmax /* - 1 + 1 */; /* Add one pixel of "safety margin" */ -#endif -} - diff --git a/src/Speedo/reset.c b/src/Speedo/reset.c index 4cb9f7d..2153494 100644 --- a/src/Speedo/reset.c +++ b/src/Speedo/reset.c @@ -74,9 +74,7 @@ sp_globals.key6 = KEY6; sp_globals.key7 = KEY7; sp_globals.key8 = KEY8; -#if INCL_RULES sp_globals.constr.font_id_valid = FALSE; -#endif #if INCL_MULTIDEV #if INCL_BLACK || INCL_SCREEN || INCL_2D diff --git a/src/Speedo/set_spcs.c b/src/Speedo/set_spcs.c index b69b13f..8fbdf1f 100644 --- a/src/Speedo/set_spcs.c +++ b/src/Speedo/set_spcs.c @@ -176,7 +176,6 @@ sp_globals.pchar_dir = sp_globals.font_org + offcd; sp_globals.first_char_idx = read_word_u(sp_globals.font_org + FH_FCHRF); /* Register font name with sp_globals.constraint mechanism */ -#if INCL_RULES font_id = read_word_u(sp_globals.font_org + FH_FNTID); if (!(sp_globals.constr.font_id_valid) || (sp_globals.constr.font_id != font_id)) { @@ -186,7 +185,6 @@ if (!(sp_globals.constr.font_id_valid) || (sp_globals.constr.font_id != font_id) } sp_globals.constr.org = sp_globals.font_org + ofcns; sp_globals.constr.active = ((sp_globals.pspecs->flags & CONSTR_OFF) == 0); -#endif /* Set up sliding point constants */ /* Set pixel shift to accomodate largest transformed pixel value */ @@ -292,14 +290,6 @@ if (sp_globals.pspecs->flags & BOGUS_MODE) /* Linear transformation requested? * { sp_globals.tcb0.xtype = sp_globals.tcb0.ytype = 4; } -else /* Intelligent transformation requested? */ - { -#if INCL_RULES -#else - report_error(7); /* Rules requested; not supported */ - return FALSE; -#endif - } if ((sp_globals.pspecs->flags & SQUEEZE_LEFT) || (sp_globals.pspecs->flags & SQUEEZE_RIGHT) || diff --git a/src/Speedo/set_trns.c b/src/Speedo/set_trns.c index 3b8f603..35c2e33 100644 --- a/src/Speedo/set_trns.c +++ b/src/Speedo/set_trns.c @@ -113,101 +113,80 @@ ptcb->yoffset = MULT16(yx_mult, x_pos) + MULT16(yy_mult, y_pos) + y_offset; type_tcb(ptcb); /* Reclassify transformation types */ } -FUNCTION ufix8 FONTFAR *skip_interpolation_table( + +static FUNCTION ufix8 FONTFAR *read_oru_table( GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ +ufix8 FONTFAR *pointer) /* Pointer to first byte in controlled coord table */ +/* + * Called by plaid_tcb() to read the controlled coordinate table from the + * character data in the font. + * Updates the pointer to the byte following the controlled coordinate + * data. + */ { -fix15 i,n; -ufix8 intsize[9]; - -intsize[0] = 1; -intsize[1] = 2; -intsize[2] = 3; -intsize[3] = 1; -intsize[4] = 2; -intsize[5] = 1; -intsize[6] = 2; -intsize[7] = 0; -intsize[8] = 0; - -n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0); -n += ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0); -for (i = 0; i < n; i++) /* For each entry in int table ... */ +fix15 i, j, k, n; +boolean zero_not_in; +boolean zero_added; +fix15 oru; + +fix15 pos; + +i = 0; +n = sp_globals.no_X_orus; +pos = sp_globals.tcb.xpos; +for (j = 0; ; j++) { - format = NEXT_BYTE(pointer); /* Read format byte */ - if (format & BIT7) /* Short Start/End point spec? */ + zero_not_in = TRUE; + zero_added = FALSE; + for (k = 0; k < n; k++) { - pointer++; /* Skip Start/End point byte */ + oru = NEXT_WORD(pointer); + if (zero_not_in && (oru >= 0)) /* First positive oru value? */ + { + sp_plaid.pix[i] = pos; /* Insert position in pix array */ + if (oru != 0) /* Zero oru value omitted? */ + { + sp_plaid.orus[i++] = 0; /* Insert zero value in oru array */ + zero_added = TRUE; /* Remember to increment size of array */ + } + zero_not_in = FALSE; /* Inhibit further testing for zero ins */ + } + sp_plaid.orus[i++] = oru; /* Add specified oru value to array */ } - else + if (zero_not_in) /* All specified oru values negative? */ { - pointer += intsize[format & 0x7]; /* Skip Start point spec */ - pointer += intsize[(format >> 3) & 0x7]; /* Skip End point spec */ + sp_plaid.pix[i] = pos; /* Insert position in pix array */ + sp_plaid.orus[i++] = 0; /* Add zero oru value */ + zero_added = TRUE; /* Remember to increment size of array */ } + if (j) /* Both X and Y orus read? */ + break; + if (zero_added) + sp_globals.no_X_orus++; /* Increment X array size */ + n = sp_globals.no_Y_orus; /* Prepare to read Y oru values */ + pos = sp_globals.tcb.ypos; } -return pointer; -} -FUNCTION ufix8 FONTFAR *skip_control_zone( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -{ -fix15 i,n; -ufix16 tmpufix16; +if (zero_added) /* Zero Y oru value added to array? */ + sp_globals.no_Y_orus++; /* Increment Y array size */ -n = sp_globals.no_X_orus + sp_globals.no_Y_orus - 2; -for (i = 0; i < n; i++) /* For each entry in control table ... */ +#if DEBUG +printf("\nX ORUS\n"); +n = sp_globals.no_X_orus; +for (i = 0; i < n; i++) { - if (format & BIT4) - pointer++; /* Skip short form From/To fields */ - else - pointer += 2; /* Skip FROM and TO fields */ - /* skip constraints field */ - NEXT_BYTES (pointer, tmpufix16); - + printf("%2d %4d\n", i, sp_plaid.orus[i]); } -return pointer; -} - -#if INCL_RULES -#else -FUNCTION ufix8 FONTFAR *plaid_tcb( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -/* - * Called by make_simp_char() and make_comp_char() to set up the controlled - * coordinate table and skip all other intelligent scaling rules embedded - * in the character data. - * Updates pointer to first byte after plaid data. - * This is used only if intelligent scaling is not supported in the - * configuration definitions. - */ -{ -fix15 i, n; - - - -sp_globals.no_X_orus = (format & BIT2)? - (fix15)NEXT_BYTE(pointer): - 0; -sp_globals.no_Y_orus = (format & BIT3)? - (fix15)NEXT_BYTE(pointer): - 0; -pointer = read_oru_table(pointer); /* Updates no_X/Y/orus */ -sp_globals.Y_edge_org = sp_globals.no_X_orus; - -/* Skip over control zone table */ -pointer = skip_control_zone(pointer,format); +printf("\nY ORUS\n"); +n = sp_globals.no_Y_orus; +for (i = 0; i < n; i++) + { + printf("%2d %4d\n", i, sp_plaid.orus[i + sp_globals.no_X_orus]); + } +#endif -/* Skip over interpolation table */ -pointer = skip_interpolation_table(pointer,format); -return pointer; +return pointer; /* Update pointer */ } -#endif - -#if INCL_RULES + FUNCTION ufix8 FONTFAR *plaid_tcb( GDECL ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ @@ -266,9 +245,7 @@ end_plaid_data(); return pointer; } -#endif - -#if INCL_RULES + FUNCTION static void sp_constr_update() GDECL /* @@ -437,90 +414,7 @@ for (i = 0; i < n; i++) #endif } -#endif -FUNCTION ufix8 FONTFAR *read_oru_table( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to first byte in controlled coord table */ -/* - * Called by plaid_tcb() to read the controlled coordinate table from the - * character data in the font. - * Updates the pointer to the byte following the controlled coordinate - * data. - */ -{ -fix15 i, j, k, n; -boolean zero_not_in; -boolean zero_added; -fix15 oru; - -#if INCL_RULES -fix15 pos; -#endif - -i = 0; -n = sp_globals.no_X_orus; -#if INCL_RULES -pos = sp_globals.tcb.xpos; -#endif -for (j = 0; ; j++) - { - zero_not_in = TRUE; - zero_added = FALSE; - for (k = 0; k < n; k++) - { - oru = NEXT_WORD(pointer); - if (zero_not_in && (oru >= 0)) /* First positive oru value? */ - { -#if INCL_RULES - sp_plaid.pix[i] = pos; /* Insert position in pix array */ -#endif - if (oru != 0) /* Zero oru value omitted? */ - { - sp_plaid.orus[i++] = 0; /* Insert zero value in oru array */ - zero_added = TRUE; /* Remember to increment size of array */ - } - zero_not_in = FALSE; /* Inhibit further testing for zero ins */ - } - sp_plaid.orus[i++] = oru; /* Add specified oru value to array */ - } - if (zero_not_in) /* All specified oru values negative? */ - { -#if INCL_RULES - sp_plaid.pix[i] = pos; /* Insert position in pix array */ -#endif - sp_plaid.orus[i++] = 0; /* Add zero oru value */ - zero_added = TRUE; /* Remember to increment size of array */ - } - if (j) /* Both X and Y orus read? */ - break; - if (zero_added) - sp_globals.no_X_orus++; /* Increment X array size */ - n = sp_globals.no_Y_orus; /* Prepare to read Y oru values */ -#if INCL_RULES - pos = sp_globals.tcb.ypos; -#endif - } -if (zero_added) /* Zero Y oru value added to array? */ - sp_globals.no_Y_orus++; /* Increment Y array size */ - -#if DEBUG -printf("\nX ORUS\n"); -n = sp_globals.no_X_orus; -for (i = 0; i < n; i++) - { - printf("%2d %4d\n", i, sp_plaid.orus[i]); - } -printf("\nY ORUS\n"); -n = sp_globals.no_Y_orus; -for (i = 0; i < n; i++) - { - printf("%2d %4d\n", i, sp_plaid.orus[i + sp_globals.no_X_orus]); - } -#endif - -return pointer; /* Update pointer */ -} #if INCL_SQUEEZING || INCL_ISW FUNCTION static void calculate_x_pix( GDECL @@ -921,7 +815,6 @@ return TRUE; } #endif -#if INCL_RULES FUNCTION static ufix8 FONTFAR *sp_setup_pix_table( GDECL ufix8 FONTFAR *pointer, /* Pointer to first byte in control zone table */ @@ -1149,10 +1042,8 @@ for (i = 0; i < n; i++) return pointer; } -#endif -#if INCL_RULES FUNCTION static ufix8 FONTFAR *sp_setup_int_table( GDECL ufix8 FONTFAR *pointer, /* Pointer to first byte in interpolation zone table */ @@ -1307,7 +1198,6 @@ for (i = 0; i < n; i++) return pointer; } -#endif #if INCL_ISW FUNCTION fix31 compute_isw_scale() GDECL diff --git a/src/Speedo/spdo_prv.h b/src/Speedo/spdo_prv.h index 162c0fd..2b3882c 100644 --- a/src/Speedo/spdo_prv.h +++ b/src/Speedo/spdo_prv.h @@ -110,8 +110,6 @@ WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. * *****************************************************************************/ -#if STATIC_ALLOC || DYNAMIC_ALLOC - #define GDECL #define get_char_id(char_index) sp_get_char_id(char_index) @@ -184,7 +182,7 @@ WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. #define end_contour_out() sp_end_contour_out() #define end_sub_char_out() sp_end_sub_char_out() #define init_intercepts_out() sp_init_intercepts_out() -#define restart_intercepts_out() sp_restart_intercepts_out() +#define restart_intercepts_out sp_restart_intercepts_out #define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(Pmin,Pmax) #define reduce_band_size_out() sp_reduce_band_size_out() #define next_band_out() sp_next_band_out() @@ -262,160 +260,3 @@ WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. #define close_outline() sp_close_outline() #endif - -#else - -#define GDECL SPEEDO_GLOBALS* sp_global_ptr, - -#define get_char_id(char_index) sp_get_char_id(sp_global_ptr,char_index) -#define get_char_width(char_index) sp_get_char_width(sp_global_ptr,char_index) -#define get_track_kern(track,point_size) sp_get_track_kern(sp_global_ptr,track,point_size) -#define get_pair_kern(char_index1,char_index2) sp_get_pair_kern(sp_global_ptr,char_index1,char_index2) -#define get_char_bbox(char_index,bbox) sp_get_char_bbox(sp_global_ptr,char_index,bbox) -#define make_char(char_index) sp_make_char(sp_global_ptr,char_index) -#if INCL_ISW -#define compute_isw_scale() sp_compute_isw_scale(sp_global_ptr) -#define do_make_char(char_index) sp_do_make_char(sp_global_ptr,char_index) -#define make_char_isw(char_index,imported_width) sp_make_char_isw(sp_global_ptr,char_index,imported_width) -#define reset_xmax(xmax) sp_reset_xmax(sp_global_ptr,xmax) -#endif -#if INCL_ISW || INCL_SQUEEZING -#define preview_bounding_box(pointer,format) sp_preview_bounding_box(sp_global_ptr,pointer,format) -#endif -#define make_simp_char(pointer,format) sp_make_simp_char(sp_global_ptr,pointer,format) -#define make_comp_char(pointer) sp_make_comp_char(sp_global_ptr,pointer) -#define get_char_org(char_index,top_level) sp_get_char_org(sp_global_ptr,char_index,top_level) -#define get_posn_arg(ppointer,format) sp_get_posn_arg(sp_global_ptr,ppointer,format) -#define get_scale_arg(ppointer,format) sp_get_scale_arg(sp_global_ptr,ppointer,format) -#define read_bbox(ppointer,pPmin,pPmax,set_flag) sp_read_bbox(sp_global_ptr,ppointer,pPmin,pPmax,set_flag) -#define proc_outl_data(pointer) sp_proc_outl_data(sp_global_ptr,pointer) -#define split_curve(P1,P2,P3,depth) sp_split_curve(sp_global_ptr,P1,P2,P3,depth) -#define get_args(ppointer,format,pP) sp_get_args(sp_global_ptr,ppointer,format,pP) - -#define init_black(specsarg) sp_init_black(sp_global_ptr,specsarg) -#define begin_char_black(Psw,Pmin,Pmax) sp_begin_char_black(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_black(P1,outside) sp_begin_contour_black(sp_global_ptr,P1,outside) -#define line_black(P1) sp_line_black(sp_global_ptr,P1) -#define end_char_black() sp_end_char_black(sp_global_ptr) -#define add_intercept_black(y,x) sp_add_intercept_black(sp_global_ptr,y,x) -#define proc_intercepts_black() sp_proc_intercepts_black(sp_global_ptr) - -#define init_screen(specsarg) sp_init_screen(sp_global_ptr,specsarg) -#define begin_char_screen(Psw,Pmin,Pmax) sp_begin_char_screen(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_screen(P1,outside) sp_begin_contour_screen(sp_global_ptr,P1,outside) -#define curve_screen(P1,P2,P3,depth) sp_curve_screen(sp_global_ptr,P1,P2,P3,depth) -#define scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) sp_scan_curve_screen(sp_global_ptr,X0,Y0,X1,Y1,X2,Y2,X3,Y3) -#define vert_line_screen(x,y1,y2) sp_vert_line_screen(sp_global_ptr,x,y1,y2) -#define line_screen(P1) sp_line_screen(sp_global_ptr,P1) -#define end_char_screen() sp_end_char_screen(sp_global_ptr) -#define end_contour_screen() sp_end_contour_screen(sp_global_ptr) -#define add_intercept_screen(y,x) sp_add_intercept_screen(sp_global_ptr,y,x) -#define proc_intercepts_screen() sp_proc_intercepts_screen(sp_global_ptr) - -#define init_outline(specsarg) sp_init_outline(sp_global_ptr,specsarg) -#define begin_char_outline(Psw,Pmin,Pmax) sp_begin_char_outline(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_sub_char_outline(Psw,Pmin,Pmax) sp_begin_sub_char_outline(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_outline(P1,outside) sp_begin_contour_outline(sp_global_ptr,P1,outside) -#define curve_outline(P1,P2,P3,depth) sp_curve_outline(sp_global_ptr,P1,P2,P3,depth) -#define line_outline(P1) sp_line_outline(sp_global_ptr,P1) -#define end_contour_outline() sp_end_contour_outline(sp_global_ptr) -#define end_sub_char_outline() sp_end_sub_char_outline(sp_global_ptr) -#define end_char_outline() sp_end_char_outline(sp_global_ptr) - -#define init_2d(specsarg) sp_init_2d(sp_global_ptr,specsarg) -#define begin_char_2d(Psw, Pmin, Pmax) sp_begin_char_2d(sp_global_ptr,Psw, Pmin, Pmax) -#define begin_contour_2d(P1, outside) sp_begin_contour_2d(sp_global_ptr,P1, outside) -#define line_2d(P1) sp_line_2d(sp_global_ptr,P1) -#define end_char_2d() sp_end_char_2d(sp_global_ptr) -#define add_intercept_2d(y, x) sp_add_intercept_2d(sp_global_ptr,y, x) -#define proc_intercepts_2d() sp_proc_intercepts_2d(sp_global_ptr) -#define draw_vector_to_2d(x0, y0, x1, y1, band) sp_draw_vector_to_2d(sp_global_ptr,x0, y0, x1, y1, band) - -#define init_char_out(Psw,Pmin,Pmax) sp_init_char_out(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_sub_char_out(Psw,Pmin,Pmax) sp_begin_sub_char_out(sp_global_ptr,Psw,Pmin,Pmax) -#define curve_out(P1,P2,P3,depth) sp_curve_out(sp_global_ptr,P1,P2,P3,depth) -#define end_contour_out() sp_end_contour_out(sp_global_ptr) -#define end_sub_char_out() sp_end_sub_char_out(sp_global_ptr) -#define init_intercepts_out() sp_init_intercepts_out(sp_global_ptr) -#define restart_intercepts_out() sp_restart_intercepts_out(sp_global_ptr) -#define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(sp_global_ptr,Pmin,Pmax) -#define reduce_band_size_out() sp_reduce_band_size_out(sp_global_ptr) -#define next_band_out() sp_next_band_out(sp_global_ptr) - -#define init_userout(specsarg) sp_init_userout(sp_global_ptr,specsarg) - -#define reset() sp_reset(sp_global_ptr) -#define set_key(key) sp_set_key(sp_global_ptr,key) -#define get_cust_no(font_buff) sp_get_cust_no(sp_global_ptr,font_buff) -#define set_specs(specsarg) sp_set_specs(sp_global_ptr,specsarg) -#define setup_consts(xmin,xmax,ymin,ymax) sp_setup_consts(sp_global_ptr,xmin,xmax,ymin,ymax) -#define setup_tcb(ptcb) sp_setup_tcb(sp_global_ptr,ptcb) -#define setup_mult(input_mult) sp_setup_mult(sp_global_ptr,input_mult) -#define setup_offset(input_offset) sp_setup_offset(sp_global_ptr,input_offset) -#define type_tcb(ptcb) sp_type_tcb(sp_global_ptr,ptcb) -#define read_long(pointer) sp_read_long(sp_global_ptr,pointer) -#define read_word_u(pointer) sp_read_word_u(sp_global_ptr,pointer) -#define init_tcb() sp_init_tcb(sp_global_ptr) -#define scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) sp_scale_tcb(sp_global_ptr,ptcb,x_pos,y_pos,x_scale,y_scale) -#define plaid_tcb(ppointer,format) sp_plaid_tcb(sp_global_ptr,ppointer,format) -#define skip_orus(ppointer,short_form,no_ctrl_zones) sp_skip_orus(sp_global_ptr,ppointer,short_form,no_ctrl_zones) -#define skip_interpolation_table(ppointer,format) sp_skip_interpolation_table(sp_global_ptr,ppointer,format) -#define skip_control_zone(ppointer,format) sp_skip_control_zone(sp_global_ptr,ppointer,format) -#define constr_update() sp_constr_update(sp_global_ptr) -#define read_oru_table(ppointer) sp_read_oru_table(sp_global_ptr,ppointer) -#define calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) sp_calculate_x_pix(sp_global_ptr,start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) -#define calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) sp_calculate_y_pix(sp_global_ptr,start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) -#define calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) sp_calculate_x_scale(sp_global_ptr,x_factor,x_offset,no_x_ctrl_zones) -#define calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) sp_calculate_y_scale(sp_global_ptr,top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) -#define setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) sp_setup_pix_table(sp_global_ptr,ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) -#define setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) sp_setup_int_table(sp_global_ptr,ppointer,no_X_int_zones, no_Y_int_zones) - -#define fn_init_out(specsarg) (*sp_globals.init_out)(sp_global_ptr,specsarg) -#define fn_begin_char(Psw,Pmin,Pmax) (*sp_globals.begin_char)(sp_global_ptr,Psw,Pmin,Pmax) -#define fn_begin_sub_char(Psw,Pmin,Pmax) (*sp_globals.begin_sub_char)(sp_global_ptr,Psw,Pmin,Pmax) -#define fn_end_sub_char() (*sp_globals.end_sub_char)(sp_global_ptr) -#define fn_end_char() (*sp_globals.end_char)(sp_global_ptr) -#define fn_line(P1) (*sp_globals.line)(sp_global_ptr,P1) -#define fn_end_contour() (*sp_globals.end_contour)(sp_global_ptr) -#define fn_begin_contour(P0,fmt) (*sp_globals.begin_contour)(sp_global_ptr,P0,fmt) -#define fn_curve(P1,P2,P3,depth) (*sp_globals.curve)(sp_global_ptr,P1,P2,P3,depth) - - -#define load_char_data(offset, no_bytes, buff_off) sp_load_char_data(sp_global_ptr, offset, no_bytes, buff_off) -#define report_error(n) sp_report_error(sp_global_ptr, n) - -#if INCL_MULTIDEV - -#define set_bitmap_device(bfuncs,size) sp_set_bitmap_device(sp_global_ptr,bfuncs,size) -#define set_outline_device(ofuncs,size) sp_set_outline_device(sp_global_ptr,ofuncs,size) - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.bitmap_device.p_open_bitmap)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2)(*sp_globals.bitmap_device.p_set_bits)(sp_global_ptr,y, xbit1, xbit2) -#define close_bitmap()(*sp_globals.bitmap_device.p_close_bitmap)(sp_global_ptr) - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.outline_device.p_open_outline)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char()(*sp_globals.outline_device.p_start_char)(sp_global_ptr) -#define start_contour(x,y,outside)(*sp_globals.outline_device.p_start_contour)(sp_global_ptr,x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3)(*sp_globals.outline_device.p_curve)(sp_global_ptr,x1,y1,x2,y2,x3,y3) -#define line_to(x,y)(*sp_globals.outline_device.p_line)(sp_global_ptr,x,y) -#define close_contour()(*sp_globals.outline_device.p_close_contour)(sp_global_ptr) -#define close_outline()(*sp_globals.outline_device.p_close_outline)(sp_global_ptr) - -#else - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_bitmap(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2) sp_set_bitmap_bits(sp_global_ptr, y, xbit1, xbit2) -#define close_bitmap() sp_close_bitmap(sp_global_ptr) - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_outline(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char() sp_start_new_char(sp_global_ptr ) -#define start_contour(x,y,outside) sp_start_contour(sp_global_ptr, x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3) sp_curve_to(sp_global_ptr, x1,y1,x2,y2,x3,y3) -#define line_to(x,y) sp_line_to(sp_global_ptr, x,y) -#define close_contour() sp_close_contour(sp_global_ptr) -#define close_outline() sp_close_outline(sp_global_ptr) - -#endif -#endif - - diff --git a/src/Speedo/speedo.h b/src/Speedo/speedo.h index 5eb516c..a5ba3a0 100644 --- a/src/Speedo/speedo.h +++ b/src/Speedo/speedo.h @@ -350,11 +350,9 @@ typedef struct intercepts_tag typedef struct plaid_tag { fix15 orus[MAX_CTRL_ZONES]; /* Controlled coordinate table (orus) */ -#if INCL_RULES fix15 pix[MAX_CTRL_ZONES]; /* Controlled coordinate table (sub-pixels) */ fix15 mult[MAX_INT_ZONES]; /* Interpolation multiplier table */ fix31 offset[MAX_INT_ZONES]; /* Interpolation offset table */ -#endif } plaid_t; #endif @@ -519,22 +517,18 @@ typedef struct speedo_global_data plaid_t STACKFAR *plaid; #else /* if not reentrant */ fix15 orus[MAX_CTRL_ZONES]; /* Controlled coordinate table (orus) */ -#if INCL_RULES fix15 pix[MAX_CTRL_ZONES]; /* Controlled coordinate table (sub-pixels) */ fix15 mult[MAX_INT_ZONES]; /* Interpolation multiplier table */ fix31 offset[MAX_INT_ZONES]; /* Interpolation offset table */ -#endif /* endif incl_rules */ #endif /* endif not reentrant */ fix15 no_X_orus; /* Number of X controlled coordinates */ fix15 no_Y_orus; /* Number of Y controlled coordinates */ ufix16 Y_constr_org; /* Origin of constraint table in font data */ -#if INCL_RULES constr_t constr; /* Constraint data state */ boolean c_act[MAX_CONSTR]; /* TRUE if constraint currently active */ fix15 c_pix[MAX_CONSTR]; /* Size of constrained zone if active */ -#endif #if INCL_ISW boolean import_setwidth_act; /* boolean to indicate imported setwidth */ boolean isw_modified_constants; @@ -724,7 +718,6 @@ EXTERN SPEEDO_GLOBALS GLOBALFAR *sp_global_ptr; ***********************************************************************************/ /* do_char.c functions */ -ufix16 sp_get_char_id(PROTO_DECL2 ufix16 char_index); boolean sp_make_char(PROTO_DECL2 ufix16 char_index); #if INCL_ISW fix31 sp_compute_isw_scale(PROTO_DECL2); @@ -738,8 +731,6 @@ static void sp_preview_bounding_box(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 #if INCL_METRICS /* Metrics functions supported? */ fix31 sp_get_char_width(PROTO_DECL2 ufix16 char_index); -fix15 sp_get_track_kern(PROTO_DECL2 fix15 track,fix15 point_size); -fix31 sp_get_pair_kern(PROTO_DECL2 ufix16 char_index1,ufix16 char_index2); boolean sp_get_char_bbox(PROTO_DECL2 ufix16 char_index, bbox_t *bbox); #endif @@ -762,8 +753,6 @@ boolean sp_init_screen(PROTO_DECL2 specs_t GLOBALFAR *specsarg); boolean sp_begin_char_screen(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); void sp_begin_contour_screen(PROTO_DECL2 point_t P1,boolean outside); void sp_curve_screen(PROTO_DECL2 point_t P1,point_t P2,point_t P3, fix15 depth); -void sp_scan_curve_screen(PROTO_DECL2 fix31 X0,fix31 Y0,fix31 X1,fix31 Y1,fix31 X2,fix31 Y2,fix31 X3,fix31 Y3); -void sp_vert_line_screen(PROTO_DECL2 fix31 x, fix15 y1, fix15 y2); void sp_line_screen(PROTO_DECL2 point_t P1); void sp_end_contour_screen(PROTO_DECL1); boolean sp_end_char_screen(PROTO_DECL1); @@ -809,8 +798,6 @@ void sp_curve_out(PROTO_DECL2 point_t P1, point_t P2, point_t P3, fix15 depth); void sp_end_contour_out(PROTO_DECL1); void sp_end_sub_char_out(PROTO_DECL1); void sp_init_intercepts_out(PROTO_DECL1); -void sp_restart_intercepts_out(PROTO_DECL1); -void sp_set_first_band_out(PROTO_DECL2 point_t Pmin, point_t Pmax); void sp_reduce_band_size_out(PROTO_DECL1); boolean sp_next_band_out(PROTO_DECL1); #endif @@ -838,10 +825,7 @@ fix15 sp_read_word_u(PROTO_DECL2 ufix8 FONTFAR *pointer); void sp_init_tcb(PROTO_DECL1); void sp_scale_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb,fix15 x_pos,fix15 y_pos,fix15 x_scale,fix15 y_scale); ufix8 FONTFAR *sp_plaid_tcb(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format); -ufix8 FONTFAR *sp_skip_interpolation_table(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format); -ufix8 FONTFAR *sp_skip_control_zone(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format); -ufix8 FONTFAR *sp_read_oru_table(PROTO_DECL2 ufix8 FONTFAR *pointer); #if INCL_SQUEEZING || INCL_ISW static void sp_calculate_x_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 x_scale,fix31 x_offset,fix31 ppo,fix15 setwidth_pix); #endif diff --git a/src/Speedo/spglyph.c b/src/Speedo/spglyph.c index 3577f55..113f378 100644 --- a/src/Speedo/spglyph.c +++ b/src/Speedo/spglyph.c @@ -66,7 +66,7 @@ static int bit_order, byte_order, scan; -unsigned long +static unsigned long sp_compute_data_size( FontPtr pfont, int mappad, diff --git a/src/Speedo/spint.h b/src/Speedo/spint.h index 118ea8f..299882c 100644 --- a/src/Speedo/spint.h +++ b/src/Speedo/spint.h @@ -161,8 +161,6 @@ extern void sp_make_header(SpeedoFontPtr, FontInfoPtr); extern void sp_compute_bounds(SpeedoFontPtr, FontInfoPtr, unsigned long, long *); extern void sp_compute_props(SpeedoFontPtr, char *, FontInfoPtr, long); extern int sp_build_all_bitmaps(FontPtr, fsBitmapFormat, fsBitmapFormatMask); -extern unsigned long sp_compute_data_size(FontPtr, int, int, unsigned long, - unsigned long); extern int SpeedoFontLoad(FontPtr *, char *, char *, FontEntryPtr, FontScalablePtr, fsBitmapFormat, fsBitmapFormatMask, |