/* PAUL MURRELL This is from the GNU plotutils libplot-2.3 distribution, with PS font stuff removed */ /* THIS FILE IS NOW SPLIT INTO TWO PIECES: g_fontdb.c and g_fontd2.c, TO FACILITATE COMPILING. This is the first half, containing PS fonts and Hershey vector fonts. */ /*----------------------------------------------------------------------*/ /* This file contains information about PS fonts, Hershey vector fonts, PCL fonts, and Stick fonts (i.e., device-resident vector fonts), and about the way in which they are divided into typefaces. For the non-Hershey fonts, the most important information is the width tables. For the Hershey fonts, it is the mapping from the character position in the font, to the position of the corresponding glyph in the glyph array in g_her_glyph.c. Accented characters are formed as composites. */ /* PAUL MURRELL sys-defines.h not used */ /* #include "sys-defines.h" */ /* PAUL MURRELL extern.h renamed g_extern.h */ #include "g_extern.h" /* PAUL MURRELL I have deleted the PS fonts stuff to leave just the Hershey font stuff */ /* The Hershey vector fonts we support. Each character in a Hershey font is an index into the glyph array in g_her_glyphs.c. Each plHersheyFontInfoStruct includes these elements: (1) PS-style name for the font (2) an alias for the font (for backward compatibility) (3) Allen Hershey's original name for the font (4) the characters in the font (an array of glyph indices, size 256) (5) a typeface id (an index into the _ps_typeface_info[] array below) (6) a font index (which font within the typeface this is) (7) an `obliquing requested' flag (set if glyphs should be sheared) (8) an `iso8859-1' flag (9) a `visible' flag (false for the two Kana fonts, which are only used internally) */ /* Each Hershey font below may contain up to 256 Hershey glyphs, each of which is specified by a number that indexes into the array in g_her_glyph.c. Only the ranges 0x20..0x7e and 0xa0..0xff are directly accessible to the user. There are several sorts of hole in the Hershey fonts, i.e., entries in the character arrays in these printable ranges which are not proper glyphs. They are: 0. undefined characters: thorn, eth, the guillemets, the mysterious `currency' symbol, and the European 'euro' currency symbol. These are written as UNDE, which is a glyph consisting of several horizontal lines. 1. the characters onesuperior, twosuperior, threesuperior, ordmasculine, ordfeminine. These are written as 0, which means an empty glyph. That is because they not implemented as conventional glyphs at all: the corresponding entries in this table are never accessed. In the file g_cntrlify.c these characters are mapped to sequences of control sequences, which implement them as superscripts. 2. the characters ae, AE, and germandbls (i.e. eszet), which (except in Gothic-German) are also written as 0. That is because they are `deligatured' in g_cntrlify.c, via a translation table in g_cntrlify.h. Deligaturization maps them to the two-characters sequences "ae", "AE", and "ss". The corresponding entries in this table are never accessed. 3. the accented ISO-Latin-1 characters. These are written as ACC0, ACC1, or ACC2, any of which signifies that they should be looked up in the following table of accented characters, yielding an accent and a character. They signify respectively that the accent should be superimposed on the character, that it should be raised by 7 Hershey units (for capitals), and that it should be raised by 7 units and also displaced rightward by 2 units (for italic capitals). 4. the small Katakana in the HersheyEUC font. These are written as KS (i.e. Katakana small) + true glyph number. This means that they should be isotropically compressed, with the baseline preserved. In many Hershey fonts, the `nonprintable' range 0x80..0x9f is nonprintable only in the sense that it is not directly accessible to the user; it may contain ligatures, macros, and variant characters. In fact the just-mentioned accents, used in the construction of accented ISO-Latin-1 characters, are stored there. Our convention for the 0x80..0x9f range, for ISO-Latin-1 Hershey fonts, is: 0200: ff 0201: fi 0202: fl 0203: ffi 0204: ffl 0205--0207: other ligatures (font-specific) 0210: acute accent 0211: grave accent 0212: dieresis 0213: circumflex accent 0214: circumflex accent for `i' 0215: tilde accent 0216: ring accent for `a' 0217: cedilla [NOT YET IMPLEMENTED] 0230: variant [final] form for `s' 0231: dotless i In the symbol fonts, we store miscellaneous symbols and astronomical symbols in this range. In fact, in the symbol fonts the astronomical symbols overflow to the other nonprintable range 0x00..0x1f (the twelve zodiacal signs are stored there). */ #define CEDILLA UNDE /* currently undefined, to be implemented someday */ /* IMPORTANT: The fonts in this array may be referred to elsewhere in the code by number. If you change the numbering of Hershey fonts, i.e., the order in which they appear in this array, be sure to update, e.g., the definitions DEFAULT_HERSHEY_FONT_INDEX, HERSHEY_SERIF, HERSHEY_EUC etc. in ./g_extern.h. */ /* LIST them by (occur "^ *\"Hershey.*#" nil) <= 2, since every typeface should include a symbol font (the zeroth font, the 1st listed)] (2) a list of fonts (each number is an index into the _hershey_font_info[] array above). The number of valid fonts should be <= FONTS_PER_TYPEFACE; the initializers are filled out with dummy fonts to get arrays of length FONTS_PER_TYPEFACE. */ const struct plTypefaceInfoStruct _hershey_typeface_info[] = { /* Hershey Serif [including Cyrillic, Cyrillic-Obl., and EUC], typeface #0 */ { 8, { 18, 0, 1, 2, 3, 4, 5, 8, 999, 999 } }, /* Hershey Sans, typeface #1 */ { 5, { 22, 9, 10, 11, 12, 999, 999, 999, 999, 999 } }, /* Hershey Script [note duplicates], typeface #2 */ { 5, { 18, 13, 13, 14, 14, 999, 999, 999, 999, 999 } }, /* Hershey Gothic English, typeface #3 */ { 2, { 18, 15, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Gothic German, typeface #4 */ { 2, { 18, 16, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Gothic Italian, typeface #5 */ { 2, { 18, 17, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Serif Symbol, typeface #6 */ { 5, { 18, 18, 19, 20, 21, 999, 999, 999, 999, 999 } }, /* Hershey Sans Symbol, typeface #7 */ { 3, { 22, 22, 23, 999, 999, 999, 999, 999, 999, 999 } }, };