Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/dvi/dvilib/dl-dvi-parser.cc
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@redhat.com>2004-12-22 16:04:45 (GMT)
committer Søren Sandmann Pedersen <ssp@src.gnome.org>2004-12-22 16:04:45 (GMT)
commit08d37ab642e8cb80774a87270fd6a3f9fab783fb (patch)
tree1c05b53c93197c3ae3cf6350aea587f0b30a28b6 /dvi/dvilib/dl-dvi-parser.cc
parent08dc4040951ec1e3945e07107d008a4ce7c928c9 (diff)
Auto*ify dvi and dvi/dvilib
Tue Dec 21 21:45:43 2004 Soeren Sandmann <sandmann@redhat.com> * Makefile.am: * dvi/dvilib/Makefile.am: * dvi/Makefile.am: * configure.ac: Auto*ify dvi and dvi/dvilib * dvi/Makefile: Remove from CVS * dvi/dvilib/dl-pkfont.cc (unpack_bitmap): Fix uchar/uint confusion. * dvi/dvilib/dl-fontdefinition.{cc,hh}: New DviFontMap class * dvi/dvilib/dl-vffont.{cc,hh}: Many bugfixes to VF code.
Diffstat (limited to 'dvi/dvilib/dl-dvi-parser.cc')
-rwxr-xr-xdvi/dvilib/dl-dvi-parser.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/dvi/dvilib/dl-dvi-parser.cc b/dvi/dvilib/dl-dvi-parser.cc
index 7caac02..e437261 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; i<dirlength; ++i)
+ for (uint i=0; i < dirlength; ++i)
fontdef->directory += loader.get_uint8();
- for (uint i=0; i<namelength; ++i)
+ for (uint i=0; i < namelength; ++i)
fontdef->name += 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
{