本文整理汇总了C++中LEReferenceTo::hasGlyphClass方法的典型用法代码示例。如果您正苦于以下问题:C++ LEReferenceTo::hasGlyphClass方法的具体用法?C++ LEReferenceTo::hasGlyphClass怎么用?C++ LEReferenceTo::hasGlyphClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LEReferenceTo
的用法示例。
在下文中一共展示了LEReferenceTo::hasGlyphClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: matchGlyphClasses
le_bool ContextualSubstitutionBase::matchGlyphClasses(
const LEReferenceToArrayOf<le_uint16> &classArray,
le_uint16 glyphCount,
GlyphIterator *glyphIterator,
const LEReferenceTo<ClassDefinitionTable> &classDefinitionTable,
LEErrorCode &success,
le_bool backtrack)
{
if (LE_FAILURE(success)) { return FALSE; }
le_int32 direction = 1;
le_int32 match = 0;
if (backtrack) {
match = glyphCount - 1;
direction = -1;
}
while (glyphCount > 0) {
if (! glyphIterator->next()) {
return FALSE;
}
LEGlyphID glyph = glyphIterator->getCurrGlyphID();
le_int32 glyphClass = classDefinitionTable->getGlyphClass(classDefinitionTable, glyph, success);
le_int32 matchClass = SWAPW(classArray[match]);
if (glyphClass != matchClass) {
// Some fonts, e.g. Traditional Arabic, have classes
// in the class array which aren't in the class definition
// table. If we're looking for such a class, pretend that
// we found it.
if (classDefinitionTable->hasGlyphClass(classDefinitionTable, matchClass, success)) {
return FALSE;
}
}
glyphCount -= 1;
match += direction;
}
return TRUE;
}