summaryrefslogtreecommitdiff
path: root/backend/dvi/fonts.c
blob: 7c15f8d7b48133eaab91ee29c950f19e8958311c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "config.h"
#include "fonts.h"
#include "mdvi.h"

static int registered = 0;

extern DviFontInfo pk_font_info;
extern DviFontInfo pkn_font_info;
extern DviFontInfo gf_font_info;
extern DviFontInfo vf_font_info;
extern DviFontInfo ovf_font_info;
#if 0
extern DviFontInfo tt_font_info;
#endif
#ifdef WITH_TYPE1_FONTS
extern DviFontInfo t1_font_info;
#endif
extern DviFontInfo afm_font_info;
extern DviFontInfo tfm_font_info;
extern DviFontInfo ofm_font_info;

static struct fontinfo {
	DviFontInfo *info;
	char	*desc;
	int	klass;
} known_fonts[] = {
	{&vf_font_info, "Virtual fonts", 0},
	{&ovf_font_info, "Omega's virtual fonts", 0},
#if 0
	{&tt_font_info, "TrueType fonts", 0},
#endif
#ifdef WITH_TYPE1_FONTS
	{&t1_font_info, "Type1 PostScript fonts", 0},
#endif
	{&pk_font_info, "Packed bitmap (auto-generated)", 1},
	{&pkn_font_info, "Packed bitmap", -2},
	{&gf_font_info, "Metafont's generic font format", 1},
	{&ofm_font_info, "Omega font metrics", -1},
	{&tfm_font_info, "TeX font metrics", -1},
	{&afm_font_info, "Adobe font metrics", -1},
	{0, 0}
};

void mdvi_register_fonts (void)
{
    struct fontinfo *type;

    if (!registered) {
	for(type = known_fonts; type->info; type++) {
			mdvi_register_font_type(type->info, type->klass);
	}
	registered = 1;
    }
	return;
}