Ralph Giles | 2 Mar 09:18 2009

Re: [gs-cvs] rev 9514 - trunk/gs/psi

On Sun, Mar 1, 2009 at 10:13 PM,  <alexcher <at> ghostscript.com> wrote:

> When /JBIG2Decode filter takes /.jbig2globalctx parameter and retains a
> pointer to it, the filter must not be allocated in global memory if the
> parameter is local. Bug 690308.

Oops. Thanks, Alex.

 -r
Daniel Spannbauer | 4 Mar 11:23 2009
Picon

Embedding ttf-font in GS

Hello,

I'm using GS 8.15 on a SuSE 10.2-System.
Now, I nedd a ttf-Font in GS.
The font is named han_nom_a.ttf
So, I put these line in Fontmap.GS in /usr/share/ghostscript/8.15/lib:

/hannom-a   (/usr/share/ghostscript/fonts/han_nom_a.ttf)  ;

But when I try to put a ps thru GS, I get:

              Loading NimbusRomNo9L-Regu font from 
/usr/share/ghostscript/fonts/n021003l.pfb... 2568236 1261266 1820196 
518519 2 done.
Loading hannom-a font from /usr/share/ghostscript/fonts/han_nom_a.ttf... 
ERROR: /rangecheck in --string--
Operand stack:
    hannom-a   Font   hannom-a   518871   hannom-a   --nostringval-- 
hannom-a   (/usr/share/ghostscript/fonts/han_nom_a.ttf)   false 
--nostringval--   101098   101098
Execution stack:
    %interp_exit   .runexec2   --nostringval--   --nostringval-- 
--nostringval--   2   %stopped_push   --nostringval--   --nostringval-- 
   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop 
1   3   %oparray_pop   --nostringval--   1   3   %oparray_pop   1   3 
%oparray_pop   .runexec2   --nostringval--   --nostringval-- 
--nostringval--   2   %stopped_push   --nostringval--   1   3 
%oparray_pop   2   3   %oparray_pop   --nostringval--   --nostringval-- 
   --nostringval--   --nostringval--   --nostringval--   --nostringval-- 
   false   1   %stopped_push   5   4   %oparray_pop   --nostringval-- 
(Continue reading)

Daniel Spannbauer | 4 Mar 11:35 2009
Picon

Re: Embedding ttf-font in GS


ademmler schrieb:
> hi,
> 
> can you try to use GS 8.63. This is much newer.
> 
> greetings Alexander

Shure, I can try this, but then I have to update a huge ammount of PCs, 
so I hoped it will be possible with 8.15

regards

Daniel

> 
> Am 04.03.2009 um 11:23 schrieb Daniel Spannbauer:
> 
>> Hello,
>>
>> I'm using GS 8.15 on a SuSE 10.2-System.
>> Now, I nedd a ttf-Font in GS.
>> The font is named han_nom_a.ttf
>> So, I put these line in Fontmap.GS in /usr/share/ghostscript/8.15/lib:
>>
>> /hannom-a   (/usr/share/ghostscript/fonts/han_nom_a.ttf)  ;
>>
>> But when I try to put a ps thru GS, I get:
>>
>>
(Continue reading)

Ray Johnston | 4 Mar 14:44 2009

Re: Embedding ttf-font in GS

Hello Daniel,

Actually the latest release is 8.64 (not 8.63). While you are
welcome to search the "doc/History8.htm" (or doc/Details8.htm)
for likely fixes, we can't really support 8.15. It is WAY too
old.

Best Regards,
Ray Johnston

Daniel Spannbauer wrote:
Hello,

I'm using GS 8.15 on a SuSE 10.2-System.
Now, I nedd a ttf-Font in GS.
The font is named han_nom_a.ttf
So, I put these line in Fontmap.GS in /usr/share/ghostscript/8.15/lib:

/hannom-a   (/usr/share/ghostscript/fonts/han_nom_a.ttf)  ;

