FreeType.如何知道FT_Face中的符号数及其索引
FreeType. How to know number of symbols in FT_Face and its indices?
我想知道FT_Face中包含的所有符号,以将其渲染为纹理。FT_FaceRec有"FT_Long num_glyphs",但它只告诉我它的编号,而没有它的索引。
我能做点什么对于(wchat_t c=0;c<max_value;c++)//在此处加载字符c
但这样一来,如果字体没有字符,我就会有很多"矩形"。这是开销,因为它的矩形在纹理上会被去掉。
如何知道该字体真正包含的字符的glyph_index或wchar_t?
可以通过函数遍历字体中的所有字符:FT_Get_First_Char和FT_Get_Next_Char
示例:
FT_UInt index;
FT_ULong character = FT_Get_First_Char(face, &index);
while (true) {
// to do something
character = FT_Get_Next_Char(face, character, &index);
if (!index) break; // if FT_Get_Next_Char write 0 to index then
// have no more characters in font face
}
自由型包装
基于Ogre字体类,但使用多个纹理来存储字形,每个纹理都有固定的大小。
相关文章:
- 数组索引的值没有增加
- 芬威克树(BIT).找到具有给定累积频率的最小索引,单位为 O(logN)
- 在C++中,将大的无符号浮点数四舍五入为整数的最佳方法是什么
- 有符号的int和int-有没有一种方法可以在C++中区分它们
- 将无符号char*转换为std::istream*C++
- 如何在C++中将一个无符号的 int 转换为两个无符号的短裤?
- *无符号字符中的索引值
- 使用移位的无符号数字作为数组的索引号是一种很好的做法
- 为什么C++数组索引值是有符号的,而不是围绕size_t类型构建的(或者我错了)
- R 包安装错误:重新定位 0 具有无效的符号索引 11
- 为什么我不能使用在 Visual C++ 32 位中实现运算符无符号 int() 作为数组索引的类?
- FreeType.如何知道FT_Face中的符号数及其索引
- g++正在创建静态库:无法读取符号.存档没有索引
- C++:有符号或无符号数组索引
- 字符串下标超出范围.我不知道如何使用字符索引数组,所以我使用了(无符号整数),但它不起作用
- 数组索引的类型:有符号/无符号整数先锋
- 检查无符号整数是否没有索引的最佳实践
- 增强size_type的有符号/无符号比较和multi_array的索引
- OpenMP - OpenMP 语句中的索引变量'for'必须具有有符号整型
- c++ 64位-无法读取符号:存档没有索引;执行ranlib命令添加