Ghostscript patches and packaging

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ghostscript patches and packaging

Quentin Spencer
Hello everyone,

I'm an occasional user of lilypond, and new to this list. I'm also the
maintainer of a few packages in Fedora Extras, and I'm considering
submitting lilypond for inclusion there. Initially I built everything
(version 2.8.1) from source and I ran into the PDF file size problem
that apparently several others have noticed. I downloaded the GUB
installer and the file sizes are sane again. However, I would really
like to get things working properly with RPM packages. At this point,
mftrace is the only dependency that is not in Fedora Core or Extras, so
I would need to submit packages for mftrace and lilypond.

Anyway, I saw the patch that someone posted on the bug list for
GhostScript 8.53. I backported the patch (basically the only difference
is the line numbers) to the version of 8.15 that is currently in Fedora,
and amazingly, my PDFs are now back down to their small sizes again. I
have attached the patch for anyone interested. It should be noted that
while this lilypond setup has been working for me, it fails when
building the documentation, so clearly there are special cases that gs
8.15 can't handle. I would like to put a request in Fedora's bugzilla to
add this patch, however, I would like to present a convincing reason for
why it needs to be included. Can someone give an explanation of what the
patch does and where it came from (is this already in upstream CVS, for
example)?

-Quentin


--- src/gdevpdtt.c.orig 2005-02-16 15:21:49.000000000 -0600
+++ src/gdevpdtt.c 2006-04-08 00:32:09.000000000 -0500
@@ -1269,6 +1269,7 @@
     gs_char ch;
     gs_const_string gname;
     gs_glyph *gid = (gs_glyph *)pstr->data; /* pdf_text_process allocs enough space. */
+    bool unknown = false;
 
     /* Translate glyph name indices into gscencs.c indices. */
     for (i = 0; i < pstr->size; i++) {
@@ -1277,10 +1278,14 @@
  if (code < 0)
     return code;
  gid[i] = gs_c_name_glyph(gname.data, gname.size);
- if (gid[i] == GS_NO_GLYPH)
-    return_error(gs_error_rangecheck);
+        if (gid[i] == GS_NO_GLYPH) {
+    /* Use global glyph name. */
+    gid[i] = gdata[i];
+    unknown = true;
+ }
     }
-
+    if (unknown)
+        return 0; /* Using global glyph names. */
     /* Find an acceptable encodng. */
     for (ei = 0; gs_c_known_encodings[ei]; ei++) {
  cgp->num_unused_chars = 0;

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Ghostscript patches and packaging

Mats Bengtsson-4
Have you made sure to search the mailing list archives of both
bug-lilypond and liliypond-devel? I'm pretty sure you can find
an explanation of the patch there.

Also, when talking about Ghostscript versions, note that there
are two parallel sets of versions, the GNU and the AFPL versions.

   /Mats

Quoting Quentin Spencer <[hidden email]>:

> Hello everyone,
>
> I'm an occasional user of lilypond, and new to this list. I'm also
> the maintainer of a few packages in Fedora Extras, and I'm
> considering submitting lilypond for inclusion there. Initially I
> built everything (version 2.8.1) from source and I ran into the PDF
> file size problem that apparently several others have noticed. I
> downloaded the GUB installer and the file sizes are sane again.
> However, I would really like to get things working properly with RPM
> packages. At this point, mftrace is the only dependency that is not
> in Fedora Core or Extras, so I would need to submit packages for
> mftrace and lilypond.
>
> Anyway, I saw the patch that someone posted on the bug list for
> GhostScript 8.53. I backported the patch (basically the only
> difference is the line numbers) to the version of 8.15 that is
> currently in Fedora, and amazingly, my PDFs are now back down to
> their small sizes again. I have attached the patch for anyone
> interested. It should be noted that while this lilypond setup has
> been working for me, it fails when building the documentation, so
> clearly there are special cases that gs 8.15 can't handle. I would
> like to put a request in Fedora's bugzilla to add this patch,
> however, I would like to present a convincing reason for why it needs
> to be included. Can someone give an explanation of what the patch
> does and where it came from (is this already in upstream CVS, for
> example)?
>
> -Quentin
>
>





_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Ghostscript patches and packaging

Jan Nieuwenhuizen
In reply to this post by Quentin Spencer
Quentin Spencer writes:

> I'm an occasional user of lilypond, and new to this list. I'm also the
> maintainer of a few packages in Fedora Extras, and I'm considering
> submitting lilypond for inclusion there.

That's grand.

> currently in Fedora, and amazingly, my PDFs are now back down to their
> small sizes again.

> so clearly there are special cases that gs 8.15 can't handle.

Indeed.  8.50 is now GPL, so that should be used.

> I would like to put a request in Fedora's bugzilla to add this
> patch, however, I would like to present a convincing reason for why
> it needs to be included. Can someone give an explanation of what the
> patch does and where it came from (is this already in upstream CVS,
> for example)?

Yes, have a look at ghostscript bugzilla.  If I'm not mistaken,
without this patch ghostscript will include a copy of the/a font for
each unknown local glyph.  So, smaller PDFs are not really something
to be amazed about ;-)

But, there are more patches that GUB/ghostscript uses, one for windows,
two build patches and most relevant:

    ghostscript-8.50-ttf.patch:
    Bug 688154 "TTF file fails to load".

Jan.

--
Jan Nieuwenhuizen <[hidden email]> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user