| 1 |
#include "extend.h" |
| 2 |
|
| 3 |
// Extended tables are special |
| 4 |
// We will only deal with reading, and they will be flatten. |
| 5 |
static otl_Subtable *_caryll_read_otl_extend(font_file_pointer data, uint32_t tableLength, |
| 6 |
uint32_t subtableOffset, otl_LookupType BASIS, |
| 7 |
const glyphid_t maxGlyphs, |
| 8 |
const otfcc_Options *options) { |
| 9 |
otl_Subtable *_subtable; |
| 10 |
NEW(_subtable); |
| 11 |
checkLength(subtableOffset + 8); |
| 12 |
subtable_extend *subtable = &(_subtable->extend); |
| 13 |
subtable->type = read_16u(data + subtableOffset + 2) + BASIS; |
| 14 |
subtable->subtable = otfcc_readOtl_subtable( |
| 15 |
data, tableLength, subtableOffset + read_32u(data + subtableOffset + 4), subtable->type, |
| 16 |
maxGlyphs, options); |
| 17 |
goto OK; |
| 18 |
FAIL: |
| 19 |
FREE(_subtable); |
| 20 |
OK: |
| 21 |
return _subtable; |
| 22 |
} |
| 23 |
|
| 24 |
otl_Subtable *otfcc_readOtl_gsub_extend(font_file_pointer data, uint32_t tableLength, |
| 25 |
uint32_t subtableOffset, const glyphid_t maxGlyphs, |
| 26 |
const otfcc_Options *options) { |
| 27 |
return _caryll_read_otl_extend(data, tableLength, subtableOffset, otl_type_gsub_unknown, |
| 28 |
maxGlyphs, options); |
| 29 |
} |
| 30 |
otl_Subtable *otfcc_readOtl_gpos_extend(font_file_pointer data, uint32_t tableLength, |
| 31 |
uint32_t subtableOffset, const glyphid_t maxGlyphs, |
| 32 |
const otfcc_Options *options) { |
| 33 |
return _caryll_read_otl_extend(data, tableLength, subtableOffset, otl_type_gpos_unknown, |
| 34 |
maxGlyphs, options); |
| 35 |
} |