freetype
[Top][All Lists]
Advanced

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

Re: What determines cursor advance for letters?


From: David Turner
Subject: Re: What determines cursor advance for letters?
Date: Fri, 30 Jun 2000 09:33:35 +0200

HI Jason,

"Gaiser, Jason" a écrit :
> 
> Hi All,
> 
> Stupid question #2:
> I've been using:
> {
>         left  = FLOOR( glyph->metrics.horiBearingX );
> 
>         right = CEIL( glyph->metrics.horiBearingX + glyph->metrics.width );
> 
>         width = TRUNC( right - left );
> 
>         cursor += width + 2;
> }
> 
> to compute my cursor advance.  It gives good results with the fonts I've
> tested. I wondered if I could try the same method that I'm using to compute
> space width.  I figured I should be able to use:
> 
>             cursor += TRUNC(face->glyph->metrics.horiAdvance);
> 
> but this is totally wrong(cursor doesn't advance enough).  What is the
> correct method?
> 
Well, it seems you've been using the wrong method from the start !!
You should use:

   cursor += TRUNC(glyph->metrics.horiAdvance);

for all the glyphs in the face !!

I invite you to change this in your program, and expect a few changes
in appearance ;-)

Cheers,

- David

> Thanks!
> 
> {
>    Jason Gaiser                                 phone:  (858) 824-3078
>    Wind River Doctor Design Services    fax: (858) 824-3178
>    address@hidden                   http://www.doctordesign.com
> }



reply via email to

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