<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] add support for subpixel rendering support for cairo backend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95485">95485</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[patch] add support for subpixel rendering support for cairo backend
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>broken.zhou@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=123900" name="attach_123900" title="proposed patch">attachment 123900</a> <a href="attachment.cgi?id=123900&action=edit" title="proposed patch">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=95485&attachment=123900'>[review]</a>
proposed patch

The patch poppler-subpixel.patch provides a new function called
poppler_page_support_subpixel_rendering for glib/cairo backend for poppler.
This function checks whether a PDF page could be subpixel-rendered. The reason
that subpixel rendering is not implemented in a PDF viewer is that glyphs
subpixel rendering cannot easily support transparent background, i.e., the
background color much be known when the glyphs are rendered. By default, PDF
has a transparent background. In most case, one can fill white to the
background before the rendering of glyphs to workaround this problem. However,
PDF file format has a feature called blend modes. Example can be downloaded
from [<a href="https://github.com/mozilla/pdf.js/blob/master/test/pdfs/blendmode.pdf">https://github.com/mozilla/pdf.js/blob/master/test/pdfs/blendmode.pdf</a>].
Some blend modes will generate different results when drawing on transparent or
white background. Therefore, filling color into background is incorrect in this
case. The new added function poppler_page_support_subpixel_rendering checks
whether it is safe to fill some color into background by traversing current
page and check whether transparent background and colored background are
distinguishable by checking all the blend modes used before rendering. If it
returns true, the application can call cairo_paint to fill the background and
cairo_font_options_set_antialias to enable the subpixel rendering for cairo.

See glib/demo/render.c for an example how to use the subpixel rendering
feature.</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>