home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2092 / cattab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  9.7 KB  |  293 lines

  1. /*    Copyright 1985, 1986, 1987, 1988 Chris Lewis
  2.         All Rights Reserved
  3.  
  4.     Permission to copy and further distribute is freely given provided
  5.     this copyright notice remains intact and that this software is not
  6.     sold for profit.
  7.  
  8.     Project:    Generic Troff drivers
  9.     Module:        cattab.c
  10.     Author:     Chris Lewis
  11.     Specs:        CAT Translation tables.
  12.  
  13.     Notes:
  14.     - There are two tables, one for normal and one for symbol fonts.
  15.     - The CAT code is calculated in the following way from the CAT
  16.       flash codes (see cat(5L)):
  17.         1) if lower flash, the code is the flash code minus 1.
  18.         2) if upper flash, the code is the flash code + 62
  19.       (codes go from 0 to 107)
  20.     - Some CAT codes are not allocated - they are denoted as "NOC"
  21.       in the backend translation tables, but NTC here.
  22.       (the backend translation tables are indexed by CAT code).
  23.     - CAT codes of "NTC" in this table are "pseudo characters" which
  24.       are here so that a width entry index can be specified.  For example,
  25.       "-" and \(hy are really the *same* CAT code, but have different
  26.       widths.  Ditto _ and \ul.  Another is that space isn't really
  27.       a character, but you gotta put its width somewhere.
  28.     - The width table index is the offset from the beginning of the
  29.       table (eg: not including any headers that your troff may
  30.       require).
  31.     - This table is primarily used for debugging and auxiliary purposes
  32.       and is scanned at most once per troff2ps run (-z dumps, during
  33.       *.fonts loading, and possibly in LJ w.r.t. font downloading), but
  34.       other programs use it more extensively.  The backends have
  35.       the tables that are referenced on each character to obtain
  36.       printer-specific translations.
  37.  */
  38.  
  39.  
  40. #ifndef lint
  41. static char SCCSid[] =
  42.     "@(#)cattab.c: 2.1 Copyright 90/07/18 16:52:56 Chris Lewis";
  43. #endif
  44.  
  45. #include "defs.h"
  46.  
  47. /*     +------------------------------------    Troff character name
  48.      |                                      (NOC means no character only
  49.      |                    used here to terminate list)
  50.      |
  51.      |    +-----------------------------    N: standard font
  52.      |    |                                 S: symbol font
  53.      |    |
  54.      |    |    +------------------------    CAT Output Code table index
  55.      |    |    |                (must be sorted on this field!)
  56.      |    |    |
  57.      |    |    |    +-------------------    Width table index
  58.      |    |    |    |
  59.      |    |    |    |  +----------------    Dummy used by dit2catwid
  60.      |    |    |    |  |
  61.      |    |    |    |  |   +------------    Character description.
  62.      |    |    |    |  |   |
  63.      v    v    v    v  v   v    */
  64.  
  65. struct cattab tabN[] = {
  66.     {"h",    N,   0,  72, 0, "h"},
  67.     {"t",    N,   1,  84, 0, "t"},
  68.     {"n",    N,   2,  78, 0, "n"},
  69.     {"m",    N,   3,  77, 0, "m"},
  70.     {"l",    N,   4,  76, 0, "l"},
  71.     {"i",    N,   5,  73, 0, "i"},
  72.     {"z",    N,   6,  90, 0, "z"},
  73.     {"s",    N,   7,  83, 0, "s"},
  74.     {"d",    N,   8,  68, 0, "d"},
  75.     {"b",    N,   9,  66, 0, "b"},
  76.     {"x",    N,  10,  88, 0, "x"},
  77.     {"f",    N,  11,  70, 0, "f"},
  78.     {"j",    N,  12,  74, 0, "j"},
  79.     {"u",    N,  13,  85, 0, "u"},
  80.     {"k",    N,  14,  75, 0, "k"},
  81.     {"",    N,  15,  -1, 0, NOC},
  82.     {"p",    N,  16,  80, 0, "p"},
  83.     {"em",    N,  17,  99, 0, "3/4 em"},
  84.     {";",    N,  18,  27, 0, ";"},
  85.     {"",    N,  19,  -1, 0, NOC},
  86.     {"a",    N,  20,  65, 0, "a"},
  87.     {"ru",    N,  21, 100, 0, "horizontal rule"},
  88.     {"c",    N,  22,  67, 0, "c"},
  89.     {"`",    N,  23,  64, 0, "` open"},
  90.     {"e",    N,  24,  69, 0, "e"},
  91.     {"'",    N,  25,   7, 0, "' close"},
  92.     {"o",    N,  26,  79, 0, "o"},
  93.     {"14",    N,  27, 101, 0, "1/4"},
  94.     {"r",    N,  28,  82, 0, "r"},
  95.     {"12",    N,  29, 102, 0, "1/2"},
  96.     {"v",    N,  30,  86, 0, "v"},
  97.     {"hy",    N,  31,  96, 0, "hy hyphen"},
  98.     {"w",    N,  32,  87, 0, "w"},
  99.     {"q",    N,  33,  81, 0, "q"},
  100.     {"/",    N,  34,  15, 0, "/"},
  101.     {".",    N,  35,  14, 0, "."},
  102.     {"g",    N,  36,  71, 0, "g"},
  103.     {"34",    N,  37, 103, 0, "3/4"},
  104.     {",",    N,  38,  12, 0, ","},
  105.     {"&",    N,  39,   6, 0, "&"},
  106.     {"y",    N,  40,  89, 0, "y"},
  107.     {"",    N,  41,  -1, 0, NOC},
  108.     {"%",    N,  42,   5, 0, "%"},
  109.     {"",    N,  43,  -1, 0, NOC},
  110.     {"Q",    N,  44,  49, 0, "Q"},
  111.     {"T",    N,  45,  52, 0, "T"},
  112.     {"O",    N,  46,  47, 0, "O"},
  113.     {"H",    N,  47,  40, 0, "H"},
  114.     {"N",    N,  48,  46, 0, "N"},
  115.     {"M",    N,  49,  45, 0, "M"},
  116.     {"L",    N,  50,  44, 0, "L"},
  117.     {"R",    N,  51,  50, 0, "R"},
  118.     {"G",    N,  52,  39, 0, "G"},
  119.     {"I",    N,  53,  41, 0, "I"},
  120.     {"P",    N,  54,  48, 0, "P"},
  121.     {"C",    N,  55,  35, 0, "C"},
  122.     {"V",    N,  56,  54, 0, "V"},
  123.     {"E",    N,  57,  37, 0, "E"},
  124.     {"Z",    N,  58,  58, 0, "Z"},
  125.     {"D",    N,  59,  36, 0, "D"},
  126.     {"B",    N,  60,  34, 0, "B"},
  127.     {"S",    N,  61,  51, 0, "S"},
  128.     {"Y",    N,  62,  57, 0, "Y"},
  129.     {"F",    N,  63,  38, 0, "F"},
  130.     {"X",    N,  64,  56, 0, "X"},
  131.     {"A",    N,  65,  33, 0, "A"},
  132.     {"W",    N,  66,  55, 0, "W"},
  133.     {"J",    N,  67,  42, 0, "J"},
  134.     {"U",    N,  68,  53, 0, "U"},
  135.     {"K",    N,  69,  43, 0, "K"},
  136.     {"0",    N,  70,  16, 0, "0"},
  137.     {"1",    N,  71,  17, 0, "1"},
  138.     {"2",    N,  72,  18, 0, "2"},
  139.     {"3",    N,  73,  19, 0, "3"},
  140.     {"4",    N,  74,  20, 0, "4"},
  141.     {"5",    N,  75,  21, 0, "5"},
  142.     {"6",    N,  76,  22, 0, "6"},
  143.     {"7",    N,  77,  23, 0, "7"},
  144.     {"8",    N,  78,  24, 0, "8"},
  145.     {"9",    N,  79,  25, 0, "9"},
  146.     {"*",    N,  80,  10, 0, "*"},
  147.     {"\\-", N,  81, 104, 0, "minus"},
  148.     {"fi",    N,  82, 105, 0, "fi"},
  149.     {"fl",    N,  83, 106, 0, "fl"},
  150.     {"ff",    N,  84, 107, 0, "ff"},
  151.     {"ct",    N,  85, 192, 0, "cent sign"},
  152.     {"Fl",    N,  86, 109, 0, "ffl"},
  153.     {"Fi",    N,  87, 108, 0, "ffi"},
  154.     {"(",    N,  88,   8, 0, "("},
  155.     {")",    N,  89,   9, 0, ")"},
  156.     {"[",    N,  90,  59, 0, "["},
  157.     {"]",    N,  91,  61, 0, "]"},
  158.     {"de",    N,  92, 110, 0, "degree"},
  159.     {"dg",    N,  93, 111, 0, "dagger"},
  160.     {"=",    N,  94,  29, 0, "="},
  161.     {"rg",    N,  95, 189, 0, "registered"},
  162.     {":",    N,  96,  26, 0, ":"},
  163.     {"+",    N,  97,  11, 0, "+"},
  164.     {"",    N,  98,  -1, 0, NOC},
  165.     {"!",    N,  99,   1, 0, "!"},
  166.     {"bu",    N, 100,  97, 0, "bullet"},
  167.     {"?",    N, 101,  31, 0, "?"},
  168.     {"fm",    N, 102, 113, 0, "foot mark (minute)"},
  169.     {"|",    N, 103,  92, 0, "|"},
  170.     {"",    N, 104,  -1, 0, NOC},
  171.     {"co",    N, 105, 190, 0, "copyright"},
  172.     {"sq",    N, 106,  98, 0, "square"},
  173.     {"$",    N, 107,   4, 0, "$"},
  174.     {" ",    N, NTC,   0, 0, "space"},
  175.     {"\\|",    N, NTC,  95, 0, "narrow space"},
  176.     {"\\^",    N, NTC, 118, 0, "half narrow space"},
  177.     {"-",   N, NTC,  13, 0, "hyphen character"},
  178.     {NOC}
  179. };
  180.  
  181. struct cattab tabS[] = {
  182.     {"*q",    S,   0, 142, 0, "psi"},
  183.     {"*h",    S,   1, 127, 0, "theta"},
  184.     {"*n",    S,   2, 132, 0, "nu"},
  185.     {"*m",    S,   3, 131, 0, "mu"},
  186.     {"*l",    S,   4, 130, 0, "lambda"},
  187.     {"*i",    S,   5, 128, 0, "iota"},
  188.     {"*z",    S,   6, 125, 0, "zeta"},
  189.     {"*s",    S,   7, 137, 0, "sigma"},
  190.     {"*d",    S,   8, 123, 0, "delta"},
  191.     {"*b",    S,   9, 121, 0, "beta"},
  192.     {"*c",    S,  10, 133, 0, "xi"},
  193.     {"*y",    S,  11, 126, 0, "eta"},
  194.     {"*f",    S,  12, 140, 0, "phi"},
  195.     {"*u",    S,  13, 139, 0, "upsilon"},
  196.     {"*k",    S,  14, 129, 0, "kappa"},
  197.     {"",    S,  15,  -1, 0, NOC},
  198.     {"*p",    S,  16, 135, 0, "pi"},
  199.     {"@",    S,  17,  32, 0, "@"},
  200.     {"da",    S,  18, 169, 0, "down arrow"},
  201.     {"",    S,  19,  -1, 0, NOC},
  202.     {"*a",    S,  20, 120, 0, "alpha"},
  203.     {"or",    S,  21, 198, 0, "or (was star)"},
  204.     {"*x",    S,  22, 141, 0, "chi"},
  205.     {"\"",    S,  23,   2, 0, "double quote"},
  206.     {"*e",    S,  24, 124, 0, "epsilon"},
  207.     {"eq",    S,  25, 170, 0, "equation equal"},
  208.     {"*o",    S,  26, 134, 0, "omicron"},
  209.     {"<-",    S,  27, 167, 0, "left arrow"},
  210.     {"*r",    S,  28, 136, 0, "rho"},
  211.     {"ua",    S,  29, 168, 0, "up arrow"},
  212.     {"*t",    S,  30, 138, 0, "tau"},
  213.     {"ul",    S,  31, 116, 0, "ul"},
  214.     {"\\",    S,  32,  60, 0, "back slash"},
  215.     {"*Q",    S,  33, 154, 0, "Psi"},
  216.     {"bs",    S,  34, 197, 0, "bell system sign"},
  217.     {"if",    S,  35, 180, 0, "infinity"},
  218.     {"*g",    S,  36, 122, 0, "gamma"},
  219.     {"ip",    S,  37, 179, 0, "improper superset"},
  220.     {"pt",    S,  38, 185, 0, "proportional to"},
  221.     {"rh",    S,  39, 194, 0, "right hand"},
  222.     {"*w",    S,  40, 143, 0, "omega"},
  223.     {"",    S,  41,  -1, 0, NOC},
  224.     {"gr",    S,  42, 182, 0, "gradient"},
  225.     {"",    S,  43,  -1, 0, NOC},
  226.     {"*F",    S,  44, 153, 0, "Phi"},
  227.     {"*H",    S,  45, 146, 0, "Theta"},
  228.     {"*W",    S,  46, 155, 0, "Omega"},
  229.     {"cu",    S,  47, 174, 0, "union"},
  230.     {"rn",    S,  48, 158, 0, "root en"},
  231.     {"ts",    S,  49, 157, 0, "terminal sigma"},
  232.     {"*L",    S,  50, 147, 0, "Lambda"},
  233.     {"mi",    S,  51, 162, 0, "equation minus"},
  234.     {"*G",    S,  52, 144, 0, "Gamma"},
  235.     {"is",    S,  53, 184, 0, "integral sign"},
  236.     {"*P",    S,  54, 149, 0, "Pi"},
  237.     {"sb",    S,  55, 176, 0, "subset of"},
  238.     {"sp",    S,  56, 177, 0, "superset of"},
  239.     {"ap",    S,  57, 164, 0, "approximates"},
  240.     {"pd",    S,  58, 181, 0, "partial derivative"},
  241.     {"*D",    S,  59, 145, 0, "Delta"},
  242.     {"sr",    S,  60, 156, 0, "square root"},
  243.     {"*S",    S,  61, 150, 0, "Sigma"},
  244.     {"~=",    S,  62, 163, 0, "approx ="},
  245.     {">",    S,  63,  30, 0, ">"},
  246.     {"*C",    S,  64, 148, 0, "Xi"},
  247.     {"<",    S,  65,  28, 0, "<"},
  248.     {"sl",    S,  66, 117, 0, "slash"},
  249.     {"ca",    S,  67, 175, 0, "intersect"},
  250.     {"*U",    S,  68, 152, 0, "Upsilon"},
  251.     {"no",    S,  69, 183, 0, "logical not"},
  252.     {"rc",    S,  70, 210, 0, "right ceiling"},
  253.     {"lt",    S,  71, 200, 0, "left top brace"},
  254.     {"bv",    S,  72, 206, 0, "bold vertical"},
  255.     {"lk",    S,  73, 204, 0, "left ctr brace"},
  256.     {"lb",    S,  74, 201, 0, "left bot brace"},
  257.     {"rt",    S,  75, 202, 0, "right top brace"},
  258.     {"rk",    S,  76, 205, 0, "right ctr brace"},
  259.     {"rb",    S,  77, 203, 0, "right bot brace"},
  260.     {"rf",    S,  78, 208, 0, "right floor"},
  261.     {"lf",    S,  79, 207, 0, "left floor"},
  262.     {"lc",    S,  80, 209, 0, "left ceiling"},
  263.     {"mu",    S,  81, 171, 0, "multiply"},
  264.     {"di",    S,  82, 172, 0, "divide"},
  265.     {"+-",    S,  83, 173, 0, "plus-minus"},
  266.     {"<=",    S,  84, 160, 0, "<="},
  267.     {">=",    S,  85, 159, 0, ">="},
  268.     {"==",    S,  86, 161, 0, "identically equal"},
  269.     {"!=",    S,  87, 165, 0, "not equal"},
  270.     {"{",    S,  88,  91, 0, "{"},
  271.     {"}",    S,  89,  93, 0, "}"},
  272.     {"aa",    S,  90, 114, 0, "acute accent"},
  273.     {"ga",    S,  91, 115, 0, "grave accent"},
  274.     {"^",    S,  92,  62, 0, "^"},
  275.     {"#",    S,  93,   3, 0, "#"},
  276.     {"lh",    S,  94, 195, 0, "left hand"},
  277.     {"mo",    S,  95, 187, 0, "member of"},
  278.     {"~",    S,  96,  94, 0, "~"},
  279.     {"es",    S,  97, 186, 0, "empty set"},
  280.     {"",    S,  98,  -1, 0, NOC},
  281.     {"dd",    S,  99, 193, 0, "dbl dagger"},
  282.     {"br",    S, 100, 191, 0, "box rule (was parallel sign)"},
  283.     {"**",    S, 101, 196, 0, "math *"},
  284.     {"ib",    S, 102, 178, 0, "improper subset"},
  285.     {"ci",    S, 103, 199, 0, "circle"},
  286.     {"",    S, 104, -1, 0, NOC},
  287.     {"pl",    S, 105, 188, 0, "equation plus"},
  288.     {"->",    S, 106, 166, 0, "right arrow"},
  289.     {"sc",    S, 107, 112, 0, "section"},
  290.     {"_",    S, NTC,  63, 0, "_"},
  291.     {NOC}
  292. };
  293.