Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/dvi/dvilib/dl-vffont.hh
blob: 185e4a98c78ba810599046a1029f72755b2dc4d4 (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
#ifndef DL_VFFONT_HH__
#define DL_VFFONT_HH__

#include "dl-dvi-file.hh"
#include "dl-dvi-fontdefinition.hh"
#include "dl-font.hh"

namespace DviLib {
    
    class VfChar : public AbstractCharacter {
    public:
	int tfm_width;
	DviProgram *program;
	int character_code;

	virtual void paint (DviRuntime& runtime)
	{
	    runtime.push();
	    program->execute (runtime); // FIXME push, pop, etc.
	    runtime.pop();
	}
	virtual int get_tfm_width () { return tfm_width; }
    };
    
    class VfFontPreamble : public RefCounted {
    public:
	string comment;
	uint checksum;
	uint design_size;
	vector <DviFontdefinition *> fontdefinitions;
    };
    
    class VfFont : public AbstractFont {
	VfFontPreamble *preamble;
	map <int, VfChar *> chars;
	int at_size;
    public:
	VfFont (AbstractLoader& l, int at_size);
	virtual VfChar *get_char (int ccode) 
	{ 
	    return chars[ccode]; 
	};
	int get_design_size () 
	{ 
	    return preamble->design_size; 
	}
	virtual int get_at_size ()
	{
	    /* FIXME (what is the correct thing to do here?) */
	    return at_size;
	}
	virtual ~VfFont () {}
    };
}
#endif /* DL_VFFONT_HH__ */