<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - pdftops - some fonts are encoded incorrectly in level2 postscript"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=63963">63963</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>pdftops - some fonts are encoded incorrectly in level2 postscript
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>korobkin+lpad@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=78523" name="attach_78523" title="test.pdf - original pdf file">attachment 78523</a> <a href="attachment.cgi?id=78523&action=edit" title="test.pdf - original pdf file">[details]</a></span>
test.pdf - original pdf file

Hi team, 

This sample PDF file, when converted to PS level2 by pdftops 0.22.3, cannot be
processed by a printer or by GhostScript interpreter because it chokes on
embedded fonts and quits with rangecheck error in xyshow function. 

The offending part of PS code is this:

/F9_0 13.3333 Tf
(\012\355)
[13.3333
0] Tj

Nice folks at GhostScript explained to me that after defining the type42 font
/DejaVuSans_00, the ps code then does this:

16 dict begin
/FontName /DejaVuSans def
/FontType 0 def
/FontMatrix [1 0 0 1 0 0] def
/FMapType 2 def
/Encoding [
0
] def
/FDepVector [
/DejaVuSans_00 findfont
] def
FontName currentdict end definefont pop

As you can see, the font has a single dependent font, and it has map
type 2. Map type 2 means the () string passed to show has a font number
and a character number.  So the string (\012\355) means sub-font 10
character 247, hence the rangecheck error.

In the PDF, all of the falls to F0 (Arial) are of the form:

/F0 13.3333 Tf
1 0 0 -1 10 18 Tm
<0035> Tj

but the calls to F1 (DejaVu Sans) look like:

/F1 13.3333 Tf
1 0 0 -1 139 18 Tm
<0AED> Tj

So pdftops is copying the <0AED> literally to (\012\355), but not
embedding enough subfonts.  The other fonts coincidentally all use
glyphs in <0000>--<00FF> and miss the bug.

I'm attaching both PDF and PS files for your consideration.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>