6

I need to render an SVG image with very small text, so I would like to use subpixel hinting, like so:

enter image description here

Inkscape doesn't provide an option to use subpixel hinting for PNG export, neither does the GIMP. However, I get excellent results when I view the image in EOG, the Gnome Image Viewer.

How do I use whatever Image Viewer uses to render my SVGs to PNG files with transparency?

Since subpixel hinting depends on the order of red, green and blue subpixels, EOG disables it when I use the Save As button. I can take a screenshot, but then I don't have transparency in my images. Is there any piece of software that can render text to raster images with anti-aliasing and subpixel hinting?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Stefano Palazzo
  • 85,787
  • 45
  • 210
  • 227
  • Probably in EOG, rendering is done by system (you have set it for LCD) so that's expected (your SVG is text, not bitmap). What is the font size you want to render? – zetah Jan 06 '12 at 22:20
  • Any font size really, but it's particularly bad at less than 18pt, unbearable below 9pt. – Stefano Palazzo Jan 21 '12 at 20:26

2 Answers2

3

http://libregraphicsworld.org/blog/entry/getting-crisper-text-out-of-inkscape should help you :)

This blog post advises to select File → Save a Copy → Cairo PNG for cairo-based rendering.

Zanna
  • 69,223
  • 56
  • 216
  • 327
prokoudine
  • 640
  • 5
  • 4
  • When the link goes down: This blog post advises to select "File → Save a Copy → Cairo PNG" for cairo-based rendering. It certainly looks different, and a little bit better (no subpixel rendering). Thanks! – Stefano Palazzo Jan 21 '12 at 20:12
2

Anyway, I wanted to suggest SubLCD as I've used it in the past, but as it works with PPM images I just don't remember how I did transparency, and it's unusable for small fonts as is

Here is quick and dirty solution (I don't know about your source files and if this is usable to you, but in general works fine):

Render SVG on screen with EOG or else. Capture screenshot then paste it in Gimp and apply Colors > Color to Alpha on white (screenshot background) - result transparent PNG with subpixel rendered text

Zanna
  • 69,223
  • 56
  • 216
  • 327
zetah
  • 9,583
  • 10
  • 52
  • 71