From: Joerg L. <jo...@us...> - 2012-02-17 09:36:39
|
Hi Michael, First: We should definitely add the DSC comments relating to the font usage. In fact, I don't know why we didn't do this before... However... On 17.02.12, m-s...@us... wrote: > Revision: 3240 > http://pyx.svn.sourceforge.net/pyx/?rev=3240&view=rev > Author: m-schindler > Date: 2012-02-17 08:52:41 +0000 (Fri, 17 Feb 2012) > Log Message: > ----------- > added second postscript font type in PS header > > Modified Paths: > -------------- > trunk/pyx/pyx/pswriter.py > > Modified: trunk/pyx/pyx/pswriter.py > =================================================================== > --- trunk/pyx/pyx/pswriter.py 2012-02-16 17:41:57 UTC (rev 3239) > +++ trunk/pyx/pyx/pswriter.py 2012-02-17 08:52:41 UTC (rev 3240) > @@ -67,6 +67,14 @@ > for resource in self.resourceslist: > resource.output(file, writer, self) > > + def writefontnames(self, file): > + fontnames = [res.t1file.name for res in self.resourceslist if res.type == "t1file"] > + fontnames += [res.newfontname for res in self.resourceslist if res.type == "reencodefont"] > + if fontnames: > + file.write(_DSCsplitline("%%DocumentNeededFonts:", "", fontnames)) # TODO add needed fonts which are not included > + file.write(_DSCsplitline("%%DocumentSuppliedFonts:", "", fontnames)) > + file.write(_DSCsplitline("%%DocumentFonts:", "", fontnames)) > + ... this looks not like the intended use of the registry. Without looking in the details, the previous solution you checked in looked better. What was the reason for moving this code into the PSregistry? > # > # Abstract base class > # > @@ -159,12 +167,8 @@ > if pagebbox: > file.write("%%%%BoundingBox: %d %d %d %d\n" % pagebbox.lowrestuple_pt()) > file.write("%%%%HiResBoundingBox: %g %g %g %g\n" % pagebbox.highrestuple_pt()) > - fontnames = [res.t1file.name for res in registry.resourceslist if res.type == "t1file"] > - if fontnames: > - file.write(_DSCsplitline("%%DocumentNeededFonts:", "", fontnames)) # TODO add needed fonts which are not included > - file.write(_DSCsplitline("%%DocumentSuppliedFonts:", "", fontnames)) > - file.write(_DSCsplitline("%%DocumentFonts:", "", fontnames)) > self.writeinfo(file) > + registry.writefontnames(file) > file.write("%%EndComments\n") > > file.write("%%BeginProlog\n") > @@ -224,12 +228,8 @@ > if documentbbox and writebbox: > file.write("%%%%BoundingBox: %d %d %d %d\n" % documentbbox.lowrestuple_pt()) > file.write("%%%%HiResBoundingBox: %g %g %g %g\n" % documentbbox.highrestuple_pt()) > - fontnames = [res.t1file.name for res in registry.resourceslist if res.type == "t1file"] > - if fontnames: > - file.write(_DSCsplitline("%%DocumentNeededFonts:", "", fontnames)) # TODO add needed fonts which are not included > - file.write(_DSCsplitline("%%DocumentSuppliedFonts:", "", fontnames)) > - file.write(_DSCsplitline("%%DocumentFonts:", "", fontnames)) > self.writeinfo(file) > + registry.writefontnames(file) > > # required paper formats > paperformats = {} Cheers, Jörg |