Merge pull request #6631 from Dhilan007/v3_labelhotfixed

closed #5054:Label:Text have black border if it's created with system font on WP8/WINRT.
This commit is contained in:
minggo 2014-05-08 17:24:08 +08:00
commit c886bf21a8
2 changed files with 10 additions and 3 deletions

View File

@ -84,6 +84,10 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin
m_inWidth = textDefinition._dimensions.width;
m_inHeight = textDefinition._dimensions.height;
m_fontFillColorR = textDefinition._fontFillColor.r;
m_fontFillColorG = textDefinition._fontFillColor.g;
m_fontFillColorB = textDefinition._fontFillColor.b;
#if 0
// check the cache for the font file buffer
auto ittFontNames = s_fontsNames.find(textDefinition._fontName);
@ -304,10 +308,10 @@ void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_
if(value > 0)
{
FT_Int index = (j * m_width * 4) + (i * 4);
pBuffer[index++] = m_fontFillColorR;
pBuffer[index++] = m_fontFillColorG;
pBuffer[index++] = m_fontFillColorB;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = 0xff;
}
}
}

View File

@ -129,6 +129,9 @@ private:
FTLineInfo* m_currentLine; // the current line object to add words to.
int m_fontFillColorR;
int m_fontFillColorG;
int m_fontFillColorB;
};
NS_CC_END