freetype
[Top][All Lists]
Advanced

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

=?UTF-8?Q?Re:_[ft]_glyphs_bitmap=5Ftop_and_=C3=81, =C3=9F, =C3=84_...?=


From: RoBaTte
Subject: =?UTF-8?Q?Re:_[ft]_glyphs_bitmap=5Ftop_and_=C3=81, =C3=9F, =C3=84_...?=
Date: Wed, 18 Feb 2009 11:42:22 -0800 (PST)

First, thank you for your fast answer :)

Here is te code-snipped where the y-positions are processed:


kerning = FT_HAS_KERNING( face);
previous = 0;

pen_x = posX;
pen_y = posY + face->height>>6;

for( unsigned int n=0; n<strlen( txt); n++)
{
    if (txt[n] == '\n')
    {
        pen_x = posX;
        pen_y += face->height>>6;
    }
    else
    {
        glyphIndex = FT_Get_Char_Index( face, txt[n]);

        if( kerning && previous && glyphIndex)
        {
            FT_Vector delta;
            FT_Get_Kerning( face, previous, glyphIndex, FT_KERNING_DEFAULT,
&delta);
            pen_x += delta.x >> 6;
        }

        error = FT_Load_Glyph( face, glyphIndex, FT_LOAD_RENDER  );

        printf("\n\'%c\' top: %i  height %i",  txt[n], slot->bitmap_top,
slot->metrics.height>>6);

        renderChar( txt[n], pen_x + slot->bitmap_left, pen_y -
slot->bitmap_top);

        pen_x += slot->advance.x >> 6;
        previous = glyphIndex;
    }
}


Here ( http://www.nabble.com/file/p22086644/FreeType_Probl_Sample.zip
FreeType_Probl_Sample.zip ) is also a zip-file with the main.cpp, ftype.h
and a compiled *.exe-file ( for windows).

Greetings, Rob.

-- 
View this message in context: 
http://www.nabble.com/glyphs-bitmap_top-and-%C3%81%2C%C3%9F%2C%C3%84-...-tp22084682p22086644.html
Sent from the Freetype - User mailing list archive at Nabble.com.





reply via email to

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