lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is %%PageMedia: a4 hardcoded?


From: John Hawkinson
Subject: Re: Why is %%PageMedia: a4 hardcoded?
Date: Sun, 16 Apr 2006 10:55:43 -0400
User-agent: Mutt/1.5.6i

Johannes Schindelin <address@hidden> wrote on Sun, 16 Apr 2006
at 13:46:16 +0200 in <address@hidden>:

> > +    (display "\n%%BeginDefaults
> > +%%PageMedia: a4
> > +%%EndDefaults\n" port)
> 
> Correct me if I'm wrong, but was "BeginDefaults" not the method of choice 
> to say: if no other value is given, please take A4 instead of that 
> awkward Letter format?

No, that's not what it is at all. You may find it instructive to refer
to the specification.
http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf      

First of all, the %%PageMedia is used to specify that the
described attribute is "INVOKED on this page" [emphasis mine].
That is, it implies that there is postscript code on that
page which sets the media type (with setpagedevice).

Second, when %%PageMedia appears in the BeginDefaults/EndDefaults
section, it applies to *all* pages. You are only supposed to do this
if your document uses more than one type of medium, because otherwise
the specification in %%DocumentMedia would suffice. See the note at
the top of p. 49 (section 5.2):

| In some instances it may be superfluous to use these page defaults. If
| only one type of orientation, media type, etc. is used in the entire
| document, the header comment alone is sufficient to indicate the
| default for the document. PAGE DEFAULTS SHOULD ONLY BE USED IF THERE
| IS MORE THAN ONE bounding box, custom color, MEDIUM, orientation,
| process color, requirement, or resource USED.
[emphasis mine]

Third, PageMedia is meaningless when it references a medianame that is not
defined in %%DocumentMedia.


Fourth, A4 is the wrong media type for many people (fortunately since
the code doesn't accomplish anything, it only serves to confuse some
people [and perhaps some software]) who read the code, since it is
unconditionally output (but other code, including %%DocumentMedia,
properly specifies the paper size).

> IOW, if another page media is chosen, this should not hurt.

Err, it's wrong and doesn't beenfit and adds confusion.


Hopefully that's sufficiently clear? :)

> And BTW, Lily's PostScript code's main purpose is to produce something 
> which Ghostscript turns into a PDF. So, the PostScript does not have to 
> adher strictly to the specs, but to what Ghostscript understands.

Yikes, really!? That's good to know, I guess, but also kind of
disappointing.  For some reason that I have not bothered to debug,
PDFs that LilyPond (2.6.3) generates for me have bizarre defects, like
all text turning into the letter "y," etc. As such, postscript is the
way to go. Not to mention that it's faster.

--jhawk

p.s.: In moving from LilyPond 2.6.3 to 2.9.2, I find that spooling
postscript crashes my HP LaserJet 8150DN.  Haven't finished
figuring out why yet... I'll get there...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]