@ -2407,7 +2407,8 @@ static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyp
return m ;
}
}
} break ;
break ;
}
case 2 : {
stbtt_uint16 rangeCount = ttUSHORT ( coverageTable + 2 ) ;
@ -2431,12 +2432,10 @@ static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyp
return startCoverageIndex + glyph - strawStart ;
}
}
} break ;
break ;
}
default : {
// There are no other cases.
STBTT_assert ( 0 ) ;
} break ;
default : return - 1 ; // unsupported
}
return - 1 ;
@ -2454,7 +2453,8 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
if ( glyph > = startGlyphID & & glyph < startGlyphID + glyphCount )
return ( stbtt_int32 ) ttUSHORT ( classDef1ValueArray + 2 * ( glyph - startGlyphID ) ) ;
} break ;
break ;
}
case 2 : {
stbtt_uint16 classRangeCount = ttUSHORT ( classDefTable + 2 ) ;
@ -2476,12 +2476,11 @@ static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
else
return ( stbtt_int32 ) ttUSHORT ( classRangeRecord + 4 ) ;
}
} break ;
break ;
}
default : {
// Unsupported defition type; return an error.
return - 1 ;
} break ;
default :
return - 1 ; // Unsupported definition type, return an error.
}
// "All glyphs not assigned to a class fall into class 0". (OpenType spec)
@ -2497,7 +2496,7 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i
stbtt_uint8 * lookupList ;
stbtt_uint16 lookupCount ;
stbtt_uint8 * data ;
stbtt_int32 i ;
stbtt_int32 i , st i;
if ( ! info - > gpos ) return 0 ;
@ -2517,9 +2516,9 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i
stbtt_uint16 lookupType = ttUSHORT ( lookupTable ) ;
stbtt_uint16 subTableCount = ttUSHORT ( lookupTable + 4 ) ;
stbtt_uint8 * subTableOffsets = lookupTable + 6 ;
switch ( lookupType ) {
case 2 : { // Pair Adjustment Positioning Subtable
stbtt_int32 sti ;
if ( lookupType ! = 2 ) // Pair Adjustment Positioning Subtable
continue ;
for ( sti = 0 ; sti < subTableCount ; sti + + ) {
stbtt_uint16 subtableOffset = ttUSHORT ( subTableOffsets + 2 * sti ) ;
stbtt_uint8 * table = lookupTable + subtableOffset ;
@ -2567,7 +2566,8 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i
}
} else
return 0 ;
} break ;
break ;
}
case 2 : {
stbtt_uint16 valueFormat1 = ttUSHORT ( table + 4 ) ;
@ -2590,21 +2590,12 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i
return xAdvance ;
} else
return 0 ;
} break ;
default : {
// Unsupported definition type
return 0 ;
break ;
} ;
}
}
break ;
} ;
default :
// TODO: Implement other stuff.
break ;
return 0 ; // Unsupported position format
}
}
}