]> www.fi.muni.cz Git - evince.git/blob - dvi/dvilib/dl-vffont.cc
Updated Swedish translation.
[evince.git] / dvi / dvilib / dl-vffont.cc
1 #include "dl-vffont.hh"
2 #include "dl-dvi-parser.hh"
3
4 using namespace DviLib;
5
6 void
7 VfFont::fixup_fontmap (DviFontMap *fontmap)
8 {
9     typedef std::map<int, DviFontdefinition *>::iterator It;
10     for (It i = fontmap->fontmap.begin(); i != fontmap->fontmap.end(); ++i)
11     {
12         (*i).second->at_size = ((*i).second->at_size / 1048576.0) * preamble->design_size;
13 #if 0
14         (*i).second->design_size = 1048576;
15 #endif
16     }
17 }
18
19 VfFont::VfFont (AbstractLoader &l,
20                 int at_size_arg)
21 {
22     at_size = at_size_arg;
23     DviParser parser (l);
24     preamble = parser.parse_vf_font_preamble();
25     
26     VfChar *ch;
27     while ((ch = parser.parse_vf_char()) != NULL)
28     {
29         chars[ch->character_code] = ch;
30         ch->fontmap = preamble->fontmap;
31     }
32
33     /* fixup fontmap
34      *
35      * FIXME: I don't think this is correct, but vftovp.web isn't
36      * totally clear on the issue
37      */
38
39     fixup_fontmap (preamble->fontmap);
40 }
41