mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developBug
This commit is contained in:
commit
1ad43e676e
|
@ -26,6 +26,7 @@ cocos2d-x-3.0beta2 ?.? ?
|
|||
[FIX] CocoStudio: The order of transform calculation in Skin::getNodeToWorldTransform() is incorrect.
|
||||
[FIX] Crash if file doesn't exist when using FileUtils::getStringFromFile.
|
||||
[FIX] If setting a shorter string than before while using LabelAtlas, the effect will be wrong.
|
||||
[FIX] Label: Memory leak in FontFreeType::createFontAtlas().
|
||||
[FIX] Label: Crash when using unknown characters.
|
||||
[FIX] Label: Missing line breaks and wrong alignment.
|
||||
[FIX] Label: Color and opacity settings aren't applied when invoking Label::alignText.
|
||||
|
|
|
@ -99,7 +99,7 @@ const char * Font::getCurrentGlyphCollection() const
|
|||
}
|
||||
}
|
||||
|
||||
unsigned short int * Font::getUTF16Text(const char *text, int &outNumLetters) const
|
||||
unsigned short* Font::getUTF16Text(const char *text, int &outNumLetters) const
|
||||
{
|
||||
unsigned short* utf16String = cc_utf8_to_utf16(text);
|
||||
|
||||
|
@ -115,7 +115,7 @@ int Font::getUTF16TextLenght(unsigned short int *text) const
|
|||
return cc_wcslen(text);
|
||||
}
|
||||
|
||||
unsigned short int * Font::trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const
|
||||
unsigned short * Font::trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const
|
||||
{
|
||||
if ( newBegin < 0 || newEnd <= 0 )
|
||||
return 0;
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
virtual int getFontMaxHeight() const { return 0; }
|
||||
|
||||
virtual int getUTF16TextLenght(unsigned short int *text) const;
|
||||
virtual unsigned short int * getUTF16Text(const char *text, int &outNumLetters) const;
|
||||
virtual unsigned short int * trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const;
|
||||
virtual unsigned short * getUTF16Text(const char *text, int &outNumLetters) const;
|
||||
virtual unsigned short * trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -136,7 +136,9 @@ FontAtlas * FontFreeType::createFontAtlas()
|
|||
FontAtlas *atlas = new FontAtlas(*this);
|
||||
if (_usedGlyphs != GlyphCollection::DYNAMIC)
|
||||
{
|
||||
atlas->prepareLetterDefinitions(cc_utf8_to_utf16(getCurrentGlyphCollection()));
|
||||
unsigned short* utf16 = cc_utf8_to_utf16(getCurrentGlyphCollection());
|
||||
atlas->prepareLetterDefinitions(utf16);
|
||||
CC_SAFE_DELETE_ARRAY(utf16);
|
||||
}
|
||||
this->release();
|
||||
return atlas;
|
||||
|
|
Loading…
Reference in New Issue