mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-09 15:49:52 +00:00
initial commit. This is icculus version 5542b94cae02a6333845854bbbd1abe0a259f1a4
This commit is contained in:
commit
3096eaf5e2
2519 changed files with 816064 additions and 0 deletions
67
ExternalLibs/FTGL/src/FTGLOutlineFont.cpp
Normal file
67
ExternalLibs/FTGL/src/FTGLOutlineFont.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
#include "FTGLOutlineFont.h"
|
||||
#include "FTOutlineGlyph.h"
|
||||
|
||||
|
||||
FTGLOutlineFont::FTGLOutlineFont( const char* fontFilePath)
|
||||
: FTFont( fontFilePath)
|
||||
{}
|
||||
|
||||
|
||||
FTGLOutlineFont::FTGLOutlineFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
|
||||
: FTFont( pBufferBytes, bufferSizeInBytes)
|
||||
{}
|
||||
|
||||
|
||||
FTGLOutlineFont::~FTGLOutlineFont()
|
||||
{}
|
||||
|
||||
|
||||
FTGlyph* FTGLOutlineFont::MakeGlyph( unsigned int g)
|
||||
{
|
||||
FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING);
|
||||
|
||||
if( ftGlyph)
|
||||
{
|
||||
FTOutlineGlyph* tempGlyph = new FTOutlineGlyph( ftGlyph, useDisplayLists);
|
||||
return tempGlyph;
|
||||
}
|
||||
|
||||
err = face.Error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void FTGLOutlineFont::Render( const char* string)
|
||||
{
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
glEnable( GL_LINE_SMOOTH);
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
void FTGLOutlineFont::Render( const wchar_t* string)
|
||||
{
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glDisable( GL_TEXTURE_2D);
|
||||
|
||||
glEnable( GL_LINE_SMOOTH);
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
|
||||
|
||||
FTFont::Render( string);
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue