cocos2d-x  3.0Beta0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FontFreeType Class Reference

#include <CCFontFreeType.h>

Inheritance diagram for FontFreeType:
Font Object

Public Member Functions

virtual FontAtlascreateFontAtlas () override
virtual SizegetAdvancesForTextUTF16 (unsigned short *text, int &outNumLetters) const override
virtual GlyphDefgetGlyphDefintionsForText (const char *text, int &outNumGlyphs, bool UTF16text=false) const override
local getGlyphDefintionsForText ( local text, local outNumGlyphs, local false)
unsigned char * getGlyphBitmap (unsigned short theChar, int &outWidth, int &outHeight) const override
local getGlyphBitmap ( local theChar, local outWidth, local outHeight)
virtual int getFontMaxHeight () const override
virtual int getLetterPadding () const override
bool getBBOXFotChar (unsigned short theChar, Rect &outRect) const
bool isDynamicGlyphCollection ()
local isDynamicGlyphCollection ()
- Public Member Functions inherited from Font
void setDistanceFieldEnabled (bool distanceFieldEnabled)
var setDistanceFieldEnabled ( var distanceFieldEnabled)
bool isDistanceFieldEnabled () const
var isDistanceFieldEnabled ()
local isDistanceFieldEnabled ()
bool renderCharAt (unsigned short int charToRender, int posX, int posY, unsigned char *destMemory, int destSize)
var renderCharAt ( var charToRender, var posX, var posY, var destMemory, var destSize)
local renderCharAt ( local charToRender, local posX, local posY, local destMemory, local destSize)
virtual const char * getCurrentGlyphCollection () const
local getCurrentGlyphCollection ()
virtual Rect getRectForChar (unsigned short theChar) const
var getRectForChar ( var theChar)
local getRectForChar ( local theChar)
virtual int getUTF16TextLenght (unsigned short int *text) const
virtual unsigned short int * getUTF16Text (const char *text, int &outNumLetters) const
var getUTF16Text ( var text, var outNumLetters)
local getUTF16Text ( local text, local outNumLetters)
virtual unsigned short int * trimUTF16Text (unsigned short int *text, int newBegin, int newEnd) const
local trimUTF16Text ( local text, local newBegin, local newEnd)
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
local retainCount ()
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

static FontFreeTypecreate (const std::string &fontName, int fontSize, GlyphCollection glyphs, const char *customGlyphs)
static void shutdownFreeType ()
- Static Public Member Functions inherited from Font
static FontcreateWithTTF (const std::string &fntName, int fontSize, GlyphCollection glyphs, const char *customGlyphs)
local createWithTTF ( local fntName, local fontSize, local glyphs, local customGlyphs)
static FontcreateWithFNT (const std::string &fntFilePath)
local createWithFNT ( local fntFilePath)
static unsigned char * makeDistanceMap (unsigned char *img, unsigned int width, unsigned int height)
local makeDistanceMap ( local img, local width, local height)

Protected Member Functions

 FontFreeType (bool dynamicGlyphCollection=false)
virtual ~FontFreeType ()
bool createFontObject (const std::string &fontName, int fontSize)
var createFontObject ( var fontName, var fontSize)
local createFontObject ( local fontName, local fontSize)
- Protected Member Functions inherited from Font
 Font ()
 Font ()
 Font ()
virtual ~Font ()
void setCurrentGlyphCollection (GlyphCollection glyphs, const char *customGlyphs=0)
var setCurrentGlyphCollection ( var glyphs, var 0)
local setCurrentGlyphCollection ( local glyphs, local 0)
const char * getGlyphCollection (GlyphCollection glyphs) const
local getGlyphCollection ( local glyphs)

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 
var _luaID
 Lua reference id. More...
 
local _luaID
 Lua reference id. More...
 
