diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2020-08-05 08:24:15 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2020-08-05 08:24:15 -0400 |
commit | f9f6adb625c48ef15b5d61a3ac1709a068ea95a3 (patch) | |
tree | d4d84a52d29feab8ab8dc83856613e29bfef5e93 /src/truetype/ttgload.c | |
parent | 3a1f4b7aaa30b05a363c5eac07122a1033699904 (diff) | |
download | freetype2-f9f6adb625c48ef15b5d61a3ac1709a068ea95a3.tar.gz |
[truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND.
For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set
FT_OUTLINE_OVERLAP to render them with direct oversampling, which
mitigates artifacts (see 3bb512bc9f62).
* include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme
with OVERLAP_SIMPLE.
* src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags.
* src/truetype/ttgload.c
(TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE.
(load_truetype_glyph): Retain OVERLAP_COMPOUND.
Diffstat (limited to 'src/truetype/ttgload.c')
-rw-r--r-- | src/truetype/ttgload.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index d2d70a91f..126c1e9f8 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -60,7 +60,7 @@ #define SAME_X 0x10 #define Y_POSITIVE 0x20 /* two meanings depending on Y_SHORT_VECTOR */ #define SAME_Y 0x20 -#define OVERLAP_SIMPLE 0x40 /* we ignore this value */ +#define OVERLAP_SIMPLE 0x40 /* retained as FT_OUTLINE_OVERLAP */ /************************************************************************** @@ -77,7 +77,7 @@ #define WE_HAVE_A_2X2 0x0080 #define WE_HAVE_INSTR 0x0100 #define USE_MY_METRICS 0x0200 -#define OVERLAP_COMPOUND 0x0400 /* we ignore this value */ +#define OVERLAP_COMPOUND 0x0400 /* retained as FT_OUTLINE_OVERLAP */ #define SCALED_COMPONENT_OFFSET 0x0800 #define UNSCALED_COMPONENT_OFFSET 0x1000 @@ -489,6 +489,10 @@ } } + /* retain the overlap flag */ + if ( n_points && outline->tags[0] & OVERLAP_SIMPLE ) + gloader->base.outline.flags |= FT_OUTLINE_OVERLAP; + /* reading the X coordinates */ vec = outline->points; @@ -2183,6 +2187,11 @@ goto Exit; } } + + /* retain the overlap flag */ + if ( gloader->base.num_subglyphs && + gloader->base.subglyphs[0].flags & OVERLAP_COMPOUND ) + gloader->base.outline.flags |= FT_OUTLINE_OVERLAP; } /***********************************************************************/ |