diff options
author | Diego Borghetti <bdiego@gmail.com> | 2009-05-06 03:10:32 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2009-05-06 03:10:32 +0400 |
commit | 405cf80eb8dc2df8ae160aee70aef34052add24a (patch) | |
tree | f03cc27e95bdf91b25ea9d2a0dffb28ccef666be /extern/bFTGL/src/FTGlyphContainer.cpp | |
parent | 71c38978e14ebf3522fe60fc239ad04f10ef30ab (diff) |
Big, big commit!!
1) Remove WITH_FREETYPE2 from code, so now blender always need freetype2
2) Remove the old bmfont
3) Remove ftfont and bFTGL library
4) Implement a new BLF_draw_default function for place that still need/use
the old BMF api.
I try to update both, scons and cmake, but I only can test with make, so
hope all work fine.
MSVC is broken, but I don't have Windows, things to search and fix are
any reference to WITH_FREETYPE2, FTGL and BMFONT (take in care that
blenkernel also have a BKE_bmfont.h, this don't have anything to do with bmfont).
Always have to link/include the freetype2 library
Remove any reference to libbmfont
Remove any reference to libftfont
Remove any reference to libbftgl (or libbFTGL)
Diffstat (limited to 'extern/bFTGL/src/FTGlyphContainer.cpp')
-rw-r--r-- | extern/bFTGL/src/FTGlyphContainer.cpp | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/extern/bFTGL/src/FTGlyphContainer.cpp b/extern/bFTGL/src/FTGlyphContainer.cpp deleted file mode 100644 index 2c1881bbfff..00000000000 --- a/extern/bFTGL/src/FTGlyphContainer.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "FTGlyphContainer.h" -#include "FTGlyph.h" -#include "FTFace.h" -#include "FTCharmap.h" - - -FTGlyphContainer::FTGlyphContainer( FTFace* f) -: face(f), - err(0) -{ - glyphs.push_back( NULL); - charMap = new FTCharmap( face); -} - - -FTGlyphContainer::~FTGlyphContainer() -{ - GlyphVector::iterator glyphIterator; - for( glyphIterator = glyphs.begin(); glyphIterator != glyphs.end(); ++glyphIterator) - { - delete *glyphIterator; - } - - glyphs.clear(); - delete charMap; -} - - -bool FTGlyphContainer::CharMap( FT_Encoding encoding) -{ - bool result = charMap->CharMap( encoding); - err = charMap->Error(); - return result; -} - - -unsigned int FTGlyphContainer::FontIndex( const unsigned int characterCode) const -{ - return charMap->FontIndex( characterCode); -} - - -void FTGlyphContainer::Add( FTGlyph* tempGlyph, const unsigned int characterCode) -{ - charMap->InsertIndex( characterCode, glyphs.size()); - glyphs.push_back( tempGlyph); -} - - -const FTGlyph* const FTGlyphContainer::Glyph( const unsigned int characterCode) const -{ - signed int index = charMap->GlyphListIndex( characterCode); - return glyphs[index]; -} - - -FTBBox FTGlyphContainer::BBox( const unsigned int characterCode) const -{ - return glyphs[charMap->GlyphListIndex( characterCode)]->BBox(); -} - - -float FTGlyphContainer::Advance( const unsigned int characterCode, const unsigned int nextCharacterCode) -{ - unsigned int left = charMap->FontIndex( characterCode); - unsigned int right = charMap->FontIndex( nextCharacterCode); - - float width = face->KernAdvance( left, right).x; - width += glyphs[charMap->GlyphListIndex( characterCode)]->Advance(); - - return width; -} - - -FTPoint FTGlyphContainer::Render( const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition) -{ - 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; -} |