]> www.fi.muni.cz Git - evince.git/blob - dvi/dvilib/dl-vffont.hh
Auto*ify dvi and dvi/dvilib
[evince.git] / dvi / dvilib / dl-vffont.hh
1 #ifndef DL_VFFONT_HH__
2 #define DL_VFFONT_HH__
3
4 #include "dl-dvi-file.hh"
5 #include "dl-dvi-fontdefinition.hh"
6 #include "dl-font.hh"
7
8 namespace DviLib {
9     
10     class VfChar : public AbstractCharacter
11     {
12     public:
13         int tfm_width;
14         DviProgram *program;
15         DviFontMap *fontmap;
16         int character_code;
17
18         virtual void paint (DviRuntime& runtime)
19         {
20             runtime.push();
21             runtime.fontmap (fontmap);
22             runtime.font_num (0);
23             cout << "vfchar (" << (int)fontmap << ')' << " " << character_code << endl;
24             program->execute (runtime); // FIXME push, pop, etc.
25             runtime.pop();
26         }
27         virtual int get_tfm_width () { return tfm_width; }
28     };
29     
30     class VfFontPreamble : public RefCounted
31     {
32     public:
33         string comment;
34         uint checksum;
35         uint design_size;
36         DviFontMap *fontmap;
37     };
38     
39     class VfFont : public AbstractFont
40     {
41         VfFontPreamble *preamble;
42         map <int, VfChar *> chars;
43         int at_size;
44         void fixup_fontmap (DviFontMap *fontmap);
45     public:
46         VfFont (AbstractLoader& l, int at_size);
47         virtual VfChar *get_char (int ccode) 
48         { 
49             return chars[ccode]; 
50         };
51         int get_design_size () 
52         { 
53             return preamble->design_size; 
54         }
55         virtual int get_at_size ()
56         {
57             return at_size;
58         }
59         virtual ~VfFont () {}
60     };
61 }
62 #endif /* DL_VFFONT_HH__ */