I would like to know if it is mupdf's or freetype2's fault if the font is blurred (even with antialiasing). This is using the pdfdraw utility on Windows.
-
1That's a very brief question. Would you add some detail/background, and some code in case you're doing something wrongly? (It's not my subject area, but in general good questions are a bit more expansive). – halfer May 15 '12 at 19:05
-
@halfer I cannot reproduce it now but a same sized page displayed in Adobe Reader was of good quality with no blurred font even at small font size. – P5music May 15 '12 at 19:22
-
Do you mean that a PDF was rendered correctly in Adobe Reader, but with incorrect fonts and/or blurring in another application? – halfer May 15 '12 at 19:24
-
@halfer I mean that the pdfdraw utility (mupdf) yielded not satisfactory png images (blurred text) for the pdf pages, if compared with same size screen rendering from Adobe Reader. – P5music May 15 '12 at 19:28
-
1OK, thanks. I've edited the question, as you'd mentioned 'using a wrong font' twice, when I think you meant that the output was not as _sharp_ as it should be. If you are still looking for an answer for this question, try to reproduce it, and screenshot your output together with Reader output. – halfer May 15 '12 at 19:33
-
@halfer yes...but it was a subtle hint because I was said it is a bad guessing of fonts happening. It is also possible that it was Adobe Reader that changed the font in favour of one more intellegible at small font sizes I think. – P5music May 15 '12 at 19:36
-
Aha - so it was Reader using the 'wrong' font `;-)`. – halfer May 15 '12 at 19:37
-
@halfer I mean that I think Adobe Reader feels free to change the font when at small zoom levels the difference is not noticeable as to appearance but the result is thus satisfactory for the user to read comfortably. But I admit this is just my idea. – P5music May 15 '12 at 19:41
-
1To the best of my knowledge Adobe Acrobat does *not* substitute fonts at small point size. Also MuPDF uses FreeType and the 'hinting' process for TrueType fonts means that you basically can't do without it (the same is not true for Type 1/CFF fonts). If P5music can give a specific example then I can get the problem looked at, but speculation without a concrete example isn't going to come to a resolution. – KenS May 16 '12 at 07:01
-
1say what? antialiasing IS blurring! – zvrba May 16 '12 at 14:03
1 Answers
As I mentioned in my other answer, the glyph description is composed of lines and curves. The problem is these lines and curves cannot ensure high fidelity glyph rendering at small sizes because there is not much space to represent the glyph. In this situation a technique called font hinting is used to render readable glyphs. TrueType fonts include such hinting information in the font file. Hinting basically specifies how the font outlines are fitted to the pixel grid, you can read more here. Another method to improve the font rendering is to use subpixel rendering on LCD displays.
The difference you noticed in rendering comes from the fact that Adobe Reader uses the hinting information (and other proprietary rendering methods) while mupdf simply renders the lines and curves. mupdf uses FreeType for font rendering and FreeType might not use hinting by default (I might be mistaken here). As far as I know FreeType supports font hinting but maybe you need to specify this when you built it, I'm not sure. It is also possible that mupdf initializes the FreeType library without hinting support but I do not know these details.