mirror of https://github.com/axmolengine/axmol.git
Merge branch 'new_develop_merge' of https://github.com/carlomorgantinizynga/cocos2d-x into carlomorgantinizynga-new_develop_merge
This commit is contained in:
commit
c61da90441
|
@ -21,12 +21,12 @@ const char *FontAtlasFactory::glyphNEHE = "!\"#$%&'()*+,-./0123456789:;<=>?@ABC
|
|||
|
||||
|
||||
|
||||
FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* tttFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs)
|
||||
FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* fntFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs)
|
||||
{
|
||||
FontDefinitionTTF *def = 0;
|
||||
if ( (glyphs == GlyphCollection::NEHE) || (glyphs == GlyphCollection::ASCII) )
|
||||
{
|
||||
def = FontDefinitionTTF::create(tttFilePath, fontSize, getGlyphCollection(glyphs));
|
||||
def = FontDefinitionTTF::create(fntFilePath, fontSize, getGlyphCollection(glyphs));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* tttFilePath, int fo
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
def = FontDefinitionTTF::create(tttFilePath, fontSize, customGlyphs);
|
||||
def = FontDefinitionTTF::create(fntFilePath, fontSize, customGlyphs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ class CC_DLL FontAtlasFactory
|
|||
|
||||
public:
|
||||
|
||||
static FontAtlas * createAtlasFromTTF(const char* tttFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs = 0);
|
||||
static FontAtlas * createAtlasFromFNT(const char* tttFilePath);
|
||||
static FontAtlas * createAtlasFromTTF(const char* fntFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs = 0);
|
||||
static FontAtlas * createAtlasFromFNT(const char* fntFilePath);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
Label* Label::createWithTTF( const char* label, const char* tttFilePath, int fontSize, GlyphCollection glyphs, int lineSize, const char *customGlyphs )
|
||||
Label* Label::createWithTTF( const char* label, const char* fntFilePath, int fontSize, GlyphCollection glyphs, int lineSize, const char *customGlyphs )
|
||||
{
|
||||
FontAtlas *tempAtlas = FontAtlasCache::getFontAtlasTTF(tttFilePath, fontSize, glyphs, customGlyphs);
|
||||
FontAtlas *tempAtlas = FontAtlasCache::getFontAtlasTTF(fntFilePath, fontSize, glyphs, customGlyphs);
|
||||
if (!tempAtlas)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class CC_DLL Label : public SpriteBatchNode, public LabelProtocol, public RGBAPr
|
|||
{
|
||||
public:
|
||||
|
||||
static Label* createWithTTF( const char* label, const char* tttFilePath, int fontSize, GlyphCollection glyphs = GlyphCollection::NEHE, int lineSize = 0, const char *customGlyphs = 0 );
|
||||
static Label* createWithTTF( const char* label, const char* fntFilePath, int fontSize, GlyphCollection glyphs = GlyphCollection::NEHE, int lineSize = 0, const char *customGlyphs = 0 );
|
||||
static Label* createWithBMFont( const char* label, const char* bmfontFilePath, int lineSize = 0 );
|
||||
|
||||
virtual ~Label();
|
||||
|
|
|
@ -38,8 +38,8 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel)
|
|||
if (theLabel->getMaxLineWidth())
|
||||
{
|
||||
// Step 1: Make multiline
|
||||
vector<unsigned short> str_whole = cc_utf16_vec_from_utf16_str(theLabel->getUTF8String());
|
||||
unsigned int stringLength = str_whole.size();
|
||||
vector<unsigned short> strWhole = cc_utf16_vec_from_utf16_str(theLabel->getUTF8String());
|
||||
unsigned int stringLength = strWhole.size();
|
||||
|
||||
vector<unsigned short> multiline_string;
|
||||
multiline_string.reserve( stringLength );
|
||||
|
@ -74,7 +74,7 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel)
|
|||
if (i >= stringLength)
|
||||
break;
|
||||
|
||||
unsigned short character = str_whole[i];
|
||||
unsigned short character = strWhole[i];
|
||||
|
||||
if (!start_word)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel)
|
|||
if (i >= stringLength)
|
||||
break;
|
||||
|
||||
character = str_whole[i];
|
||||
character = strWhole[i];
|
||||
|
||||
if (!startOfWord)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue