X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=dvi%2Fdvilib%2Fdl-dvi-parser.cc;h=e43726169cdb0dcd964a7692a6361a8df9157918;hb=1efe0593969bf7f461cf8298a75daddfbb6da678;hp=7caac026676c603d209bf443c3ea4be22504b51d;hpb=4296951e94a43c723e9522b588cab178eb66d144;p=evince.git diff --git a/dvi/dvilib/dl-dvi-parser.cc b/dvi/dvilib/dl-dvi-parser.cc index 7caac026..e4372616 100755 --- a/dvi/dvilib/dl-dvi-parser.cc +++ b/dvi/dvilib/dl-dvi-parser.cc @@ -358,7 +358,9 @@ DviParser::parse_program (uint n_bytes) cmd = parse_command (loader, &count, &opcode); if (cmd) { +#if 0 cout << opcode << endl; +#endif program->add_command (cmd); cmd->unref(); } @@ -420,12 +422,14 @@ DviParser::parse_fontdefinition (void) fontdef->directory = ""; fontdef->name = ""; - for (uint i=0; idirectory += loader.get_uint8(); - for (uint i=0; iname += loader.get_uint8(); +#if 0 cout << "parsed fd: " << fontdef->name << " " << fontdef->fontnum << endl; +#endif return fontdef; } @@ -462,6 +466,8 @@ DviFilePostamble * DviParser::parse_postamble (void) { DviFilePostamble *postamble = new DviFilePostamble; + + postamble->fontmap = new DviFontMap; loader.goto_from_end (-5); @@ -497,9 +503,9 @@ DviParser::parse_postamble (void) loader.goto_from_current (-1); DviFontdefinition *fd = parse_fontdefinition (); - postamble->fontdefinitions[fd->fontnum] = fd; + postamble->fontmap->set_fontdefinition (fd->fontnum, fd); cout << fd->name << endl; - cout << postamble->fontdefinitions[fd->fontnum]->name; + cout << postamble->fontmap->get_fontdefinition(fd->fontnum)->name; } else { @@ -515,6 +521,8 @@ DviParser::parse_vf_font_preamble (void) { DviOpcode c; VfFontPreamble *preamble = new VfFontPreamble; + + preamble->fontmap = new DviFontMap; c = (DviOpcode)loader.get_uint8 (); if (c != DVI_PRE) @@ -527,6 +535,7 @@ DviParser::parse_vf_font_preamble (void) preamble->checksum = loader.get_uint32 (); preamble->design_size = loader.get_uint32 (); + int i = 0; while (true) { DviOpcode c = (DviOpcode)loader.get_uint8 (); @@ -536,7 +545,7 @@ DviParser::parse_vf_font_preamble (void) loader.goto_from_current (-1); DviFontdefinition *fd = parse_fontdefinition (); - preamble->fontdefinitions.push_back (fd); + preamble->fontmap->set_fontdefinition (i++, fd); } else {