DviChar.h revision f80a6dcd
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 seperating the
10 * CharSetRegistry from the CharSetEncoding
11 */
12/* $XFree86$ */
13
14#ifndef _DVICHAR_H_
15#define _DVICHAR_H_
16
17#include "Dvi.h"
18
19# define DVI_MAX_SYNONYMS	10
20# define DVI_MAP_SIZE		256
21# define DVI_HASH_SIZE		256
22# define DVI_MAX_LIGATURES	16
23
24typedef struct _dviCharNameHash {
25	struct _dviCharNameHash	*next;
26	char			*name;
27	int			position;
28} DviCharNameHash;
29
30typedef struct _dviCharNameMap {
31    char		*encoding;
32    int			special;
33    char		*dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
34    char		*ligatures[DVI_MAX_LIGATURES][2];
35    DviCharNameHash	*buckets[DVI_HASH_SIZE];
36} DviCharNameMap;
37
38extern DviCharNameMap	*DviFindMap (char *);
39extern void		DviRegisterMap (DviCharNameMap *);
40#ifdef NOTDEF
41extern char		*DviCharName (DviCharNameMap *, int, int);
42#else
43#define DviCharName(map,index,synonym)	((map)->dvi_names[index][synonym])
44#endif
45extern int		DviCharIndex (DviCharNameMap *, char *);
46extern unsigned char	*DviCharIsLigature (DviCharNameMap *, char *);
47extern void		ResetFonts (DviWidget);
48
49#endif
50