But when I try to put a ps thru GS, I get:


             Loading NimbusRomNo9L-Regu font from /usr/share/ghostscript/fonts/n021003l.pfb... 2568236 1261266 1820196 518519 2 done.
Loading hannom-a font from /usr/share/ghostscript/fonts/han_nom_a.ttf... ERROR: /rangecheck in --string--
Operand stack:
   hannom-a   Font   hannom-a   518871   hannom-a   --nostringval-- hannom-a   (/usr/share/ghostscript/fonts/han_nom_a.ttf)   false --nostringval--   101098   101098
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval-- --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop 1   3   %oparray_pop   --nostringval--   1   3   %oparray_pop   1   3 %oparray_pop   .runexec2   --nostringval--   --nostringval-- --nostringval--   2   %stopped_push   --nostringval--   1   3 %oparray_pop   2   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   5   4   %oparray_pop   --nostringval-- --nostringval--   --nostringval--   --nostringval--   --nostringval-- %array_continue   --nostringval--   --nostringval--   --nostringval-- %loop_continue   --nostringval--   --nostringval--   --nostringval-- --nostringval--   %loop_continue   --nostringval--   10 --nostringval--   --nostringval--   false   1   %stopped_push --nostringval--   --nostringval--   --nostringval--   --nostringval-- --nostringval--   %array_continue   --nostringval--   --nostringval-- --nostringval--
Dictionary stack:
   --dict:1136/3371(ro)(G)--   --dict:0/20(G)--   --dict:106/200(L)--  --dict:47/65(ro)(G)--   --dict:1136/3371(ro)(G)-- --dict:28/50(ro)(G)--   --dict:15/40(L)--
Current allocation mode is local
Current file position is 295
ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1




Can anybody help me at this point?

Regards

Daniel



_______________________________________________
gs-devel mailing list
gs-devel <at> ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-devel
Paul Smedley | 21 Mar 14:13 2009
Picon

Tips on correct .ps syntax

Hi Guys,

I've been working on getting the OS/2 ports of Ghostscript and CUPS to 
the point where they can be used as a replacement for the printer system 
on OS/2, so that modern printers can be used (as nobody writes native 
printer drivers for OS/2 anymore).

The idea is to use the IBM postscript driver to generate .ps, which is 
routed to CUPS - which in the main works quite well.

Fortunately, IBM did release the source code to their postscript driver 
via the DDK, unfortunately, it does create some buggy .ps code - at 
least the code is available :)

One of the remaining problems is printing things like equations from 
Lotus Wordpro, which require a symbol font.

It seems the IBM postscript code embeds the font in the postscript code, 
but ghostscript doesn't see it correctly.

Wondering if anyone can provide some good links to some postscript code 
references, so I can try and fix the driver?

A sample file that contains just a few equation characters, but renders 
as am empty page in gsview is at http://smedley.info/test.ps

Any feedback appreciated!

Cheers,

Paul
Paul Smedley | 22 Mar 02:48 2009
Picon

Re: Tips on correct .ps syntax

One finding this morning, it seems:
%%DocumentSuppliedResources:
%%+ font Times New Roman
%%+ font Symbol Set

Needs to be:
%%DocumentSuppliedFonts:
%%+ font Times New Roman
%%+ font Symbol Set

which helps with part of the problem, but it 'appears' that the 
Ghostscript copy of Times New Roman is used instead of the embedded copy 
- is there a way to 'force' the use of the supplied font - even though 
Ghostscript has a copy already?

Cheers,

Paul.

