mupdf和freetype:为什么字体模糊? [英] mupdf and freetype: why are fonts blurred?

查看:709
本文介绍了mupdf和freetype:为什么字体模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果字体模糊(即使使用抗锯齿),我也想知道是mupdf或freetype2的错误。这是在Windows上使用pdfdraw实用程序。

解决方案

正如我在我的其他答案中提到的,字形描述是由线和曲线。问题是这些线条和曲线不能确保小尺寸的高保真字形渲染,因为没有太多空间来表示字形。在这种情况下,使用一种名为字体提示的技术来呈现可读的字形。 TrueType字体在字体文件中包含这样的提示信息。 Hinting基本上指定字体轮廓如何适应像素网格,您可以阅读更多此处。另一种改进字体渲染的方法是在液晶显示器上使用子像素渲染



您在渲染中注意到的差异来自于Adobe Reader使用提示信息(以及其他专有的渲染方法),而mupdf只是渲染线条和曲线。 mupdf使用FreeType进行字体渲染,而FreeType可能不会默认使用提示(我可能会在这里弄错)。据我所知,FreeType支持字体提示,但也许你需要在创建时指定它,但我不确定。 mupdf也可能初始化FreeType库而不提示支持,但是我不知道这些细节。

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.

解决方案

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.

这篇关于mupdf和freetype:为什么字体模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