~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/src/FTGLOutlineFont.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include    "FTGLOutlineFont.h"
 
2
#include    "FTOutlineGlyph.h"
 
3
 
 
4
 
 
5
FTGLOutlineFont::FTGLOutlineFont( const char* fontname)
 
6
:   FTFont( fontname)
 
7
{}
 
8
 
 
9
 
 
10
FTGLOutlineFont::FTGLOutlineFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
 
11
:   FTFont( pBufferBytes, bufferSizeInBytes)
 
12
{}
 
13
 
 
14
 
 
15
FTGLOutlineFont::~FTGLOutlineFont()
 
16
{}
 
17
 
 
18
 
 
19
FTGlyph* FTGLOutlineFont::MakeGlyph( unsigned int g)
 
20
{
 
21
    FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
 
22
 
 
23
    if( ftGlyph)
 
24
    {
 
25
        FTOutlineGlyph* tempGlyph = new FTOutlineGlyph( ftGlyph);
 
26
        return tempGlyph;
 
27
    }
 
28
 
 
29
    err = face.Error();
 
30
    return NULL;
 
31
}
 
32
 
 
33
 
 
34
void FTGLOutlineFont::Render( const char* string)
 
35
{   
 
36
    glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
 
37
    
 
38
    glDisable( GL_TEXTURE_2D);
 
39
    
 
40
    glEnable( GL_LINE_SMOOTH);
 
41
    glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
 
42
    glEnable(GL_BLEND);
 
43
    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
 
44
 
 
45
    FTFont::Render( string);
 
46
 
 
47
    glPopAttrib();
 
48
}
 
49
 
 
50
 
 
51
void FTGLOutlineFont::Render( const wchar_t* string)
 
52
{   
 
53
    glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
 
54
    
 
55
    glDisable( GL_TEXTURE_2D);
 
56
    
 
57
    glEnable( GL_LINE_SMOOTH);
 
58
    glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
 
59
    glEnable(GL_BLEND);
 
60
    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
 
61
 
 
62
    FTFont::Render( string);
 
63
 
 
64
    glPopAttrib();
 
65
}
 
66