<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [PATCH] Arthur support for Type3 fonts -- alternative implementation"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=106150">106150</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PATCH] Arthur support for Type3 fonts -- alternative implementation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

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

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

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

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

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

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>arthur backend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>oliver.sander@tu-dresden.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=138952" name="attach_138952" title="Patch that implements type3 font support in Arthur backend using beginType3Char/endType3Char">attachment 138952</a> <a href="attachment.cgi?id=138952&action=edit" title="Patch that implements type3 font support in Arthur backend using beginType3Char/endType3Char">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=106150&attachment=138952'>[review]</a>
Patch that implements type3 font support in Arthur backend using
beginType3Char/endType3Char

The attached patch contains an alternative implementation of type3 font support
for the Arthur backend, which uses the beginType3Char/endType3Char methods.  It
is a lot simpler---just compare the size of this patch with the one from 

  <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [PATCH] Arthur support for Type3 fonts"
   href="show_bug.cgi?id=105772">https://bugs.freedesktop.org/show_bug.cgi?id=105772</a>

The new patch is orthogonal to the old one.  You can have them both together,
and switch between them using the return value of the interpretType3Chars
method (false: old patch, true: new patch).  I think we need to compare the
two: the new patch is much simpler, but the old one does some caching and
may(!) be faster.  

Unfortunately, the patch triggers a problem which I think is a bug in Gfx.cc,
but it may also be insufficient understanding on my part.  With the patch
applied, poppler will only render the first type3 glyph, and all others remain
invisible.  The problem is Gfx.cc:4017:

      restoreStateStack(savedState);
      // GfxState::restore() does *not* restore the current position,
      // so we deal with it here using (curX, curY) and (lineX, lineY)
      curX += tdx;
      curY += tdy;
      state->moveTo(curX, curY);
      out->updateCTM(state, 0, 0, 0, 0, 0, 0);

This code is executed after the call to endType3Char.  However, transforming
the CTM by a zero matrix results in a scale factor of zero, and all glyphs are
henceforth reduced to a single point.  Therefore, that call to updateCTM looks
very fishy to me.  When I remove it, the type3 support in my patch works.

Now, the call to updateCTM is there for a reason.  Thomas Freitag introduced it
in 182abe4ed5c0773073c6751a26a7c4e40e99e02e to fix <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Text sized and positioned incorrectly"
   href="show_bug.cgi?id=95344">bug #95344</a>.  I admit haven't
looked further into that issue.  Thomas, if you are reading this: do you
remember why you had to multiply the CTM by 0?

Incidentally, in my understanding of the updateCTM method, the line Gfx.cc:3972

      out->updateCTM(state, 1, 0, 0, 1, 0, 0);

is useless, because it simply multiplies the current CTM by an identity matrix.</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>