- Static Public Attributes inherited from Font
static const int DistanceMapSpread
- Protected Attributes inherited from Font
GlyphCollection _usedGlyphs
char * _customGlyphs
var _customGlyphs
local _customGlyphs
bool _distanceFieldEnabled
var _distanceFieldEnabled
local _distanceFieldEnabled
- Static Protected Attributes inherited from Font
static const char * _glyphASCII
var _glyphASCII
local _glyphASCII
static const char * _glyphNEHE
var _glyphNEHE
local _glyphNEHE

Constructor & Destructor Documentation

FontFreeType ( bool  dynamicGlyphCollection = false)
protected
var FontFreeType ( var  dynamicGlyphCollection = false)
protected
local FontFreeType ( local  dynamicGlyphCollection = false)
protected
virtual ~FontFreeType ( )
protectedvirtual
var ~FontFreeType ( )
protectedvirtual
local ~FontFreeType ( )
protectedvirtual

Member Function Documentation

static FontFreeType* create ( const std::string &  fontName,
int  fontSize,
GlyphCollection  glyphs,
const char *  customGlyphs 
)
static
var create ( var  fontName,
var  fontSize,
var  glyphs,
var  customGlyphs 
)
static
local create ( local  fontName,
local  fontSize,
local  glyphs,
local  customGlyphs 
)
static
virtual FontAtlas* createFontAtlas ( )
overridevirtual

Implements Font.

var createFontAtlas ( )
overridevirtual

Implements Font.

local createFontAtlas ( )
overridevirtual

Implements Font.

bool createFontObject ( const std::string &  fontName,
int  fontSize 
)
protected
var createFontObject ( var  fontName,
var  fontSize 
)
protected
local createFontObject ( local  fontName,
local  fontSize 
)
protected
virtual Size*
getAdvancesForTextUTF16
( unsigned short *  text,
int &  outNumLetters 
) const
overridevirtual

Implements Font.

var getAdvancesForTextUTF16 ( var  text,
var  outNumLetters 
)
overridevirtual

Implements Font.

local getAdvancesForTextUTF16 ( local  text,
local  outNumLetters 
)
overridevirtual

Implements Font.

bool getBBOXFotChar ( unsigned short  theChar,
Rect outRect 
) const
var getBBOXFotChar ( var  theChar,
var  outRect 
)
local getBBOXFotChar ( local  theChar,
local  outRect 
)
virtual int getFontMaxHeight ( ) const
overridevirtual

Reimplemented from Font.

var getFontMaxHeight ( )
overridevirtual

Reimplemented from Font.

local getFontMaxHeight ( )
overridevirtual

Reimplemented from Font.

unsigned char* getGlyphBitmap ( unsigned short  theChar,
int &  outWidth,
int &  outHeight 
) const
overridevirtual

Reimplemented from Font.

var getGlyphBitmap ( var  theChar,
var  outWidth,
var  outHeight 
)
overridevirtual

Reimplemented from Font.

local getGlyphBitmap ( local  theChar,
local  outWidth,
local  outHeight 
)
overridevirtual

Reimplemented from Font.

virtual GlyphDef*
getGlyphDefintionsForText
( const char *  text,
int &  outNumGlyphs,
bool  UTF16text = false 
) const
overridevirtual

Reimplemented from Font.

var getGlyphDefintionsForText ( var  text,
var  outNumGlyphs,
var  UTF16text = false 
)
overridevirtual

Reimplemented from Font.

local getGlyphDefintionsForText ( local  text,
local  outNumGlyphs,
local  UTF16text = false 
)
overridevirtual

Reimplemented from Font.

virtual int getLetterPadding ( ) const
overridevirtual

Reimplemented from Font.

var getLetterPadding ( )
overridevirtual

Reimplemented from Font.

local getLetterPadding ( )
overridevirtual

Reimplemented from Font.

bool isDynamicGlyphCollection ( )
inline
var isDynamicGlyphCollection ( )
inline
local isDynamicGlyphCollection ( )
inline
static void shutdownFreeType ( )
static
var shutdownFreeType ( )
static
local shutdownFreeType ( )
static

The documentation for this class was generated from the following file: