Logo Search packages:      
Sourcecode: blender version File versions  Download package

FTPoint FTGlyphContainer::Render ( const unsigned int  characterCode,
const unsigned int  nextCharacterCode,
FTPoint  penPosition 
)

Renders a character

Parameters:
characterCode the glyph to be Rendered
nextCharacterCode the next glyph in the string. Used for kerning.
penPosition the position to Render the glyph
Returns:
The distance to advance the pen position after Rendering

Definition at line 75 of file FTGlyphContainer.cpp.

References charMap, FTFace::Error(), face, glyphs, FTFace::KernAdvance(), and FTPoint::x.

Referenced by FTFont::DoRender().

{
    FTPoint kernAdvance;
    float advance = 0;
    
    unsigned int left = charMap->FontIndex( characterCode);
    unsigned int right = charMap->FontIndex( nextCharacterCode);

    kernAdvance = face->KernAdvance( left, right);
        
    if( !face->Error())
    {
        advance = glyphs[charMap->GlyphListIndex( characterCode)]->Render( penPosition);
    }
    
    kernAdvance.x = advance + kernAdvance.x;
//  kernAdvance.y = advance.y + kernAdvance.y;
    return kernAdvance;
}


Generated by  Doxygen 1.6.0   Back to index