summaryrefslogtreecommitdiff
path: root/source/fitz/font.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-04-06 15:54:30 +0100
committerRobin Watts <robin.watts@artifex.com>2015-04-07 13:22:14 +0100
commitd47fae804572cd0a6cc78e60020e65334a088c0b (patch)
tree809deffd95d60710f8cf1883a24691a2b1de4e1e /source/fitz/font.c
parent281ac672ab3b340008d7509007022336c9ce4277 (diff)
downloadmupdf-d47fae804572cd0a6cc78e60020e65334a088c0b.tar.xz
Use fz_advance_glyph rather than direct FT calls during PDF layout.
Diffstat (limited to 'source/fitz/font.c')
-rw-r--r--source/fitz/font.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index 64cea107..6d703659 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -410,7 +410,7 @@ static fz_matrix *
fz_adjust_ft_glyph_width(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm)
{
/* Fudge the font matrix to stretch the glyph if we've substituted the font. */
- if (font->ft_substitute && font->width_table && gid < font->width_count)
+ if (font->ft_substitute && font->width_table && gid < font->width_count /* && font->wmode == 0 */)
{
FT_Error fterr;
int subw;
@@ -1298,12 +1298,17 @@ static float
fz_advance_ft_glyph(fz_context *ctx, fz_font *font, int gid)
{
FT_Fixed adv;
- int mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
+ int mask;
if (font->ft_substitute && font->width_table && gid < font->width_count)
return font->width_table[gid];
+ mask = FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM;
+ /* if (font->wmode)
+ mask |= FT_LOAD_VERTICAL_LAYOUT; */
+ fz_lock(ctx, FZ_LOCK_FREETYPE);
FT_Get_Advance(font->ft_face, gid, mask, &adv);
+ fz_unlock(ctx, FZ_LOCK_FREETYPE);
return (float) adv / ((FT_Face)font->ft_face)->units_per_EM;
}