giddie / poppler-cairo-backend

A patchset to enable subpixel rendering of fonts via Cairo in Poppler's Qt wrapper
19 stars 2 forks source link

Suboptimal hinting hardcoded #3

Open amorozov opened 10 years ago

amorozov commented 10 years ago

It seems that cairo uses legacy hinting style and the result is visually suboptimal.

I opened the same PDF (http://doc.akka.io/docs/akka/snapshot/AkkaScala.pdf) in several PDF viewers. Below one may see the results.

here's the snapshot of okular + standard poppler-0.24.3: okular-poppler-std

this is okular + poppler-0.24.4 / qt4-cairo patches: okular-poppler-cairo

and finally the same PDF rendered by Firefox/pdf.js which seems to honor my desktop's font hinting style: firefox-pdfjs

I know, font issues are the most disputable issues - there's a lot of flamewars due to personal tastes and differences in monitor capabilities (e.g. I have different fontconfig/infinality settings in my home and office workstations because the monitors differ significantly).

I also know that cairo-based apps tend to ignore all these "cumbersome" fontconfig things. Certainly different fonts may need some different adjustments, and the final configuration may be rather complex.

Nevertheless I'd like to ask: is there any chance to receive a picture visually comparable with the one from Firefox? Or at least can the code be able to pick up some of my settings somehow (e.g. via Xft.* XResources) ?

Thank you in advance.

Update: I've come across this cairo bug https://bugs.freedesktop.org/show_bug.cgi?id=11838 . The bug has a long history (heh-heh, as usual :)) and even some solutions are provided. Now I'm trying to apply them and check results

giddie commented 10 years ago

I would absolutely accept a patch to make the Cairo backend honour fontconfig. The main work I did personally was the glue between Qt and Cairo. The patch that forces subpixel hinting in the Cairo backend is pretty much just a hack I found on Bugzilla somewhere. I've been hoping that pressure from the Evince crowd and other Cairo backend users would eventually bring official fontconfig support in Poppler-Cairo. I don't have much time to look into this these days, but if you can get hold of a patch that works, I'm very interested.

amorozov commented 10 years ago

Well, I've checked the combination of patched cairo + patched poppler, and couldn't get satisfactory results for Okular out of the box (although Chromium now renders fonts just fine). I'm going to inspect the cairo patch and deduce how cairo font engine should be configured exactly to make actual use of the patch.

giddie commented 10 years ago

This is where I found the original Poppler subpixel-rendering patch: https://bugs.freedesktop.org/show_bug.cgi?id=3307