Paul Smedley wrote:
> Hi Guys,
> 
> I've been working on getting the OS/2 ports of Ghostscript and CUPS to 
> the point where they can be used as a replacement for the printer system 
> on OS/2, so that modern printers can be used (as nobody writes native 
> printer drivers for OS/2 anymore).
> 
> The idea is to use the IBM postscript driver to generate .ps, which is 
> routed to CUPS - which in the main works quite well.
> 
> Fortunately, IBM did release the source code to their postscript driver 
> via the DDK, unfortunately, it does create some buggy .ps code - at 
> least the code is available :)
> 
> One of the remaining problems is printing things like equations from 
> Lotus Wordpro, which require a symbol font.
> 
> It seems the IBM postscript code embeds the font in the postscript code, 
> but ghostscript doesn't see it correctly.
> 
> Wondering if anyone can provide some good links to some postscript code 
> references, so I can try and fix the driver?
> 
> A sample file that contains just a few equation characters, but renders 
> as am empty page in gsview is at http://smedley.info/test.ps
> 
> Any feedback appreciated!
> 
> Cheers,
> 
> Paul
> _______________________________________________
> gs-devel mailing list
> gs-devel <at> ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-devel
Ken Sharp | 21 Mar 16:55 2009

Re: Tips on correct .ps syntax

Hi Paul,

At 22:58 21/03/2009 +0945, Paul Smedley wrote:

>It seems the IBM postscript code embeds the font in the postscript code, 
>but ghostscript doesn't see it correctly.
>
>Wondering if anyone can provide some good links to some postscript code 
>references, so I can try and fix the driver?

The classic reference is the Adobe PostScript Language Reference Manual 
(Red Book) which is available on the adobe web site. Unfortunately Adobe 
move everything on this site frequently, so links rapidly go stale, however 
this seems to work today:

http://partners.adobe.com/public/developer/en/ps/psrefman.pdf

The Green and Blue books are also available, Don Lancaster's site is useful 
(http://www.tinaja.com/post01.asp)

>A sample file that contains just a few equation characters, but renders as 
>am empty page in gsview is at http://smedley.info/test.ps

I looked at the job, and I can't see any equation characters in it. It uses 
TimesNewRoman to write 'log25' and does some clipping, doesn't seem to do 
much else. Also the job renders blank, because all the x/y values are 
rather too large, given the CTM in force at the time. This is true for GS 
and Acrobat Distiller. In effect all the objects are drawn off the page or 
clipped out.

I could be mistaken of course, I haven't taken the time to debug the file 
thoroughly.

                                     Ken
Paul Smedley | 23 Mar 01:57 2009
Picon

Re: Tips on correct .ps syntax

Hi Ken,

On Sat, 21 Mar 2009 15:55:01 UTC, Ken Sharp <ken.sharp <at> artifex.com> 
wrote:

> At 22:58 21/03/2009 +0945, Paul Smedley wrote:
> 
> 
> >It seems the IBM postscript code embeds the font in the postscript code, 
> >but ghostscript doesn't see it correctly.
> >
> >Wondering if anyone can provide some good links to some postscript code 
> >references, so I can try and fix the driver?
> 
> The classic reference is the Adobe PostScript Language Reference Manual 
> (Red Book) which is available on the adobe web site. Unfortunately Adobe 
> move everything on this site frequently, so links rapidly go stale, however 
> this seems to work today:
> 
> http://partners.adobe.com/public/developer/en/ps/psrefman.pdf
> 
> The Green and Blue books are also available, Don Lancaster's site is useful 
> (http://www.tinaja.com/post01.asp)
Thanks for the links ;)

> >A sample file that contains just a few equation characters, but renders as 
> >am empty page in gsview is at http://smedley.info/test.ps
> 
> I looked at the job, and I can't see any equation characters in it. It uses 
> TimesNewRoman to write 'log25' and does some clipping, doesn't seem to do 
> much else. Also the job renders blank, because all the x/y values are 
> rather too large, given the CTM in force at the time. This is true for GS 
> and Acrobat Distiller. In effect all the objects are drawn off the page or 
> clipped out.
When I say equation characters I really mean that any document created
using the equation editor in Lotus Wordpro is likely to show the 
problem with blank characters.  In Wordpro at least, these equations 
are objects in the document, so maybe this is where the code is 
getting screwed up in translating that to a position on the page in 
the postscript code.

Can you point me to the too large x/y values? I assume CTM = 
cleartomark?

> I could be mistaken of course, I haven't taken the time to debug the file 
> thoroughly.
You've given me some more to look at - thanks!
--

-- 
Cheers,

Paul.
Ken Sharp | 23 Mar 09:16 2009

Re: Re: Tips on correct .ps syntax

At 00:57 23/03/2009 +0000, Paul Smedley wrote:

> > I looked at the job, and I can't see any equation characters in it. It 
> uses
> > TimesNewRoman to write 'log25' and does some clipping, doesn't seem to do
> > much else. Also the job renders blank, because all the x/y values are
> > rather too large, given the CTM in force at the time. This is true for GS
> > and Acrobat Distiller. In effect all the objects are drawn off the page or
> > clipped out.
>When I say equation characters I really mean that any document created
>using the equation editor in Lotus Wordpro is likely to show the
>problem with blank characters.

Oh, right, I was looking for math symbols ;-)

