- Wrapper: A set of bindings to make using the Poppler library easier for a given toolkit. For instance, Okular uses the Qt4 wrapper, and Evince uses the Glib wrapper.
Backend: An implementation that actually performs the rendering of the PDF. Currently, there are two complete backends in Poppler:
- Splash: a low-level backend inherited from Xpdf. This code is getting old now, and it’s difficult to introduce major changes (such as introducing subpixel rendering).
- Cairo: performs all its rendering using the Cairo library. This is where most of the interesting development is happening now.
Purpose of this Patchset
Currently, the default backend for the Qt4 wrapper (used by Okular) is Splash. Unfortunately, Splash does not support subpixel rendering of fonts, so those of us using KDE are stuck with somewhat ugly-looking fonts. This patchset adds support for the Cairo backend to the Qt4 wrapper. It also forces subpixel rendering in the Cairo backend. The upshot of this is that we get beautiful fonts in Okular.
Why isn’t this is Poppler already?
The Poppler developers feel that the introduction of a dependency on Cairo to the Qt4 wrapper (even an optional dependency) is politically controversial, and are not willing to merge it. For those of us who already have Cairo installed (e.g. for Firefox, Inkscape, Scribus, etc…), and are more worried about beautiful PDFs than toolkit politics, this patchset is here for us :) If you’d like to join the effort in convincing the developers that this is worthwhile, feel free to wade in on the Bugzilla report.
There is a partly-implemented backend available in Poppler that uses Arthur, the Qt4 2D rendering interface. Sadly, it is nowhere near complete, and at the time of writing I’m not aware of anyone working on it. This patchset is a “quick fix” for the problem of font rendering in Okular. The Arthur backend might be a more elegant, long-term Qt-only solution, if it were completed.
Organisation of this Repository
This repository tracks the official Poppler repository (git://git.freedesktop.org/git/poppler/poppler), and all Poppler’s tags are present in this repository. However, my branches are a little different:
- Contains a set of patch files that may be applied to the current Poppler release. This branch does not share any ancestor with the Poppler source and is here to provide easy access to the patch files.
- Follows the maintenance branch (e.g. poppler-0.12), from which maintenance releases are tagged (e.g. poppler-0.12.1).
- Qt4-Cairo patchset applied on top of maint. This branch is rebased on top of maint whenever a new Poppler release is tagged.
Autotools / CMake
IMPORTANT: I test this patchset with CMake. It’s been reported that it breaks the Autotools build. That’s not something I’m very interested in fixing, but if you are, I’ll happily merge a fix. In the mean time, you’ll need to build with CMake:
$ cd <source-dir>
$ mkdir build
$ cd build
$ cmake ..
$ ccmake .. # (for any configuration tweaks)
How can I generate my own patch files?
- Clone the repository:
git clone git://github.com/giddie/poppler-qt4-cairo-backend.git
- Change into the directory and checkout the the qt4-lcd branch, which tracks Poppler’s actual releases:
cd poppler-qt4-cairo-backend git checkout -b qt4-lcd origin/qt4-lcd
- Generate patch files for all the commits between maint and the tip of the current branch:
git format-patch origin/maint
- The generated patch files should be applied in numerical order to Poppler’s official source package. If you have difficulty, please get in touch—I’d be more than happy to help :)