Note that there are some explanatory texts on larger screens.

plurals
  1. POGhostscript - using a font in a form makes it unavailable
    primarykey
    data
    text
    <p>I'm seeing some weird behaviour in Ghostscript 9.06 and am wondering whether it's to do with my PS structure or something else.</p> <p>We have an embedded font defined and then attempt to setup a form and use it as below. Underneath I also have some lines to put text directly on the page without using a form.</p> <pre><code>globaldict begin true setglobal /frm_test &lt;&lt; /FormType 1 /BBox [-842 -842 596 596] /Matrix [1 0 0 1 0 0] /PaintProc { pop /ArialMT 7.0 selectfont 0 0 moveto (Test text form) show } %endPaintProc &gt;&gt; /Form defineresource pop /form_test {/frm_test /Form findresource true setglobal execform false setglobal} bind def %/form_test {/frm_test /Form findresource execform} bind def false setglobal end gsave 10 820 translate form_test grestore /ArialMT 7.0 selectfont 10 800 moveto (Test text normal) show showpage </code></pre> <p>The problem here is that the call to form_test trashes the font definition for both cases - Ghostscript cannot find the named font. If I never call form_test then the second case works.</p> <p>If I swap the /form_test line with the commented out one below it, then it works fine. However what is this line doing? It appears to be forcing the form to operate within the global VM region but I'm not sure why this matters, and why any errors propagate to the following 'selectfont' if they occur.</p> <p>Why can Acrobat Distiller deal with this - is it correct Postscript or not? Thanks.</p> <p>Edit: Apparently changing the surrounding commands to save/restore instead of gsave/grestore prevents the problem from impacting the second text, but this doesn't explain why the font is unknown within the Form. Also I believe gsave/grestore should be sufficient as the form should have no side-effect except on the graphics state.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload