freetype-devel
[Top][All Lists]
Advanced

[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: Tue, 03 Nov 2009 16:18:19 +0100 (CET)

> - It's cover is [(-800, -1000), (800, 1000)], as an example.

This is quite unusual for a glyph...

>>>         // These are obvious
>>>         slot->metrics.width = 1600;
>>>         slot->metrics.height = 2000;
> 
>>>         slot->metrics.horiBearingX = -800;
>>>         slot->metrics.horiBearingY = 1000;
> 
> Since my origin is in the centre of the glyph,

This is unusual, too.  Normally, the origin is left of the glyph (or
above the glyph in case for vertical typesetting).

> these are basically half the width/height, right?

Yes.  Look at the attached image (from the tutorial); note that
horiBearingX is negative for your glyph dimensions.

>> The horizontal advance is the amount you have to move the cursor to
>> the right (or down for vertical layouts);
> 
> This is where I start to scratch my head ...
> - Should this be the width of my glyph?

This value is completely independent from the actual glyph!  It's up
to you how much whitespace you want to have between your glyphs.
Basically, it's a design decision; of course, in most cases the
advance width is larger than the glyph's width.

To summarize: The advance width gives the distance from the origin of
a glyph to the origin of the next glyph.

> - Or should it be zero?  Zero seems to work in _some_ cases...

This surprises me.  Zero should make all glyphs positioned at the same
place, overwriting each other.

>>>         // Advance #2 (Unhinted)
>>>         slot->linearHoriAdvance = slot->metrics.horiAdvance;
>>>         slot->linearVertAdvance = slot->metrics.vertAdvance;
>>
>> These are *unhinted* values, as needed for device-independent
>> layout.
> 
> Since I have no hinting, these just the same as the slot->metrics
> values, right?

Yes, but possibly with another scaling (in case you don't use font
units).

> I also seem to be getting a FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
> flag?

Uh, how comes?  You should never need this flag.

> The comments in src/truetype/ttgload.c almost suggest I shouldn't be
> seeing this flag ...

Exactly.


    Werner

PNG image


reply via email to

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