本文整理汇总了C++中LEGlyphStorage::getGlyphPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LEGlyphStorage::getGlyphPosition方法的具体用法?C++ LEGlyphStorage::getGlyphPosition怎么用?C++ LEGlyphStorage::getGlyphPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LEGlyphStorage
的用法示例。
在下文中一共展示了LEGlyphStorage::getGlyphPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: adjustMarkGlyphs
void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)
{
float xAdjust = 0;
le_int32 p, glyphCount = glyphStorage.getGlyphCount();
if (LE_FAILURE(success)) {
return;
}
if (markFilter == NULL) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return;
}
float ignore, prev;
glyphStorage.getGlyphPosition(0, prev, ignore, success);
for (p = 0; p < glyphCount; p += 1) {
float next, xAdvance;
glyphStorage.getGlyphPosition(p + 1, next, ignore, success);
xAdvance = next - prev;
glyphStorage.adjustPosition(p, xAdjust, 0, success);
if (markFilter->accept(glyphStorage[p])) {
xAdjust -= xAdvance;
}
prev = next;
}
glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success);
}
示例2: adjustMarkGlyphs
void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)
{
float xAdjust = 0;
le_int32 c = 0, direction = 1, p;
le_int32 glyphCount = glyphStorage.getGlyphCount();
if (LE_FAILURE(success)) {
return;
}
if (markFilter == NULL) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return;
}
if (reverse) {
c = glyphCount - 1;
direction = -1;
}
float ignore, prev;
glyphStorage.getGlyphPosition(0, prev, ignore, success);
for (p = 0; p < charCount; p += 1, c += direction) {
float next, xAdvance;
glyphStorage.getGlyphPosition(p + 1, next, ignore, success);
xAdvance = next - prev;
_LETRACE("p#%d (%.2f,%.2f)", p, xAdvance, 0);
glyphStorage.adjustPosition(p, xAdjust, 0, success);
if (markFilter->accept(chars[c], success)) {
xAdjust -= xAdvance;
}
prev = next;
}
glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success);
}