[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Severe rendering bug
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] Severe rendering bug |
Date: |
Mon, 02 Jan 2012 22:40:03 +0100 (CET) |
>> This is a bug in the hinting instructions of DejaVu for this glyph.
>> The setup of the projection vector for the affected IP instructions
>> is bad. I suggest that you make a bug report.
>
> I'm certainly not an expert, but I think you might be wrong, and
> that this actually is a bug in the freetype hinter, specifically in
> the IP instruction in the face of a non-square font size and
> non-orthogonal projection vectors.
Good catch! This is indeed a possibility.
> I just investigated this today with no prior knowledge of the
> hinting language, so I can of course be horribly wrong. The
> pictures you attached look like output from Fontforge which uses the
> Freetype hinting engine, so it would of course have the same bugs.
Correct.
> The TrueType Viewer Tool on the other hand has its own hinting
> interpreter, and it does not have any of the problems that I
> reported.
Interesting! I've tried to make the source compile on GNU/Linux
(again), but unfortunately it uses non-standard (old) C++ and is based
on Qt3. Recent g++ compilers refuse to compile it, and porting to Qt4
is non-trivial. Using Qt3 libraries I managed to compile it, but it
segfaults, and I wasn't able to fix it :-(
BUT: Right now I've tried the Windows binary, and it works on my
GNU/Linux box :-)
> Looking at the Freetype TrueType interpreter implementation, the
> projection vector is in pixel space, meaning that the 300%
> horizontal stretch that I use in my example has been applied.
>
> The problem is that in Ins_IP, the projections are calculated using
> orus coordinate vectors, which are in em-space (NOT stretched).
>
> If I change from using orus to org, the instruction behaves as I
> would expect it to from reading the TrueType specification, and
> there are no artefacts.
Can you prepare a patch, please? I currently don't have the time to
really delve into this issue, but maybe `orus' is correct, but should
be scaled properly...
> It would be great if someone could verify my reasoning, dispute it,
> or just spread some light in general.
It would be great if someone could try the Windows hinter (with
ClearType disabled)...
> Also, and explanation of what orus means would be very welcome
> bonus. :-)
>From include/internal/tttypes.h:
FT_Vector* org; /* original point coordinates */
FT_Vector* cur; /* current point coordinates */
FT_Vector* orus; /* original (unscaled) point coordinates */
Werner