In WP8 cocos uses freetype2 to generate font bitmap and them shader to paint it.
First problem is that alpha channel in CCFreeTypeFont is always on set on full opacity.
Go to CCFreeTypeFont class, method draw_bitmap.
Find line with “pBuffer[index**] = 255;" and modify it to "pBuffer[index**] = value;”.
Method should look like this:
void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_Int x, FT_Int y)
{
FT_Int i, j, p, q;
FT_Int x_max = x + bitmap->width;
FT_Int y_max = y + bitmap->rows;
for (i = x, p = 0; i < x_max; i++, p++)
{
for ( j = y, q = 0; j < y_max; j++, q++ )
{
if (i < 0 || j < 0 || i >= m_width || j >= m_height)
continue;
unsigned char value = bitmap->buffer[q * bitmap->width + p];
if(value > 0)
{
FT_Int index = (j * m_width * 4) + (i * 4);
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = value;
}
}
}
}
Secondly (only for WP8 and Windows 8), to achieve final result, set CC_USE_LA88_LABELS to 0.
It’ll switch shader program to kCCShader_PositionTextureA8Color which will give you smooth antialiasing .