summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--draw/draw_glyph.c4
-rw-r--r--fitz/fitz.h2
-rw-r--r--fitz/res_font.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c
index 110a7a25..b8f69ce3 100644
--- a/draw/draw_glyph.c
+++ b/draw/draw_glyph.c
@@ -20,6 +20,7 @@ struct fz_glyph_key_s
int c, d;
unsigned short gid;
unsigned char e, f;
+ int aa;
};
void
@@ -128,6 +129,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color
key.d = ctm.d * 65536;
key.e = (ctm.e - floorf(ctm.e)) * 256;
key.f = (ctm.f - floorf(ctm.f)) * 256;
+ key.aa = fz_get_aa_level(ctx);
fz_lock(ctx, FZ_LOCK_GLYPHCACHE);
val = fz_hash_find(ctx, cache->hash, &key);
@@ -145,7 +147,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color
{
if (font->ft_face)
{
- val = fz_render_ft_glyph(ctx, font, gid, ctm);
+ val = fz_render_ft_glyph(ctx, font, gid, ctm, key.aa);
}
else if (font->t3procs)
{
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 6427537f..1ec1eb97 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -1747,7 +1747,7 @@ fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);
void fz_drop_glyph_cache_context(fz_context *ctx);
void fz_purge_glyph_cache(fz_context *ctx);
-fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm);
+fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa);
fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model);
fz_pixmap *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *state);
fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_colorspace *model);
diff --git a/fitz/res_font.c b/fitz/res_font.c
index e4a4d23a..f6207e80 100644
--- a/fitz/res_font.c
+++ b/fitz/res_font.c
@@ -387,7 +387,7 @@ fz_copy_ft_bitmap(fz_context *ctx, int left, int top, FT_Bitmap *bitmap)
/* The glyph cache lock is always taken when this is called. */
fz_pixmap *
-fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm)
+fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int aa)
{
FT_Face face = font->ft_face;
FT_Matrix m;
@@ -421,7 +421,7 @@ fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm)
fz_warn(ctx, "freetype setting character size: %s", ft_error_string(fterr));
FT_Set_Transform(face, &m, &v);
- if (fz_get_aa_level(ctx) == 0)
+ if (aa == 0)
{
/* If you really want grid fitting, enable this code. */
float scale = fz_matrix_expansion(trm);