>   In Wordpro at least, these equations
>are objects in the document, so maybe this is where the code is
>getting screwed up in translating that to a position on the page in
>the postscript code.

Tha would seem very likely, I could tell better if there were some 
non-equation stuff in the file too.

>Can you point me to the too large x/y values?

Well pretty much all of them really, here are some examples:

600 7676 m
857 7676 l
857 7822 l
600 7822 l cp
clip n d2w

...
1440 18514 m
(l) t

If the CTM (see below) was 'properly' scaled, these could be valid numbers, 
but at the time these are executed the CTM is ~ [1 0 0 0.5 0 0], which 
means the x co-ordinates are as you see them, and the y co-ordinates are 
divided by 2. Note that the device-specific CUPS code sets the resolution 
to non-square [720 360]. It looks like the PostScript job expects a square 
600 dpi resolution though:

/dpi 600 def /dpiY 600 def 0 0 translate 72 dpi div 72 dpiY div scale
/mdevice matrix currentmatrix def

Since PS nominally uses 72 points to the inch, this means that the 
rectangular clip path is positioned at ~ lower left = 600,3836 upper right 
= 857, 3911 or 8.3, 53.2 and 11.9, 54.3 inches. The 't' is located at 1440, 
9257 or 20,128.5 inches. All are well of the physical media (unless you use 
very large paper ;-)

>I assume CTM =
>cleartomark?

Nope, the Current Transformation Matrix. This underlies the whole 
PostScript imaging model, its the way user space (which is very large and 
effectively infinitely sub-divisible) is mapped to device space (which has 
discrete pixels). Because PS uses a matrix, you can achieve all kinds of 
useful effects with it.

> > I could be mistaken of course, I haven't taken the time to debug the file
> > thoroughly.
>You've given me some more to look at - thanks!

Since you mentioned above that the equations are separate objects, it looks 
to me like the 'w2d' and 'd2w' routines are possibly where the problem 
arises. w2d creates a 'mxworld' matrix, and sets the CTM to the identity 
([1 0 0 1 0 0] d2w uses the matrix created in w2d. The names hint at 
transforming between two 'spaces'.

If you can create a PostScript file which contains a small amount of 
working text as well as the missing 'equations' it might be easier to tell 
what's happening.

                             Ken
Paul Smedley | 23 Mar 09:49 2009
Picon

Re: Re: Tips on correct .ps syntax

Hi Ken,

On Mon, 23 Mar 2009 08:16:32 UTC, Ken Sharp <ken.sharp <at> artifex.com> 
wrote:

> At 00:57 23/03/2009 +0000, Paul Smedley wrote:
> Oh, right, I was looking for math symbols ;-)

Sorry :)

<lots of really useful stuff snipped but saved :) >

> If you can create a PostScript file which contains a small amount of 
> working text as well as the missing 'equations' it might be easier to tell 
> what's happening.

My pleasure - http://smedley.info/test.jpg shows a screen capture of 
what it _should_ look like.

http://smedley.info/test.ps is the generated postscript

Even the text that does appear is much further down the page than it 
should be - and the TimesNewRoman in the 'equation' doesn't appear.  
Before my latest fixes, the equation symbols didn't appear either :)

Thanks again for your input, I just need to digest it now! :)

--

-- 
Cheers,

Paul.

Gmane