[Poppler-bugs] [Bug 95485] New: [patch] add support for subpixel rendering support for cairo backend

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 19 08:18:35 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=95485

            Bug ID: 95485
           Summary: [patch] add support for subpixel rendering support for
                    cairo backend
           Product: poppler
           Version: unspecified
          Hardware: All
                OS: Linux (All)
            Status: NEW
          Severity: enhancement
          Priority: medium
         Component: cairo backend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: broken.zhou at gmail.com

Created attachment 123900
  --> https://bugs.freedesktop.org/attachment.cgi?id=123900&action=edit
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 [https://github.com/mozilla/pdf.js/blob/master/test/pdfs/blendmode.pdf].
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20160519/0c130cc2/attachment.html>


More information about the Poppler-bugs mailing list