1 /* 2 * DviChar.h 3 * 4 * descriptions for mapping dvi names to 5 * font indexes and back. Dvi fonts are all 6 * 256 elements (actually only 256-32 are usable). 7 * 8 * The encoding names are taken from X - 9 * case insensitive, a dash separating the 10 * CharSetRegistry from the CharSetEncoding 11 */ 12 13 #ifndef _DVICHAR_H_ 14 #define _DVICHAR_H_ 15 16 #include "Dvi.h" 17 18 #define DVI_MAX_SYNONYMS 10 19 #define DVI_MAP_SIZE 256 20 #define DVI_HASH_SIZE 256 21 #define DVI_MAX_LIGATURES 16 22 23 typedef struct _dviCharNameHash { 24 struct _dviCharNameHash *next; 25 const char *name; 26 int position; 27 } DviCharNameHash; 28 29 typedef struct _dviCharNameMap { 30 const char *encoding; 31 int special; 32 const char *const dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS]; 33 const char *const ligatures[DVI_MAX_LIGATURES][2]; 34 DviCharNameHash *buckets[DVI_HASH_SIZE]; 35 } DviCharNameMap; 36 37 extern DviCharNameMap *DviFindMap(const char *); 38 extern void DviRegisterMap(DviCharNameMap *); 39 40 #define DviCharName(map,index,synonym) ((map)->dvi_names[index][synonym]) 41 extern int DviCharIndex(DviCharNameMap *, const char *); 42 extern unsigned char *DviCharIsLigature(DviCharNameMap *, const char *); 43 extern void ResetFonts(DviWidget); 44 45 #endif 46