[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Peculiar Hinting / Rendering Behavior
From: |
Alexei Podtelezhnikov |
Subject: |
Re: [ft-devel] Peculiar Hinting / Rendering Behavior |
Date: |
Sun, 7 Feb 2016 22:48:20 -0500 |
>>> ftgrid -f 4420 19 msmincho.ttc
> Interesting. Can you investigate this in more detail?
It turns out that it is very easy to reproduce with other fonts. Take
a look at a well hinted font like Times or Arial and look at boxy
glyphs like +,=,#,4,F,H, while turning anti-aliased rendering off.
There are plenty of dropped out lines. The problem is that ftgrid
places the scaled outline points at the pixel boundaries, then the
stroker covers only a fraction of pixels and becomes prone to dropouts
when anti-aliasing is off. It really is not the stoker fault. I think
the correct solution is the following patch that places points at the
center of pixels. I am talking about actual pixels, not grid lines.
@@ -593,8 +592,8 @@
FT_Vector* vec = &gimage->points[nn];
- vec->x = (FT_F26Dot6)( vec->x * scale );
- vec->y = (FT_F26Dot6)( vec->y * scale );
+ vec->x = 64 * (FT_F26Dot6)( vec->x * st->scale ) + 32;
+ vec->y = 64 * (FT_F26Dot6)( vec->y * st->scale ) + 32;
}
/* stroke then draw it */