while (*text) {
FT_Set_Transform(face, NULL, &pen);
index = FT_Get_Char_Index(face, *text);
error = FT_Load_Glyph(face, index, 0);
if (error) {
__E("Failed to load glyph for character %c\n", *text);
break;
}
if (face->glyph->format != FT_GLYPH_FORMAT_BITMAP) {
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
if (error) {
__E("Failed to render glyph for character %c\n", *text);
break;
}
}
width = face->glyph->bitmap.width;
height = face->glyph->bitmap.rows;
x = face->glyph->bitmap_left;
y = scrp->h - face->glyph->bitmap_top;
x_max = x + width;
y_max = y + height;
src = face->glyph->bitmap.buffer;
for (i = x, p = 0; i < x_max; i++, p++) {
for (j = y, q = 0; j < y_max; j++, q++) {
if (i >= scrp->w || j >= scrp->h)
continue;
sp = q * width + p;
dp = j * scrp->w + i;
pixel = src[sp] * fade / 255;
dst[dp] |= _8to5bit[pixel] | _8to6bit[pixel] << 5 |
_8to5bit[pixel] << 11;
}
}
text++;
pen.x += face->glyph->advance.x;
pen.y += face->glyph->advance.y;
}
用的是Unicode 编码
请大家指教哦
这段程序能处理中文吗??(菜鸟发问)
系统字体配置、中文显示和输入法问题
-
- 帖子: 1
- 注册时间: 2006-07-26 10:24
前往
- 公告/注意事项
- ↳ 新闻和通知
- ↳ 软件推荐
- 系统安装
- ↳ 教学和常见问答
- ↳ 系统安装和升级
- ↳ 启动和引导
- ↳ 网卡无线拨号
- ↳ 硬件与内核
- ↳ 笔记本及便携设备
- ↳ Ubuntu衍生版
- ↳ 其他类Unix OS发行版
- ↳ Debian发行版
- 配置美化
- ↳ 中文显示和输入法
- ↳ 个人配置文件存放点
- ↳ 软件文档翻译
- ↳ 窗口管理器及美化
- ↳ 桌面展示
- 软件使用
- ↳ 办公、图像、机械电子设计等
- ↳ Vim和Emacs
- ↳ 开源模板库
- ↳ 互联网相关软件
- ↳ 影音多媒体
- ↳ 游戏和模拟器
- ↳ 虚拟机和虚拟化
- ↳ Wine及其分支
- ↳ 其它类软件
- 服务器管理
- ↳ 服务器运维
- ↳ 云计算和容器(K8S/KVM/Docker/WSL等)
- ↳ Ubuntu VPS
- 程序设计与开发
- ↳ Shell脚本
- ↳ 软件/网站开发
- ↳ 内核及嵌入式开发
- ↳ Ubuntu编译和打包
- ↳ 开源小工具
- ↳ 挑战任务
- 感想与交流
- ↳ 深度PK版
- ↳ Ubuntu故事和感慨
- ↳ 同城交流
- ↳ 校园社团
- ↳ 港澳台校区
- ↳ 国外校区
- 站务区
- ↳ 论坛管理
- ↳ Ubuntu中文网上商店