diff options
author | Tor Andersson <tor@ghostscript.com> | 2011-02-23 11:37:02 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2011-02-23 11:37:02 +0000 |
commit | c889fcd06f1256571342368d40d375e44045dcd3 (patch) | |
tree | 1ed779534cdaaf84e6c3577d214bb227e0e210c4 /fitz/res_font.c | |
parent | ff02027edf3aa04dbf9d57a3778025be2640b09d (diff) | |
download | mupdf-c889fcd06f1256571342368d40d375e44045dcd3.tar.xz |
Remove fthint workaround for DynaLab fonts, since that is now a part of freetype.
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r-- | fitz/res_font.c | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c index 1df8b2e6..4efdd0e4 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -17,7 +17,6 @@ fz_newfont(void) font->ftface = nil; font->ftsubstitute = 0; - font->fthint = 0; font->ftfile = nil; font->ftdata = nil; @@ -287,43 +286,32 @@ fz_renderftglyph(fz_font *font, int gid, fz_matrix trm) fz_warn("freetype setting character size: %s", ft_errorstring(fterr)); FT_Set_Transform(face, &m, &v); - if (font->fthint) - { - /* - Enable hinting, but keep the huge char size so that - it is hinted for a character. This will in effect nullify - the effect of grid fitting. This form of hinting should - only be used for DynaLab and similar tricky TrueType fonts, - so that we get the correct outline shape. - */ #ifdef GRIDFIT - /* If you really want grid fitting, enable this code. */ - float scale = fz_matrixexpansion(trm); - m.xx = trm.a * 65536 / scale; - m.xy = trm.b * 65536 / scale; - m.yx = trm.c * 65536 / scale; - m.yy = trm.d * 65536 / scale; - v.x = 0; - v.y = 0; - - fterr = FT_Set_Char_Size(face, 64 * scale, 64 * scale, 72, 72); - if (fterr) - fz_warn("freetype setting character size: %s", ft_errorstring(fterr)); - FT_Set_Transform(face, &m, &v); -#endif - fterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP); - if (fterr) - fz_warn("freetype load glyph (gid %d): %s", gid, ft_errorstring(fterr)); - } - else + /* If you really want grid fitting, enable this code. */ + float scale = fz_matrixexpansion(trm); + m.xx = trm.a * 65536 / scale; + m.xy = trm.b * 65536 / scale; + m.yx = trm.c * 65536 / scale; + m.yy = trm.d * 65536 / scale; + v.x = 0; + v.y = 0; + + fterr = FT_Set_Char_Size(face, 64 * scale, 64 * scale, 72, 72); + if (fterr) + fz_warn("freetype setting character size: %s", ft_errorstring(fterr)); + FT_Set_Transform(face, &m, &v); + + fterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP); + if (fterr) + fz_warn("freetype load glyph (gid %d): %s", gid, ft_errorstring(fterr)); +#else + fterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING); + if (fterr) { - fterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING); - if (fterr) - { - fz_warn("freetype load glyph (gid %d): %s", gid, ft_errorstring(fterr)); - return nil; - } + fz_warn("freetype load glyph (gid %d): %s", gid, ft_errorstring(fterr)); + return nil; } +#endif fterr = FT_Render_Glyph(face->glyph, ft_render_mode_normal); if (fterr) |