ICU-9868 morx support (contributed - fix version check, minor fixes)

X-SVN-Rev: 33136
This commit is contained in:
Steven R. Loomis 2013-02-07 01:08:41 +00:00
parent 967319cfdb
commit feddf0fa6b
3 changed files with 11 additions and 22 deletions

View File

@ -79,16 +79,16 @@ TTGlyphID ContextualGlyphSubstitutionProcessor2::lookup(le_uint32 offset, LEGlyp
switch (format) {
case ltfSimpleArray: {
#ifdef TEST_FORMAT
// Disabled pending for design review
// Disabled pending for design review
SimpleArrayLookupTable *lookupTable0 = (SimpleArrayLookupTable *) lookupTable;
TTGlyphID glyphCode = (TTGlyphID) LE_GET_GLYPH(gid);
newGlyph = SWAPW(lookupTable0->valueArray[glyphCode]);
#endif
break;
}
case ltfSegmentSingle: {
case ltfSegmentSingle: {
#ifdef TEST_FORMAT
// Disabled pending for design review
// Disabled pending for design review
SegmentSingleLookupTable *lookupTable2 = (SegmentSingleLookupTable *) lookupTable;
const LookupSegment *segment = lookupTable2->lookupSegment(lookupTable2->segments, gid);
if (segment != NULL) {
@ -101,9 +101,10 @@ TTGlyphID ContextualGlyphSubstitutionProcessor2::lookup(le_uint32 offset, LEGlyp
printf("Context Lookup Table Format4: specific interpretation needed!\n");
break;
}
case ltfSingleTable: {
case ltfSingleTable:
{
#ifdef TEST_FORMAT
// Disabled pending for design review
// Disabled pending for design review
SingleTableLookupTable *lookupTable6 = (SingleTableLookupTable *) lookupTable;
const LookupSingle *segment = lookupTable6->lookupSingle(lookupTable6->entries, gid);
if (segment != NULL) {

View File

@ -602,22 +602,9 @@ LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstan
break;
}
} else {
MorphTableHeader2 *table = (MorphTableHeader2 *)fontInstance->getFontTable(morxTableTag);
if (table != NULL) {
le_uint32 version = SWAPL(table->version);
switch (version) {
case 0x10000: { // mort e.g.:Skia Regular
const MorphTableHeader *mortTable = (MorphTableHeader *) fontInstance->getFontTable(mortTableTag);
if (mortTable != NULL) {
result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, mortTable, success);
}
break;
}
case 0x20000: { // morx
result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, table, typoFlags, success);
break;
}
}
MorphTableHeader2 *morxTable = (MorphTableHeader2 *)fontInstance->getFontTable(morxTableTag);
if (morxTable != NULL) {
result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, morxTable, typoFlags, success);
} else {
const MorphTableHeader *mortTable = (MorphTableHeader *) fontInstance->getFontTable(mortTableTag);
if (mortTable != NULL) { // mort

View File

@ -58,7 +58,7 @@ void StateTableProcessor2::process(LEGlyphStorage &glyphStorage)
beginStateTable();
switch (format) {
case ltfSimpleArray: {
printf("Lookup Table Format0 untested!\n");
#ifdef TEST_FORMAT
SimpleArrayLookupTable *lookupTable0 = (SimpleArrayLookupTable *) classTable;
while ((dir == 1 && currGlyph <= glyphCount) || (dir == -1 && currGlyph >= -1)) {
LookupValue classCode = classCodeOOB;
@ -78,6 +78,7 @@ void StateTableProcessor2::process(LEGlyphStorage &glyphStorage)
EntryTableIndex2 entryTableIndex = SWAPW(stateArray[classCode + currentState * nClasses]);
currentState = processStateEntry(glyphStorage, currGlyph, entryTableIndex); // return a zero-based index instead of a byte offset
}
#endif
break;
}
case ltfSegmentSingle: {