本文整理汇总了C++中LEReferenceTo::getGlyphClass方法的典型用法代码示例。如果您正苦于以下问题:C++ LEReferenceTo::getGlyphClass方法的具体用法?C++ LEReferenceTo::getGlyphClass怎么用?C++ LEReferenceTo::getGlyphClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LEReferenceTo
的用法示例。
在下文中一共展示了LEReferenceTo::getGlyphClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accept
le_bool CanonMarkFilter::accept(LEGlyphID glyph) const
{
LEErrorCode success = LE_NO_ERROR;
le_int32 glyphClass = classDefTable->getGlyphClass(classDefTable, glyph, success);
if(LE_FAILURE(success)) return false;
return glyphClass != 0;
}
示例2: reorderMarks
void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft,
LEUnicode *outChars, LEGlyphStorage &glyphStorage)
{
LEErrorCode success = LE_NO_ERROR;
LEReferenceTo<GlyphDefinitionTableHeader> gdefTable(LETableReference::kStaticData, CanonShaping::glyphDefinitionTable, CanonShaping::glyphDefinitionTableLen);
LEReferenceTo<ClassDefinitionTable> classTable = gdefTable->getMarkAttachClassDefinitionTable(gdefTable, success);
le_int32 *combiningClasses = LE_NEW_ARRAY(le_int32, charCount);
le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount);
le_int32 i;
if (combiningClasses == NULL || indices == NULL) {
if (combiningClasses != NULL) {
LE_DELETE_ARRAY(combiningClasses);
}
if (indices != NULL) {
LE_DELETE_ARRAY(indices);
}
return;
}
for (i = 0; i < charCount; i += 1) {
combiningClasses[i] = classTable->getGlyphClass(classTable, (LEGlyphID) inChars[i], success);
indices[i] = i;
}
for (i = 0; i < charCount; i += 1) {
if (combiningClasses[i] != 0) {
le_int32 mark;
for (mark = i; mark < charCount; mark += 1) {
if (combiningClasses[mark] == 0) {
break;
}
}
sortMarks(indices, combiningClasses, i, mark);
}
}
le_int32 out = 0, dir = 1;
if (rightToLeft) {
out = charCount - 1;
dir = -1;
}
for (i = 0; i < charCount; i += 1, out += dir) {
le_int32 index = indices[i];
outChars[i] = inChars[index];
glyphStorage.setCharIndex(out, index, success);
}
LE_DELETE_ARRAY(indices);
LE_DELETE_ARRAY(combiningClasses);
}
示例3: 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;
}