本文整理汇总了C++中LE_FAILURE函数的典型用法代码示例。如果您正苦于以下问题:C++ LE_FAILURE函数的具体用法?C++ LE_FAILURE怎么用?C++ LE_FAILURE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LE_FAILURE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: glyphProcessing
// Input: characters, tags
// Output: glyphs, char indices
le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
le_int32 retCount = OpenTypeLayoutEngine::glyphProcessing(chars, offset, count, max, rightToLeft, glyphStorage, success);
if (LE_FAILURE(success)) {
return 0;
}
if (fVersion2) {
IndicReordering::finalReordering(glyphStorage,retCount);
IndicReordering::applyPresentationForms(glyphStorage,retCount);
OpenTypeLayoutEngine::glyphSubstitution(count,max, rightToLeft, glyphStorage, success);
} else {
IndicReordering::adjustMPres(fMPreFixups, glyphStorage, success);
}
return retCount;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:29,代码来源:IndicLayoutEngine.cpp
示例2: SWAPW
U_NAMESPACE_BEGIN
le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator,
const LEFontInstance *fontInstance, LEErrorCode& success) const
{
if (LE_FAILURE(success)) {
return 0;
}
le_uint16 lookupType = SWAPW(lookupTable->lookupType);
le_uint16 subtableCount = SWAPW(lookupTable->subTableCount);
le_int32 startPosition = glyphIterator->getCurrStreamPosition();
le_uint32 delta;
for (le_uint16 subtable = 0; subtable < subtableCount; subtable += 1) {
const LookupSubtable *lookupSubtable = lookupTable->getLookupSubtable(subtable);
delta = applySubtable(lookupSubtable, lookupType, glyphIterator, fontInstance, success);
if (delta > 0 && LE_FAILURE(success)) {
return 1;
}
glyphIterator->setCurrStreamPosition(startPosition);
}
return 1;
}
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:28,代码来源:LookupProcessor.cpp
示例3: characterProcessing
// Input: characters
// Output: characters, char indices, tags
// Returns: output character count
le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
glyphStorage.adoptGlyphCount(count);
glyphStorage.allocateAuxData(success);
if (LE_FAILURE(success)) {
success = LE_MEMORY_ALLOCATION_ERROR;
return 0;
}
switch (fScriptCode) {
case arabScriptCode:
{
ArabicShaping::shape(chars, offset, count, max, rightToLeft, glyphStorage);
break;
}
case hebrScriptCode:
HebrewShaping::shape(chars, offset, count, max, rightToLeft, glyphStorage);
break;
}
return count;
}
开发者ID:andrewleech,项目名称:firebird,代码行数:37,代码来源:ArabicLayoutEngine.cpp
示例4: mapCharsToGlyphs
// Input: characters, tags
// Output: glyphs, char indices
le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, glyphStorage, success);
if (LE_FAILURE(success)) {
return 0;
}
if (fGSUBTable.isValid()) {
if (fScriptTagV2 != nullScriptTag && fGSUBTable->coversScriptAndLanguage(fGSUBTable, fScriptTagV2, fLangSysTag, success)) {
count = fGSUBTable->process(fGSUBTable, glyphStorage, rightToLeft, fScriptTagV2, fLangSysTag, fGDEFTable, fSubstitutionFilter,
fFeatureMap, fFeatureMapCount, fFeatureOrder, success);
} else {
count = fGSUBTable->process(fGSUBTable, glyphStorage, rightToLeft, fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter,
fFeatureMap, fFeatureMapCount, fFeatureOrder, success);
}
}
return count;
}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:33,代码来源:OpenTypeLayoutEngine.cpp
示例5: SWAPW
U_NAMESPACE_BEGIN
le_uint32 LookupProcessor::applyLookupTable(const LEReferenceTo<LookupTable> &lookupTable, GlyphIterator *glyphIterator,
const LEFontInstance *fontInstance, LEErrorCode& success) const
{
if (LE_FAILURE(success)) {
return 0;
}
le_uint16 lookupType = SWAPW(lookupTable->lookupType);
le_uint16 subtableCount = SWAPW(lookupTable->subTableCount);
le_int32 startPosition = glyphIterator->getCurrStreamPosition();
le_uint32 delta;
for (le_uint16 subtable = 0; subtable < subtableCount; subtable += 1) {
LEReferenceTo<LookupSubtable> lookupSubtable = lookupTable->getLookupSubtable(lookupTable, subtable, success);
delta = applySubtable(lookupSubtable, lookupType, glyphIterator, fontInstance, success);
if (delta > 0 && LE_FAILURE(success)) {
#if LE_TRACE
_LETRACE("Posn #%d, type %X, applied subtable #%d/%d - %s\n", startPosition, lookupType, subtable, subtableCount, u_errorName((UErrorCode)success));
#endif
return 1;
}
glyphIterator->setCurrStreamPosition(startPosition);
}
return 1;
}
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:30,代码来源:LookupProcessor.cpp
示例6: 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);
}
开发者ID:mason105,项目名称:red5cpp,代码行数:28,代码来源:LayoutEngine.cpp
示例7: fParagraphLayout
Paragraph::Paragraph(const LEUnicode chars[], int32_t charCount, const FontRuns *fontRuns, LEErrorCode &status)
: fParagraphLayout(NULL), fLineCount(0), fLinesMax(0), fLinesGrow(LINE_GROW), fLines(NULL), fChars(NULL),
fLineHeight(-1), fAscent(-1), fWidth(-1), fHeight(-1)
{
if (LE_FAILURE(status)) {
return;
}
LocaleRuns *locales = NULL;
fChars = LE_NEW_ARRAY(LEUnicode, charCount);
LE_ARRAY_COPY(fChars, chars, charCount);
fParagraphLayout = new ParagraphLayout(fChars, charCount, fontRuns, NULL, NULL, locales, UBIDI_DEFAULT_LTR, FALSE, status);
if (LE_FAILURE(status)) {
return;
}
le_int32 ascent = fParagraphLayout->getAscent();
le_int32 descent = fParagraphLayout->getDescent();
le_int32 leading = fParagraphLayout->getLeading();
fLineHeight = ascent + descent + leading;
fAscent = ascent;
}
开发者ID:narolez571,项目名称:firebird,代码行数:26,代码来源:paragraph.cpp
示例8: characterProcessing
le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
LEUnicode *outChars = NULL;
LEGlyphStorage fakeGlyphStorage;
le_int32 outCharCount, outGlyphCount, fakeGlyphCount;
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, fakeGlyphStorage, success);
if (LE_FAILURE(success)) {
return 0;
}
if (outChars != NULL) {
fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success);
LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work...
//adjustGlyphs(outChars, 0, outCharCount, rightToLeft, fakeGlyphs, fakeGlyphCount);
} else {
fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, fakeGlyphStorage, success);
//adjustGlyphs(chars, offset, count, rightToLeft, fakeGlyphs, fakeGlyphCount);
}
outGlyphCount = glyphPostProcessing(fakeGlyphStorage, glyphStorage, success);
return outGlyphCount;
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:34,代码来源:OpenTypeLayoutEngine.cpp
示例9: characterProcessing
le_int32 HanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/,
LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
glyphStorage.allocateGlyphArray(count, FALSE, success);
glyphStorage.allocateAuxData(success);
if (LE_FAILURE(success)) {
return 0;
}
// FIXME: do we want to add the 'trad' feature for 'ZHT' and the
// 'smpl' feature for 'ZHS'? If we do this, we can remove the exact
// flag from the language tag lookups, so we can use these features
// with the default LangSys...
for (le_int32 i = 0; i < count; i += 1) {
glyphStorage.setAuxData(i, features, success);
}
return count;
}
开发者ID:icu-project,项目名称:icu4c,代码行数:29,代码来源:HanLayoutEngine.cpp
示例10: sprintf
const LEFontInstance *FontMap::getScriptFont(le_int32 scriptCode, LEErrorCode &status)
{
if (LE_FAILURE(status)) {
return NULL;
}
if (scriptCode <= -1 || scriptCode >= scriptCodeCount) {
status = LE_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
le_int32 fontIndex = fFontIndices[scriptCode];
if (fontIndex < 0) {
sprintf(errorMessage, "No font was set for script %s", uscript_getName((UScriptCode) scriptCode));
fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
status = LE_FONT_FILE_NOT_FOUND_ERROR;
return NULL;
}
if (fFontInstances[fontIndex] == NULL) {
fFontInstances[fontIndex] = openFont(fFontNames[fontIndex], fPointSize, status);
if (LE_FAILURE(status)) {
sprintf(errorMessage, "Could not open font file %s", fFontNames[fontIndex]);
fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
return NULL;
}
}
return fFontInstances[fontIndex];
}
开发者ID:mason105,项目名称:red5cpp,代码行数:33,代码来源:FontMap.cpp
示例11: main
int main(int argc, char *argv[])
{
le_int32 failures = 0;
for (le_int32 test = 0; test < testCount; test += 1) {
LEErrorCode fontStatus = LE_NO_ERROR;
printf("Test %d, font = %s... ", test, testInputs[test].fontName);
PortableFontInstance fontInstance(testInputs[test].fontName, 12, fontStatus);
if (LE_FAILURE(fontStatus)) {
printf("could not open font.\n");
continue;
}
LEErrorCode success = LE_NO_ERROR;
LayoutEngine *engine = LayoutEngine::layoutEngineFactory(&fontInstance, testInputs[test].scriptCode, -1, success);
le_int32 textLength = testInputs[test].textLength;
le_bool result;
TestResult actual;
if (LE_FAILURE(success)) {
// would be nice to print the script name here, but
// don't want to maintain a table, and don't want to
// require ICU just for the script name...
printf("could not create a LayoutEngine.\n");
continue;
}
actual.glyphCount = engine->layoutChars(testInputs[test].text, 0, textLength, textLength, testInputs[test].rightToLeft, 0, 0, success);
actual.glyphs = new LEGlyphID[actual.glyphCount];
actual.indices = new le_int32[actual.glyphCount];
actual.positions = new float[actual.glyphCount * 2 + 2];
engine->getGlyphs(actual.glyphs, success);
engine->getCharIndices(actual.indices, success);
engine->getGlyphPositions(actual.positions, success);
result = compareResults(test, &testResults[test], &actual);
if (result) {
printf("passed.\n");
} else {
failures += 1;
printf("failed.\n");
}
delete[] actual.positions;
delete[] actual.indices;
delete[] actual.glyphs;
delete engine;
}
return failures;
}
开发者ID:andrewleech,项目名称:firebird,代码行数:57,代码来源:letest.cpp
示例12: SWAPW
LEReferenceTo<ScriptTable> ScriptListTable::findScript(const LETableReference &base, LETag scriptTag, LEErrorCode &success) const
{
if (LE_FAILURE(success) ) {
return LEReferenceTo<ScriptTable>(); // get out
}
/*
* There are some fonts that have a large, bogus value for scriptCount. To try
* and protect against this, we use the offset in the first scriptRecord,
* which we know has to be past the end of the scriptRecordArray, to compute
* a value which is greater than or equal to the actual script count.
*
* Note: normally, the first offset will point to just after the scriptRecordArray,
* but there's no guarantee of this, only that it's *after* the scriptRecordArray.
* Because of this, a binary serach isn't safe, because the new count may include
* data that's not actually in the scriptRecordArray and hence the array will appear
* to be unsorted.
*/
le_uint16 count = SWAPW(scriptCount);
if (count == 0) {
return LEReferenceTo<ScriptTable>(); // no items, no search
}
// attempt to construct a ref with at least one element
LEReferenceToArrayOf<ScriptRecord> oneElementTable(base, success, &scriptRecordArray[0], 1);
if( LE_FAILURE(success) ) {
return LEReferenceTo<ScriptTable>(); // couldn't even read the first record - bad font.
}
le_uint16 limit = ((SWAPW(scriptRecordArray[0].offset) - sizeof(ScriptListTable)) / sizeof(scriptRecordArray)) + ANY_NUMBER;
Offset scriptTableOffset = 0;
if (count > limit) {
// the scriptCount value is bogus; do a linear search
// because limit may still be too large.
LEReferenceToArrayOf<ScriptRecord> scriptRecordArrayRef(base, success, &scriptRecordArray[0], limit);
for(le_int32 s = 0; (s < limit)&&LE_SUCCESS(success); s += 1) {
if (SWAPT(scriptRecordArrayRef(s,success).tag) == scriptTag) {
scriptTableOffset = SWAPW(scriptRecordArrayRef(s,success).offset);
break;
}
}
} else {
LEReferenceToArrayOf<ScriptRecord> scriptRecordArrayRef(base, success, &scriptRecordArray[0], count);
scriptTableOffset = OpenTypeUtilities::getTagOffset(scriptTag, scriptRecordArrayRef, success);
}
if (scriptTableOffset != 0) {
return LEReferenceTo<ScriptTable>(base, success, scriptTableOffset);
}
return LEReferenceTo<ScriptTable>();
}
开发者ID:icu-project,项目名称:icu4c,代码行数:56,代码来源:ScriptAndLanguage.cpp
示例13: XeTeXFontInst
XeTeXFontInst_FT2::XeTeXFontInst_FT2(const char* pathname, int index, float pointSize, LEErrorCode &status)
: XeTeXFontInst(pointSize, status)
, face(0)
, fFreeTypeOnly(false)
{
if (LE_FAILURE(status)) {
return;
}
FT_Error err;
if (!gFreeTypeLibrary) {
err = FT_Init_FreeType(&gFreeTypeLibrary);
if (err != 0) {
fprintf(stderr, "FreeType initialization failed! (%d)\n", err);
exit(1);
}
}
err = FT_New_Face(gFreeTypeLibrary, (char*)pathname, index, &face);
if (err != 0) {
status = LE_FONT_FILE_NOT_FOUND_ERROR;
return;
}
/* for non-sfnt-packaged fonts (presumably Type 1), see if there is an AFM file we can attach */
if (index == 0 && !FT_IS_SFNT(face)) {
char* afm = new char[strlen((const char*)pathname) + 5]; // room to append ".afm"
strcpy(afm, (const char*)pathname);
char* p = strrchr(afm, '.');
if (p == NULL || strlen(p) != 4 || tolower(*(p+1)) != 'p' || tolower(*(p+2)) != 'f')
strcat(afm, ".afm"); // append .afm if the extension didn't seem to be .pf[ab]
else
strcpy(p, ".afm"); // else replace extension with .afm
FT_Attach_File(face, afm); // ignore error code; AFM might not exist
delete[] afm;
fFreeTypeOnly = true;
}
initialize(status);
if (LE_FAILURE(status))
return;
char buf[20];
if (index > 0)
sprintf(buf, ":%d", index);
else
buf[0] = 0;
fFilename = new char[strlen(pathname) + 2 + strlen(buf) + 1];
sprintf(fFilename, "[%s%s]", pathname, buf);
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:52,代码来源:XeTeXFontInst_FT2.cpp
示例14: getGlyphCoverage
le_uint32 PairPositioningFormat1Subtable::process(const LEReferenceTo<PairPositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
{
LEGlyphID firstGlyph = glyphIterator->getCurrGlyphID();
le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success);
if (LE_FAILURE(success)) {
return 0;
}
GlyphIterator tempIterator(*glyphIterator);
if (coverageIndex >= 0 && glyphIterator->next()) {
Offset pairSetTableOffset = SWAPW(pairSetTableOffsetArray[coverageIndex]);
LEReferenceTo<PairSetTable> pairSetTable(base, success, ((char *) this + pairSetTableOffset));
if (LE_FAILURE(success)) {
return 0;
}
le_uint16 pairValueCount = SWAPW(pairSetTable->pairValueCount);
le_int16 valueRecord1Size = ValueRecord::getSize(SWAPW(valueFormat1));
le_int16 valueRecord2Size = ValueRecord::getSize(SWAPW(valueFormat2));
le_int16 recordSize = sizeof(PairValueRecord) - sizeof(ValueRecord) + valueRecord1Size + valueRecord2Size;
LEGlyphID secondGlyph = glyphIterator->getCurrGlyphID();
LEReferenceTo<PairValueRecord> pairValueRecord;
if (pairValueCount != 0) {
pairValueRecord = findPairValueRecord(base, (TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize, success);
}
if (pairValueRecord.isEmpty()) {
return 0;
}
if (valueFormat1 != 0) {
pairValueRecord->valueRecord1.adjustPosition(SWAPW(valueFormat1), (char *) this, tempIterator, fontInstance);
}
if (valueFormat2 != 0) {
const ValueRecord *valueRecord2 = (const ValueRecord *) ((char *) &pairValueRecord->valueRecord1 + valueRecord1Size);
valueRecord2->adjustPosition(SWAPW(valueFormat2), (char *) this, *glyphIterator, fontInstance);
}
// back up glyphIterator so second glyph can be
// first glyph in the next pair
glyphIterator->prev();
return 1;
}
return 0;
}
开发者ID:sakeinntojiu,项目名称:openjdk8-jdk,代码行数:49,代码来源:PairPositioningSubtables.cpp
示例15: CharSubstitutionFilter
le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
if (offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
const GlyphSubstitutionTableHeader *canonGSUBTable = (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable;
LETag scriptTag = OpenTypeLayoutEngine::getScriptTag(fScriptCode);
LETag langSysTag = OpenTypeLayoutEngine::getLangSysTag(fLanguageCode);
le_int32 i, dir = 1, out = 0, outCharCount = count;
if (rightToLeft) {
out = count - 1;
dir = -1;
}
if (canonGSUBTable->coversScript(scriptTag)) {
CharSubstitutionFilter *substitutionFilter = new CharSubstitutionFilter(fFontInstance);
glyphStorage.allocateGlyphArray(count, rightToLeft, success);
glyphStorage.allocateAuxData(success);
if (LE_FAILURE(success)) {
return 0;
}
for (i = 0; i < count; i += 1, out += dir) {
glyphStorage[i] = (LEGlyphID) chars[offset + i];
glyphStorage.setAuxData(i, (void *) canonFeatures, success);
}
outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, NULL);
outChars = LE_NEW_ARRAY(LEUnicode, outCharCount);
for (i = 0; i < outCharCount; i += 1) {
outChars[i] = (LEUnicode) LE_GET_GLYPH(glyphStorage[i]);
}
delete substitutionFilter;
}
return outCharCount;
}
开发者ID:andrewleech,项目名称:firebird,代码行数:49,代码来源:LayoutEngine.cpp
示例16: LE_GET_GLYPH
le_int32 ClassDefFormat2Table::getGlyphClass(const LETableReference& base, LEGlyphID glyphID, LEErrorCode &success) const
{
if(LE_FAILURE(success)) return 0;
TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(glyphID);
le_uint16 rangeCount = SWAPW(classRangeCount);
LEReferenceToArrayOf<GlyphRangeRecord> classRangeRecordArrayRef(base, success, &classRangeRecordArray[0], rangeCount);
le_int32 rangeIndex =
OpenTypeUtilities::getGlyphRangeIndex(ttGlyph, classRangeRecordArrayRef, success);
if (rangeIndex < 0 || LE_FAILURE(success)) {
return 0;
}
return SWAPW(classRangeRecordArrayRef(rangeIndex, success).rangeValue);
}
开发者ID:Gustfh,项目名称:jdk8u-dev-jdk,代码行数:15,代码来源:ClassDefinitionTables.cpp
示例17: glyphIterator
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;
}
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:48,代码来源:LookupProcessor.cpp
示例18: yUnitsToPoints
void XeTeXFontInst_FT2::initialize(LEErrorCode &status)
{
if (face == 0) {
status = LE_FONT_FILE_NOT_FOUND_ERROR;
return;
}
XeTeXFontInst::initialize(status);
if (LE_FAILURE(status)) {
/* font can ONLY be used via FreeType APIs, not direct table access */
fFreeTypeOnly = true;
status = LE_NO_ERROR;
/* fill in fields that XeTeXFontInst::initialize failed to get for us */
fUnitsPerEM = face->units_per_EM;
fAscent = yUnitsToPoints(face->ascender);
fDescent = yUnitsToPoints(face->descender);
// fLeading = ;
fItalicAngle = 0;
PS_FontInfoRec font_info;
if (FT_Get_PS_Font_Info(face, &font_info) == 0) {
// will return error if it wasn't a PS font
fItalicAngle = font_info.italic_angle;
}
}
return;
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:29,代码来源:XeTeXFontInst_FT2.cpp
示例19: mapCharsToGlyphs
void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[],
le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/,
LEGlyphStorage &glyphStorage, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return;
}
if (chars == NULL || offset < 0 || count < 0) {
success = LE_ILLEGAL_ARGUMENT_ERROR;
return;
}
le_int32 i, dir = 1, out = 0;
if (reverse) {
out = count - 1;
dir = -1;
}
glyphStorage.allocateGlyphArray(count, reverse, success);
for (i = 0; i < count; i += 1, out += dir) {
glyphStorage[out] = (LEGlyphID) chars[offset + i];
}
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:26,代码来源:ArabicLayoutEngine.cpp
示例20: while
void ContextualGlyphInsertionProcessor2::doInsertion(LEGlyphStorage &glyphStorage, le_int32 atGlyph, le_uint16 &index, le_uint16 count, le_bool /* isKashidaLike */, le_bool isBefore, LEErrorCode &success)
{
if (!count)
return;
LEGlyphID *insertGlyphs = glyphStorage.insertGlyphs(atGlyph, count + 1, success);
if (LE_FAILURE(success))
return;
for (le_uint32 glyph = 0; glyph < count + 1; glyph++)
insertGlyphs[glyph] = 0; // undef
// Note: Kashida vs Split Vowel seems to only affect selection and highlighting.
// We note the flag, but do not layout different.
// https://developer.apple.com/fonts/TTRefMan/RM06/Chap6mort.html
le_int16 targetIndex = 0;
if (isBefore) {
insertGlyphs[count] = glyphStorage[atGlyph];
} else {
insertGlyphs[targetIndex++] = glyphStorage[atGlyph];
}
while(count-- && LE_SUCCESS(success)) {
le_uint16 insertGlyph;
if (insertionAction.getObject(index++, insertGlyph, success))
insertGlyphs[targetIndex++] = SWAPW(insertGlyph);
}
}
开发者ID:testerjp,项目名称:icu-le-aat,代码行数:32,代码来源:ContextualGlyphInsertionProc2.cpp
注:本文中的LE_FAILURE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论