freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Re: FIXED: Problems with oblique fonts


From: Tom Kacvinsky
Subject: [Devel] Re: FIXED: Problems with oblique fonts
Date: Wed, 20 Dec 2000 09:21:29 -0500 (EST)

Hi David,

I am taking this off list, unless you want it back on...

A few questions/comments:

On Wed, 20 Dec 2000, David Turner wrote:

>
>   - a transform is made of a 2x2 matrix and a 2d translation.
>     where the matrix is typically applied _before_ the translation
>

Yep, I see that is how things are done in FT.  Avoids having to work
with 3 by 3 matrices.  Nicely, done!

>   - the auto-hinter normally works on un-transformed glyphs, then
>     applies the transform on the result. Unfortunately, this tends
>     to ruin the grid alignment when the translation vector is not
>     in integer pixel positions
>

But when I looked at the code, my inpression was that the blue zones and what
not were calculated from gpyhs that already had the transform applied.  This is
because the blues calculations are made from glyphs that were obtained by
calling FT_Load_Glyph with load_flags = FT_LOAD_NO_SCALE, and the code in the T1
glyph loader has logic in it to apply the transform when load_flags &
FT_LOAD_NO_RECURSE == 0.  So, from what you tell me, the untransformed glyphs
are now getting hinted with information that comes from transformed glyphs!
I will verify this (hinting untransformed G with blues from transformed G).
If this is the case, is it not a bug?

Question: does lack of grid alignment cause a glyph to not render at all?  This
is waht I was seeing in my testing -- that is, I wasn't calculating this inverse
translation the first time through, and the first glyph wouldn't show.  The next
time through, though, the glyph would show.  Part of me thinks there is
something going on with global variables, and part of me wonders about glyphs
not showing if grid fitting is not in effect...

>   - so, instead, un-transformed glyphs are loaded, then translated
>     by a special vector before being hinter (this ensure grid-alignment).
>     finally, the 2x2 matrix is applied.
>
>       instead of computing:   G' = T*M*G
>
>       we compute something like:   G' = M*T'*G
>
>     where T' = inv(M)*T*M
>

>From what you tell me, I though the prcoess would be something like this:

load G, unscaled and untransformed.

hint G (no transform applied yet).

Calculate new transform matrix so that when it is applied, grid
alignment still occurs.

transform G with this new 2 by 2 matrix.

calculate new translation vector so that when it is applied, grid
alignment still occurs.

translate G with this new vector.

scale G.

The reason why I am suspicious is this: I did not see any code that calculated
T' = inv(M)*T*M.  Perhaps it is done in steps.  I did see a calculation for T''
= inv(M)*T, and later in the code, there is a transform by M, followed by a
translation by T''.  Then M is applied again?  If this is the case (I will
verify it), then I see that what you write above is true, and I guess that the
eventual calculation inv(M)*M is what forces grid fitting.  Am I making sense
here?

I want to say I trust what you write, I am just asking questions to clarify this
in my mind.

Regards,

Tom





reply via email to

[Prev in Thread] Current Thread [Next in Thread]