本文整理汇总了C++中LEGlyphStorage::getGlyphCount方法的典型用法代码示例。如果您正苦于以下问题:C++ LEGlyphStorage::getGlyphCount方法的具体用法?C++ LEGlyphStorage::getGlyphCount怎么用?C++ LEGlyphStorage::getGlyphCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LEGlyphStorage
的用法示例。
在下文中一共展示了LEGlyphStorage::getGlyphCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: positionGlyphs
// Input: glyphs
// Output: positions
void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return;
}
glyphStorage.allocatePositions(success);
if (LE_FAILURE(success)) {
return;
}
le_int32 i, glyphCount = glyphStorage.getGlyphCount();
for (i = 0; i < glyphCount; i += 1) {
LEPoint advance;
glyphStorage.setPosition(i, x, y, success);
fFontInstance->getGlyphAdvance(glyphStorage[i], advance);
x += advance.fX;
y += advance.fY;
}
glyphStorage.setPosition(glyphCount, x, y, success);
}
示例3: glyphPostProcessing
le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
glyphStorage.adoptGlyphArray(tempGlyphStorage);
glyphStorage.adoptCharIndicesArray(tempGlyphStorage);
glyphStorage.adoptAuxDataArray(tempGlyphStorage);
glyphStorage.adoptGlyphCount(tempGlyphStorage);
return glyphStorage.getGlyphCount();
}
示例4: process
void SimpleArrayProcessor::process(LEGlyphStorage &glyphStorage)
{
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) {
TTGlyphID newGlyph = SWAPW(simpleArrayLookupTable->valueArray[LE_GET_GLYPH(thisGlyph)]);
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例5: process
void SingleTableProcessor::process(LEGlyphStorage &glyphStorage)
{
const LookupSingle *entries = singleTableLookupTable->entries;
le_int32 glyph;
le_int32 glyphCount = glyphStorage.getGlyphCount();
for (glyph = 0; glyph < glyphCount; glyph += 1) {
const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(entries, glyphStorage[glyph]);
if (lookupSingle != NULL) {
glyphStorage[glyph] = SWAPW(lookupSingle->value);
}
}
}
示例6: process
void SimpleArrayProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
LEReferenceToArrayOf<LookupValue> valueArray(simpleArrayLookupTable, success, (const LookupValue*)&simpleArrayLookupTable->valueArray, LE_UNBOUNDED_ARRAY);
for (glyph = 0; LE_SUCCESS(success) && (glyph < glyphCount); glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) {
TTGlyphID newGlyph = SWAPW(valueArray.getObject(LE_GET_GLYPH(thisGlyph),success));
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例7: SWAPW
void SingleTableProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if(LE_FAILURE(success)) return;
const LookupSingle *entries = singleTableLookupTable->entries;
le_int32 glyph;
le_int32 glyphCount = glyphStorage.getGlyphCount();
for (glyph = 0; glyph < glyphCount; glyph += 1) {
const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(singleTableLookupTable, entries, glyphStorage[glyph], success);
if (lookupSingle != NULL) {
glyphStorage[glyph] = SWAPW(lookupSingle->value);
}
}
}
示例8: process
le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments,
le_bool rightToLeft, const LEReferenceTo<GlyphDefinitionTableHeader> &glyphDefinitionTableHeader,
const LEFontInstance *fontInstance, LEErrorCode& success) const
{
if (LE_FAILURE(success)) {
return 0;
}
le_int32 glyphCount = glyphStorage.getGlyphCount();
if (lookupSelectArray == NULL) {
return glyphCount;
}
GlyphIterator glyphIterator(glyphStorage, glyphPositionAdjustments,
rightToLeft, 0, 0, glyphDefinitionTableHeader, success);
le_int32 newGlyphCount = glyphCount;
for (le_uint16 order = 0; order < lookupOrderCount && LE_SUCCESS(success); order += 1) {
le_uint16 lookup = lookupOrderArray[order];
FeatureMask selectMask = lookupSelectArray[lookup];
if (selectMask != 0) {
_LETRACE("Processing order#%d/%d", order, lookupOrderCount);
const LEReferenceTo<LookupTable> lookupTable = lookupListTable->getLookupTable(lookupListTable, lookup, success);
if (!lookupTable.isValid() ||LE_FAILURE(success) ) {
continue;
}
le_uint16 lookupFlags = SWAPW(lookupTable->lookupFlags);
glyphIterator.reset(lookupFlags, selectMask);
while (glyphIterator.findFeatureTag()) {
applyLookupTable(lookupTable, &glyphIterator, fontInstance, success);
if (LE_FAILURE(success)) {
#if LE_TRACE
_LETRACE("Failure for lookup 0x%x - %s\n", lookup, u_errorName((UErrorCode)success));
#endif
return 0;
}
}
newGlyphCount = glyphIterator.applyInsertions();
}
}
return newGlyphCount;
}
示例9: SWAPW
void SimpleArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
if (LE_FAILURE(success)) return;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) {
TTGlyphID newGlyph = SWAPW(valueArray(LE_GET_GLYPH(thisGlyph),success));
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例10: process
void TrimmedArrayProcessor::process(LEGlyphStorage &glyphStorage)
{
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph);
if ((ttGlyph > firstGlyph) && (ttGlyph < lastGlyph)) {
TTGlyphID newGlyph = SWAPW(trimmedArrayLookupTable->valueArray[ttGlyph - firstGlyph]);
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例11: SWAPW
void TrimmedArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if(LE_FAILURE(success)) return;
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph);
if ((ttGlyph > firstGlyph) && (ttGlyph < lastGlyph)) {
TTGlyphID newGlyph = SWAPW(valueArray(ttGlyph - firstGlyph, success));
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例12: process
void SegmentSingleProcessor::process(LEGlyphStorage &glyphStorage)
{
const LookupSegment *segments = segmentSingleLookupTable->segments;
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segments, thisGlyph);
if (lookupSegment != NULL) {
TTGlyphID newGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph) + SWAPW(lookupSegment->value);
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例13: 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);
}
示例14: SWAPW
void SegmentSingleProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
const LookupSegment *segments = segmentSingleLookupTable->segments;
le_int32 glyphCount = glyphStorage.getGlyphCount();
le_int32 glyph;
if (LE_FAILURE(success)) return;
for (glyph = 0; glyph < glyphCount; glyph += 1) {
LEGlyphID thisGlyph = glyphStorage[glyph];
const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segmentSingleLookupTable, segments, thisGlyph, success);
if (lookupSegment != NULL && LE_SUCCESS(success)) {
TTGlyphID newGlyph = (TTGlyphID) LE_GET_GLYPH(thisGlyph) + SWAPW(lookupSegment->value);
glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph);
}
}
}
示例15: process
le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments,
le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader,
const LEFontInstance *fontInstance, LEErrorCode& success) const
{
if (LE_FAILURE(success)) {
return 0;
}
le_int32 glyphCount = glyphStorage.getGlyphCount();
if (lookupSelectArray == NULL) {
return glyphCount;
}
GlyphIterator glyphIterator(glyphStorage, glyphPositionAdjustments,
rightToLeft, 0, 0, glyphDefinitionTableHeader);
le_int32 newGlyphCount = glyphCount;
for (le_uint16 order = 0; order < lookupOrderCount; order += 1) {
le_uint16 lookup = lookupOrderArray[order];
FeatureMask selectMask = lookupSelectArray[lookup];
if (selectMask != 0) {
const LookupTable *lookupTable = lookupListTable->getLookupTable(lookup);
le_uint16 lookupFlags = SWAPW(lookupTable->lookupFlags);
glyphIterator.reset(lookupFlags, selectMask);
while (glyphIterator.findFeatureTag()) {
applyLookupTable(lookupTable, &glyphIterator, fontInstance, success);
if (LE_FAILURE(success)) {
return 0;
}
}
newGlyphCount = glyphIterator.applyInsertions();
}
}
return newGlyphCount;
}