[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] FT_Slot_LoadFunc load_flags info?
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] FT_Slot_LoadFunc load_flags info? |
Date: |
Mon, 02 Nov 2009 08:13:48 +0100 (CET) |
Ian,
you are obviously talking about an FT_GlyphSlotRec structure:
> // These are obvious
> slot->metrics.width = myWidth;
> slot->metrics.height = myHeight;
Depending on the FT_LOAD_NO_SCALE flag, the values are either in
(scaled) 26.6 format or unscaled font units, representing the
dimensions of the *hinted* metrics.
> slot->metrics.horiBearingX = myMinX; // NEGATIVE ?
> slot->metrics.horiBearingY = myMaxY;
Yes, these values can be negative too. Depending on the
FT_LOAD_NO_SCALE flag, the values are either in (scaled) 26.6 format
or unscaled font units, again representing *hinted* metrics.
> // Advance #1
> slot->metrics.horiAdvance = 0;
> ft_synthesize_vertical_metrics(&slot->metrics,
> slot->metrics.vertAdvance);
The horizontal advance is the amount you have to move the cursor to
the right (or down for vertical layouts); this is a *hinted* value.
Depending on the FT_LOAD_NO_SCALE flag, the values are either in
(scaled) 26.6 format or unscaled font units.
> // Advance #2 (What's the diff?)
> slot->linearHoriAdvance = 0;
> slot->linearVertAdvance = 0;
These are *unhinted* values, as needed for device-independent layout.
Depending on the FT_LOAD_LINEAR_DESIGN flag, the values are either in
(scaled) 16.16 format or unscaled font units.
> // Advance #3 (Unused?)
> slot->advance.x = 0;
> slot->advance.y = 0;
This is a shorthand: Depending on FT_LOAD_VERTICAL_LAYOUT, this value
contains either metrics.horiAdvance or metrics.vertAdvance;
additionally, depending on FT_LOAD_IGNORE_TRANSFORM, the
transformation matrix has been applied to it. I'll try to improve the
documentation which is a bit fuzzy here.
Hopefully, I've got everything right :-)
Werner
- Re: [ft-devel] FT_Slot_LoadFunc load_flags info?,
Werner LEMBERG <=