[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetype-devel
Subject:    [Devel] Finding hinted ascent and descent values
From:       "Ian Brown" <ian.brown () printsoft ! de>
Date:       2004-11-17 11:49:19
Message-ID: 7F60F0B57543794798BA9205B41B4C20360E06 () mail1 ! psg ! local
[Download RAW message or body]


Hi,
	I need to be able to get the same value that windows returns in
the TEXTMETRIC.tmHeight value from freetype. From what I can gather,
this is the hinted version of ascent - descent.
	It says in the freetype headers that to get this, a client needs
to render each glyph. For performance reasons, the freetype library just
linearly scales the ascent and descent values. My question is how to
actually get the hinted and scaled values for the ascender and descender
once I have loaded a glyph. My code so far looks as follows (m_face is a
FT_Face structure). Can someone give me a hint as to what I need to
access after loading the glyph.

Thanks,

Ian

double FL_FTFace::GetTMHeight()
{
	double retval = 0.;
	if (m_face){
		int max_asc = 0;
		int min_dsc = 0;
		int num_glyphs = m_face->num_glyphs;
		for (int g=0; g < num_glyphs; ++g){
			FT_Error error = FT_Load_Glyph(m_face, g, 0);
			if (!error){
				// need to get the ascender / descender
for the glyph here and
				// update max_asc and min_dsc as
appropiate
			}
		}
	}
	return retval;
}

_______________________________________________
Devel mailing list
Devel@freetype.org
http://www.freetype.org/mailman/listinfo/devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic