Edit

kc3-lang/ftgl/src/FTGLBufferFont.cpp

Branch :

  • Show log

    Commit

  • Author : sammy
    Date : 2008-04-04 12:43:38
    Hash : 7c358859
    Message : * Generate a config.h file instead of passing all defines in the compiler command line. * "make install" now properly installs the includes, the documentation and the .pc file. * Generate a shared library.

  • src/FTGLBufferFont.cpp
  • #include "config.h"
    
    #include "FTGLBufferFont.h"
    #include "FTBufferGlyph.h"
    
    
    FTGLBufferFont::FTGLBufferFont( const char* fontname)
    :   FTFont( fontname),
        buffer(0)
    {}
    
    
    FTGLBufferFont::FTGLBufferFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
    :   FTFont( pBufferBytes, bufferSizeInBytes),
        buffer(0)
    {}
    
    
    FTGLBufferFont::~FTGLBufferFont()
    {}
    
    
    FTGlyph* FTGLBufferFont::MakeGlyph( unsigned int g)
    {
        FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
    
        if( ftGlyph)
        {
            FTBufferGlyph* tempGlyph = new FTBufferGlyph( ftGlyph, buffer);
            return tempGlyph;
        }
    
        err = face.Error();
        return NULL;
    }
    
    
    void FTGLBufferFont::Render( const char* string)
    {   
        if( NULL != buffer)
        {
            FTFont::Render( string);
        }
    }
    
    
    void FTGLBufferFont::Render( const wchar_t* string)
    {   
        if( NULL != buffer)
        {
            FTFont::Render( string);
        }
    }