1 /* catdvi - get text from DVI files 2 Copyright (C) 2000 Bjoern Brill <brill@fs.math.uni-frankfurt.de> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 */ 18 19 20 #ifndef GLYPHOPS_H 21 #define GLYPHOPS_H 22 23 /* for definition of glyph_t */ 24 #include "page.h" 25 26 /* assorted magic with unicode characters ("glyphs") 27 */ 28 29 /* bit flags for certain possible properties of glyphs. useful as 30 * hints for correct rendering. Most are still unused. 31 */ 32 enum glyph_hint_t { 33 GH_DIACRITIC = 1 << 0, 34 GH_COMBINING = 1 << 1, 35 GH_NON_SPACING = 1 << 2, 36 GH_GRAPHIC = 1 << 3, 37 GH_MATH = 1 << 4, 38 GH_LIGATURE = 1 << 5, 39 GH_ON_AXIS = 1 << 6, 40 GH_EXTENSIBLE_RECIPE = 1 << 7, /* TeX specific */ 41 GH_WIDE_DIACRITIC = 1 << 8, 42 GH_MOREMATH_LEFT = 1 << 9, /* e.g. for right math delimiters */ 43 GH_RADICAL = 1 << 10 44 }; 45 46 #define GH_COMBINING_DIACRITIC (GH_DIACRITIC | GH_COMBINING | GH_NON_SPACING) 47 48 /* set up internal tables used by the other functions */ 49 void glyphops_init(void); 50 51 /* returns our ORed wisdom abut the given glyph */ 52 enum glyph_hint_t glyph_get_hint(glyph_t glyph); 53 54 /* unicode knows two kinds of diacritics: combining diacritics are by 55 * themselves unprintable characters that change the meaning of the 56 * preceding glyph. spacing diacritics are printable (roughly 57 * equivalent to space followed by the corresponding combining diacritic). 58 * 59 * the following functions translate one into the other. idempotent. 60 * return zero on failure. 61 */ 62 glyph_t diacritic_combining_variant(glyph_t diacritic); 63 glyph_t diacritic_spacing_variant(glyph_t diacritic); 64 65 #endif 66