Android5.0 Recovery 支持中文
来源:互联网 发布:大数据服务 编辑:程序博客网 时间:2024/06/10 11:04
<span style="font-family: Arial, Helvetica, sans-serif;">网上已经很多开源的实现方式支持4.4的中文显示, 之前也修改过4.4的中文, 切到5.0发现需要修改。 修改的前提是得懂两个地方:</span>
1: 中文的头文件是如何生成和实现显示到屏幕点击打开链接的
头文件的生成需要两部:
1: 从 TTF 文件导出文字图片 (可以查看生成的图片显示的内容, 每行一个字符的竖直排列)
2: 从图片生成头文件
推荐看下 XIAOLU, 读一下 fontcn.py 文件基本上就了解了如何生成 中文头文件的。
2: 4.4 和 5.0 UI显示部分的区别
4.4以及之前的Recovery都是UI显示都是在 通过一个叫 pixelflinger 的中间件然后往FB上输出内容的。
5.0之后弃用了pixelflinger, 直接往FB上输出内容。
所以只需要针对之前的gr_text 做相应的修改就可以了。(其余的部分网上已经有代码了)
void gr_text(int x, int y, const char *s, int bold){ GRFont *gfont = gr_font; unsigned off, width, height, n; wchar_t ch; //if (!font->texture) return; if (gr_current_a == 0) return; //bold = bold && (font->texture->height != font->cheight); x += overscan_offset_x; y += overscan_offset_y; while(*s) { if(*((unsigned char*)(s)) < 0x20) { s++; continue; } off = getCharID(s); n = utf8_mbtowc(&ch, s, strlen(s)); if(n <= 0){ break; } s += n; if(off<95){ width = font.ewidth; height = font.eheight; }else{ width = font.cwidth; height = font.cheight; } unsigned char* src_p = gfont->fontdata[off]; unsigned char* dst_p = gr_draw->data + y*gr_draw->row_bytes + x*gr_draw->pixel_bytes; text_blend(src_p, width, dst_p, gr_draw->row_bytes, width, height); x += width; }}
0 0
- Android5.0 Recovery 支持中文
- Android5.0 recovery about update
- Android5.0 Recovery源代码分析与定制(一)
- Android5.0 Recovery源代码分析与定制---recovery UI相关(二)
- 使用android传感器自己编写温度计,湿度计 支持android5.0
- WINCE6.0 中文支持
- WINCE6.0 中文支持
- Android5.0
- Android5.0
- imx6sl recovery mode支持shell
- Android recovery支持adb shell
- [刷机教程] 刷中文recovery V880最简单的刷机教程,更新recovery,修复若干BUG,支持最新ROM
- android5.1 Recovery添加从U盘升级功能
- Recovery工作原理 api 中文
- Wince6.0 添加中文支持
- cocos2dx3.0 中文支持显示
- 中文支持
- 支持中文
- LeetCode 12 - Integer to Roman
- Qt之JSON生成与解析
- 第九周(向量类)
- CentOS 7.0,启用iptables防火墙
- Spring 异常解决办法
- Android5.0 Recovery 支持中文
- treeview控件(动态数据绑定+整行选择)(WPF)(二)
- 判断二叉数是否是平衡树
- Android—给控件设置边框
- java中数组与List相互转换的方法
- 扫描二维码自动识别手机APP下载地址
- Ryu代码解析(二)
- Vim基本功
- this class is not key value coding-compliant for the key nameField.'