lilypond-devel
[Top][All Lists]
Advanced

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

Why is %%PageMedia: a4 hardcoded?


From: John Hawkinson
Subject: Why is %%PageMedia: a4 hardcoded?
Date: Sun, 16 Apr 2006 03:09:46 -0400

Hello.

    As you may have noted from email to lilypond-user, I'm in the
midst of preparing some patches to improve lilypond's handling of
custom paper sizes.

    In reviewing recent code changes, I'm puzzled by some changes in
rev 1.152 of framework-ps.scm, under this log entry:

revision 1.152
date: 2006-03-06 13:42:18 +0000;  author: hanwen;  state: Exp;  lines: +33 -15
(paper-alist): no decimals for Ax paper sizes.

The revision seems to do a whole lot more, including replacing the
output of %%DocumentPaperSizes with %%DocumentMedia.  But it also
makes this change:

-    (display (page-header paper page-count #t) port)
+    (display (file-header paper page-count #t) port)
+    (display "\n%%BeginDefaults
+%%PageMedia: a4
+%%EndDefaults\n" port)
+

This hardcodes that section in the output. It seems wrong for two
reasons:

1.      Not everyone uses A4.

2.      It is not consistent with the definition of %%PageMedia
        on pp. 78-79 of the DSC Conventions spec.
        http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf

  a)    The operand to %%PageMedia is not a paper size. It is a
        <medianame>, which isn't necessarily a paper size. This is also
        true of the first operand %%DocumentMedia, by the way.

        All the examples are things like "Regular," "Cover," "BlueCL,"
        etc. A media name refers to a collection {<width>, <height>,
        <weight>, <color>, <type>} and not to some sort of external
        standard papersize.

  b)    Any medianame used in %%PageMedia is supposed to be defined
        in the %%DocumentMedia (which lists all media used in the
        document). %%PageMedia is an override (for example,
        to be used per-page), though it can be used globally, too.

  c)    %%PageMedia is supposed to be accompanied by relevant postscript
        code to select the media in question. E.g. from p.79:

          ...
          %%Page: Cover 1
          %%PageMedia: Cover
          %%BeginPageSetup
          /olddevice currentpagedevice def
          << /MediaColor (yellow) >> setpagedevice % Set up the yellow paper
          /pagelevel save def % for this page
          %%EndPageSetup
          ...

        It does not really make sense (I think) without such accompanying
        PostScript code.

   d)   It's unnecessary. Size selection should either be performed by
        reading %%DocumentMedia (DSC-compliant document managers)
        or with the /PageSize setpagedevice key (printers; my
        forthcoming patch will do this).

Anyhow, it looks to me that this code is just wrong. Can it just go
away, please? (patch follows)

address@hidden
  John Hawkinson

p.s.: Is there a reason that LilyPond source files don't include
RCS expansion keywords (i.e. $Header$ or $LilyPond$)? They are often
quite handy when there are multiple versons of files
floating around...

ChangeLog entry:

2006-04-16  John Hawkinson  <address@hidden>

        * scm/framework-ps.scm: Remove erroneous %%PageMedia: a4

Index: framework-ps.scm
===================================================================
RCS file: /sources/lilypond/lilypond/scm/framework-ps.scm,v
retrieving revision 1.160
diff -u -r1.160 framework-ps.scm
--- framework-ps.scm    4 Apr 2006 10:13:04 -0000       1.160
+++ framework-ps.scm    16 Apr 2006 07:05:57 -0000
@@ -446,9 +446,6 @@
 
     (output-scopes scopes fields basename)
     (display (file-header paper page-count #t) port)
-    (display "\n%%BeginDefaults
-%%PageMedia: a4
-%%EndDefaults\n" port)
 
     (write-preamble paper #t port)
 




reply via email to

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