[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] weird glyph width/heights
From: |
David Turner |
Subject: |
Re: [Freetype] weird glyph width/heights |
Date: |
Thu, 02 May 2002 22:29:09 +0200 |
Hello HaB,
HaB JacKaL a écrit :
>
> >
> My understanding, from reading the docs is that bitmap_top and bitmap_left
> give the height and width using cartesian coords, from the lower left corner
> of the glyph.
>
nope, the bitmap's dimensions are in glyph->bitmap.width and glyph->bitmap.rows
"glyph->bitmap_left" and "glyph->bitmap_top" correspond to the bitmap's bearings
and are necessary to correctly place the bitmap relative to the current pen
position.
The "FreeType Glyph Conventions" has more information on the subject..
> I think deciding how it's gonna fit on the screen is up to whatever program
> you are using to put in on the screen with. Since I'm using openGL, I just
> need the width and height of the bitmap, and then I call glBitmap()
> accordingly.
>
> So..I guess that Freetype's pixel values are relative only to the glyph
> itself. Mapping to screen coords is up to you.
>
Nope, there are a few rules to follow to correctly place the bitmaps within
a text run.. Have a look at the "ftview" program and see how it renders
a single line of text (in the "Render_Text" function) for an example..
Cheers,
- David Turner
- The FreeType Project (www.freetype.org)