summaryrefslogtreecommitdiff
path: root/src/Speedo/do_char.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@benzedrine.nwnk.net>2007-06-07 15:13:44 -0400
committerAdam Jackson <ajax@benzedrine.nwnk.net>2007-06-07 15:13:44 -0400
commitd50de26430c1a114a22597de40a3e5ac3c8e1ab7 (patch)
treeb0875e1308bd70baba95661daf70ae83538eddca /src/Speedo/do_char.c
parent3fd7a510b5467479d6e2559819b96b222c7328e8 (diff)
Dead code cull from Speedo.
Diffstat (limited to 'src/Speedo/do_char.c')
-rw-r--r--src/Speedo/do_char.c207
1 files changed, 0 insertions, 207 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