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

#include <CCFont.h>

Inheritance diagram for Font:
Object FontFNT FontFreeType

Public Member Functions

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 FontAtlascreateFontAtlas ()=0
local createFontAtlas ()
virtual SizegetAdvancesForTextUTF16 (unsigned short *text, int &outNumLetters) const =0
virtual const char * getCurrentGlyphCollection () const
local getCurrentGlyphCollection ()
virtual int getLetterPadding () const
var getLetterPadding ()
local getLetterPadding ()
virtual unsigned char * getGlyphBitmap (unsigned short theChar, int &outWidth, int &outHeight) const
var getGlyphBitmap ( var theChar, var outWidth, var outHeight)
local getGlyphBitmap ( local theChar, local outWidth, local outHeight)
virtual GlyphDefgetGlyphDefintionsForText (const char *text, int &outNumGlyphs, bool UTF16text=false) const
var getGlyphDefintionsForText ( var text, var outNumGlyphs, var false)
local getGlyphDefintionsForText ( local text, local outNumGlyphs, local false)
virtual int getFontMaxHeight () const
var getFontMaxHeight ()
local getFontMaxHeight ()
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 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)

Static Public Attributes

static const int DistanceMapSpread

Protected Member Functions

 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)

Protected Attributes

GlyphCollection _usedGlyphs
char * _customGlyphs
var _customGlyphs
local _customGlyphs
bool _distanceFieldEnabled
var _distanceFieldEnabled
local _distanceFieldEnabled
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Static Protected Attributes

static const char * _glyphASCII
var _glyphASCII
local _glyphASCII
static const char * _glyphNEHE
var _glyphNEHE
local _glyphNEHE

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...
 

Constructor & Destructor Documentation

Font ( )
protected
var Font ( )
protected
local Font ( )
protected
virtual ~Font ( )
inlineprotectedvirtual

Member Function Documentation

virtual FontAtlas* createFontAtlas ( )
pure virtual

Implemented in FontFreeType, and FontFNT.

var createFontAtlas ( )
pure virtual

Implemented in FontFreeType, and FontFNT.

local createFontAtlas ( )
pure virtual

Implemented in FontFreeType, and FontFNT.

static Font* createWithFNT ( const std::string &  fntFilePath)
static
var createWithFNT ( var  fntFilePath)
static
local createWithFNT ( local  fntFilePath)
static
static Font* createWithTTF ( const std::string &  fntName,
int  fontSize,
GlyphCollection  glyphs,
const char *  customGlyphs 
)
static
var createWithTTF ( var  fntName,
var  fontSize,
var  glyphs,
var  customGlyphs 
)
static
local createWithTTF ( local  fntName,
local  fontSize,
local  glyphs,
local  customGlyphs 
)
static
virtual Size*
getAdvancesForTextUTF16
( unsigned short *  text,
int &  outNumLetters 
) const
pure virtual

Implemented in FontFreeType, and FontFNT.

var getAdvancesForTextUTF16 ( var  text,
var  outNumLetters 
)
pure virtual

Implemented in FontFreeType, and FontFNT.

local getAdvancesForTextUTF16 ( local  text,
local  outNumLetters 
)
pure virtual

Implemented in FontFreeType, and FontFNT.

virtual const char*
getCurrentGlyphCollection
( ) const
virtual
var getCurrentGlyphCollection ( )
virtual
local getCurrentGlyphCollection ( )
virtual
virtual int getFontMaxHeight ( ) const
inlinevirtual

Reimplemented in FontFreeType.

var getFontMaxHeight ( )
inlinevirtual

Reimplemented in FontFreeType.

local getFontMaxHeight ( )
inlinevirtual

Reimplemented in FontFreeType.

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

Reimplemented in FontFreeType.

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

Reimplemented in FontFreeType.

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

Reimplemented in FontFreeType.

const char* getGlyphCollection ( GlyphCollection  glyphs) const
protected
var getGlyphCollection ( var  glyphs)
protected
local getGlyphCollection ( local  glyphs)
protected
virtual GlyphDef*
getGlyphDefintionsForText
( const char *  text,
int &  outNumGlyphs,
bool  UTF16text = false 
) const
inlinevirtual

Reimplemented in FontFreeType.

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

Reimplemented in FontFreeType.

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

Reimplemented in FontFreeType.

virtual int getLetterPadding ( ) const
inlinevirtual

Reimplemented in FontFreeType.

var getLetterPadding ( )
inlinevirtual

Reimplemented in FontFreeType.

local getLetterPadding ( )
inlinevirtual

Reimplemented in FontFreeType.

virtual Rect getRectForChar ( unsigned short  theChar) const
virtual

Reimplemented in FontFNT.

var getRectForChar ( var  theChar)
virtual

Reimplemented in FontFNT.

local getRectForChar ( local  theChar)
virtual

Reimplemented in FontFNT.

virtual unsigned short int*
getUTF16Text
( const char *  text,
int &  outNumLetters 
) const
virtual
var getUTF16Text ( var  text,
var  outNumLetters 
)
virtual
local getUTF16Text ( local  text,
local  outNumLetters 
)
virtual
virtual int getUTF16TextLenght ( unsigned short int *  text) const
virtual
var getUTF16TextLenght ( var  text)
virtual
local getUTF16TextLenght ( local  text)
virtual
bool isDistanceFieldEnabled ( ) const
inline
var isDistanceFieldEnabled ( )
inline
local isDistanceFieldEnabled ( )
inline
static unsigned char*
makeDistanceMap
( unsigned char *  img,
unsigned int  width,
unsigned int  height 
)
static
var makeDistanceMap ( var  img,
var  width,
var  height 
)
static
local makeDistanceMap ( local  img,
local  width,
local  height 
)
static
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 
)
void setCurrentGlyphCollection ( GlyphCollection  glyphs,
const char *  customGlyphs = 0 
)
protected
var setCurrentGlyphCollection ( var  glyphs,
var  customGlyphs = 0 
)
protected
local setCurrentGlyphCollection ( local  glyphs,
local  customGlyphs = 0 
)
protected
void setDistanceFieldEnabled ( bool  distanceFieldEnabled)
var setDistanceFieldEnabled ( var  distanceFieldEnabled)
local setDistanceFieldEnabled ( local  distanceFieldEnabled)
virtual unsigned short int*
trimUTF16Text
( unsigned short int *  text,
int  newBegin,
int  newEnd 
) const
virtual
var trimUTF16Text ( var  text,
var  newBegin,
var  newEnd 
)
virtual
local trimUTF16Text ( local  text,
local  newBegin,
local  newEnd 
)
virtual

Member Data Documentation

char* _customGlyphs
protected
var _customGlyphs
protected
local _customGlyphs
protected
bool _distanceFieldEnabled
protected
var _distanceFieldEnabled
protected
local _distanceFieldEnabled
protected
const char* _glyphASCII
staticprotected
var _glyphASCII
staticprotected
local _glyphASCII
staticprotected
const char* _glyphNEHE
staticprotected
var _glyphNEHE
staticprotected
local _glyphNEHE
staticprotected
GlyphCollection _usedGlyphs
protected
var _usedGlyphs
protected
local _usedGlyphs
protected
const int DistanceMapSpread
static
var DistanceMapSpread
static
local DistanceMapSpread
static

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