home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume24 / psroff3.0 / part10 / cattab.c
Encoding:
C/C++ Source or Header  |  1991-10-09  |  9.6 KB  |  290 lines

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