View Single Post
Old 06-28-2008, 08:09 AM   #1
caritas
Enthusiast
caritas doesn't littercaritas doesn't litter
 
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
Subtitute font when rending PDF in small screen

The effect of PDF rending on small screen device (like sony ereader) is not good now. One reason is that the font used in PDF is designed for printing (> 300 dpi) not for low-resolution small screen (166dpi for ereader).

Considering desktop PC font rending, ordinary resolution of desktop PC is 72dpi or 96dpi, but even the small font of menu is quite readable. And the effect of PDF rending on PC is worse than menu for same font size. One reason is that the menu font is designed for low-resolution.

So if the font in PDF is substituted with font for low-resolution, the rending effect will be better. Fortunately, the font substitution function is available in libpoppler (and xpdf), but it is not configurable now. As an experiment, I substitute Times by "Bitstream Vera Sans" through hard-coding that in libpopper/poppler/GfxFont.cc.

The rending effect is attached.

1. chap6.pdf is the example PDF.
2. org.png is rended with original PDF font (Times).
3. nf.png is rended with "Bitstream Vera Sans".
4. pl.png is rended with pdf2lrf

The patch is attached too as ttf.patch

Known issues:

- "fi" is not displayed correctly with replaced font because of font encoding. This can be resolved by modifying the font with tools such as "fontforge".
Attached Thumbnails
Click image for larger version

Name:	org.png
Views:	433
Size:	31.4 KB
ID:	13891   Click image for larger version

Name:	nf.png
Views:	394
Size:	31.6 KB
ID:	13892   Click image for larger version

Name:	pl.png
Views:	426
Size:	37.7 KB
ID:	13893  
Attached Files
File Type: pdf chap6.pdf (267.9 KB, 300 views)
caritas is offline   Reply With Quote