查看完整版本: [-- 少数民族文字,一个字型索引对应多个字符的处理 --]

QTCN开发网 -> 其它技术开发讨论区 -> 少数民族文字,一个字型索引对应多个字符的处理 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

年年岁岁 2019-03-15 16:41

少数民族文字,一个字型索引对应多个字符的处理

void drawTextItem(const QPointF &p, const QTextItem &textItem)
{
const QTextItemInt &ti = static_cast<const QTextItemInt&>(textItem);

QFontEngine *fe = ti.fontEngine;

    QVarLengthArray<glyph_t>        glyphs;
    QVarLengthArray<QFixedPoint>    positions;
    QTransform m = QTransform::fromTranslate(p.x(), p.y());
    ti.fontEngine->getGlyphPositions(ti.glyphs, m, ti.flags, glyphs, positions);
    int countGlyph = glyphs.size();
    if (countGlyph == 0) return;

}

如上代码 ,如果是少数民族文字,存在 一个glyph index 对应2个或3个字符的情况,也就是多个字符构成一个字型
请高手指点,如果想根据 glyph index 得到所对应的 字符 编码,该如何处理?

或者,每个 glyph index 有几个字符构成,能得到这个值也可以

非常感谢各位!


查看完整版本: [-- 少数民族文字,一个字型索引对应多个字符的处理 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled