Only reference PS fonts if the image includes labels
diff --git a/coders/ps.c b/coders/ps.c
index 1e6d321..5d2d063 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -1439,7 +1439,6 @@
" token pop /y exch def pop",
" currentfile buffer readline pop",
" token pop /pointsize exch def pop",
- " /Times-Roman findfont pointsize scalefont setfont",
(const char *) NULL
},
*const PostscriptEpilog[]=
@@ -1810,13 +1809,18 @@
}
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
- for (j=(ssize_t) MultilineCensus(value)-1; j >= 0; j--)
{
- (void) WriteBlobString(image," /label 512 string def\n");
- (void) WriteBlobString(image," currentfile label readline pop\n");
- (void) FormatLocaleString(buffer,MagickPathExtent,
- " 0 y %g add moveto label show pop\n",j*pointsize+12);
- (void) WriteBlobString(image,buffer);
+ (void) WriteBlobString(image,
+ " /Times-Roman findfont pointsize scalefont setfont\n");
+ for (j=(ssize_t) MultilineCensus(value)-1; j >= 0; j--)
+ {
+ (void) WriteBlobString(image," /label 512 string def\n");
+ (void) WriteBlobString(image,
+ " currentfile label readline pop\n");
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ " 0 y %g add moveto label show pop\n",j*pointsize+12);
+ (void) WriteBlobString(image,buffer);
+ }
}
for (s=PostscriptEpilog; *s != (char *) NULL; s++)
{
diff --git a/coders/ps2.c b/coders/ps2.c
index f4105d9..04f404e 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -357,7 +357,6 @@
" token pop /y exch def pop",
" currentfile buffer readline pop",
" token pop /pointsize exch def pop",
- " /Helvetica findfont pointsize scalefont setfont",
(const char *) NULL
},
*const PostscriptEpilog[]=
@@ -657,13 +656,18 @@
}
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
- for (j=(ssize_t) MultilineCensus(value)-1; j >= 0; j--)
{
- (void) WriteBlobString(image," /label 512 string def\n");
- (void) WriteBlobString(image," currentfile label readline pop\n");
- (void) FormatLocaleString(buffer,MagickPathExtent,
- " 0 y %g add moveto label show pop\n",j*pointsize+12);
- (void) WriteBlobString(image,buffer);
+ (void) WriteBlobString(image,
+ " /Helvetica findfont pointsize scalefont setfont\n");
+ for (j=(ssize_t) MultilineCensus(value)-1; j >= 0; j--)
+ {
+ (void) WriteBlobString(image," /label 512 string def\n");
+ (void) WriteBlobString(image,
+ " currentfile label readline pop\n");
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ " 0 y %g add moveto label show pop\n",j*pointsize+12);
+ (void) WriteBlobString(image,buffer);
+ }
}
for (q=PostscriptEpilog; *q; q++)
{
@@ -693,7 +697,7 @@
bounds.y2=(double) geometry.y+(geometry.height+text_size)-1;
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
- (void) WriteBlobString(image,"%%PageResources: font Times-Roman\n");
+ (void) WriteBlobString(image,"%%PageResources: font Helvetica\n");
if (LocaleCompare(image_info->magick,"PS2") != 0)
(void) WriteBlobString(image,"userdict begin\n");
start=TellBlob(image);