[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Font kerning issue
From: |
Matthew Allen |
Subject: |
Re: [ft] Font kerning issue |
Date: |
Mon, 7 Sep 2015 19:37:23 +1000 |
> > I'm working on some code that uses Freetype to render text and some
> > of the characters are too close together:
> >
> > http://stackoverflow.com/questions/32428882/why-does-freetype-render-characters-too-close-together
>
> Just a thought, but the kerning is supposed to be defined between the
> current glyph and the previous one, not the current glyph and the
> following one.
I can comment out the kerning code and get exactly the same output. The
kerning.x value is always zero.
e.g. just:
CurX += Fnt->glyph->metrics.horiAdvance;
> Also, could there be some confusion between f16.16 versus f26.6
> fixed-point scaling?
I'm not using any 16.16 fixed point anywhere...
Unless some of the values Freetype has in it's structures are in 16.16 fixed
point without me realizing?
FYI Font->GetHeight() returns this:
int PtSize = PointSize(); // my font's point size...
int PxSize = (int) (PtSize * Dpi / 72.0); // Convert to pixels
FT_Set_Char_Size(..., PtSize*64, ...); // Set the font size...
return (int) (ceil((double)d->hFont->height * PxSize /
d->hFont->units_per_EM) + 0.0001);
I dunno... that's not 16.16 either... but it's here for completeness.
--
Matthew Allen