cocos2dx:ios7字体显示问题解决方案
2013-11-06 10:16
288 查看
查找cocos2dx引擎下的
../cocos2dx/platform/ios/CCimage
目录(大概270行左右)
搜索 draw text ,修正如下:
unsigned char* data = new unsigned char[(int)(dim.width * dim.height * 4)];
memset(data, 0, (int)(dim.width * dim.height * 4));
// draw text
// Guukona add _ios7语言问题
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(data, (size_t)dim.width, (size_t)dim.height, 8, (size_t)dim.width * 4, colorSpace, kCGImageAlphaPremultipliedLast |
kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
if (! context)
{
delete[] data;
break;
}
//-------
CGContextSetRGBFillColor(context, 1, 1, 1, 1);
CGContextTranslateCTM(context, 0.0f, dim.height);
CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential
UIGraphicsPushContext(context);
../cocos2dx/platform/ios/CCimage
目录(大概270行左右)
搜索 draw text ,修正如下:
unsigned char* data = new unsigned char[(int)(dim.width * dim.height * 4)];
memset(data, 0, (int)(dim.width * dim.height * 4));
// draw text
// Guukona add _ios7语言问题
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(data, (size_t)dim.width, (size_t)dim.height, 8, (size_t)dim.width * 4, colorSpace, kCGImageAlphaPremultipliedLast |
kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
if (! context)
{
delete[] data;
break;
}
//-------
CGContextSetRGBFillColor(context, 1, 1, 1, 1);
CGContextTranslateCTM(context, 0.0f, dim.height);
CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential
UIGraphicsPushContext(context);
相关文章推荐
- 润乾报表在linux系统下字体显示问题解决方案
- 扩展显示器失败:“显示信号输入超出范围“问题解决方案
- Unity3D研究院之解决ttf繁体字体不显示问题
- IE8下的VML显示问题解决方案
- 如何解决Xshell使用时中文字体是躺倒显示的问题
- Ubuntu/Debian下JAVA 中文/图片中文字体乱码显示问题解决方法
- 解决 flash 10 中文字体显示成方块的问题
- MathType 6.0 中某些符号不能正确显示 (乱码) , MT Extra (TrueType) 字体问题解决
- 表格的宽度点击后产生图标换行问题解决以及字体在手机中不正常显示
- Android设置大字体后文字被遮盖、显示补全问题解决
- 解决在部分手机webview字体显示过小的问题
- 解决Outlook2007中指定字体大小显示却“字体显示忽大忽小”的问题
- 安讯报表发布到pdf后,字体只显示宋体效果问题的解决方法
- Unity生成webgl,中文字体不显示问题解决
- 树莓派 Learning 002 装机后的必要操作 11 解决在使用SecureCRT软件链接树莓派时,SecureCRT软件的终端中显示树莓派的中文字体乱码的问题
- myeclipse 在mac中字体模糊问题解决方案
- SyntaxHighlighter行号显示错误问题解决方案
- 关于数据库使用numeric(18,2) ,java后台使用double会出现金额显示问题解决方案。
- Linux下jdk1.5的安装及中文显示问题解决方案
- 解决Unity中,使用Ngui 的默认字体Arial,在部分Android设备显示中文不清楚,或者显示不出来问题