#ifndef __TABLE_LOCA_H__ #define __TABLE_LOCA_H__ #include "../../../reader/reader.h" #define LocaShortFormat 0 #define LocaLongFormat 1 class LocaTable { private: uint16 _numGlyphs; public: LocaTable():_numGlyphs(0){}; ~LocaTable(){}; LocaTable(uint16 i):_numGlyphs(i){} uint16 numGlyphs(){return _numGlyphs;} }; class LocaTableShort: public LocaTable { private: uint16 _indexToLocFormat; std::vector _offsets; public: LocaTableShort():_indexToLocFormat(LocaShortFormat){}; ~LocaTableShort(){}; LocaTableShort(uint16 num):LocaTable(num),_indexToLocFormat(LocaShortFormat){} LocaTableShort(uint16 num, reader *rd):LocaTable(num),_indexToLocFormat(LocaShortFormat){read(rd);} void read(reader *rd){ for(auto i=0;ireadOffset16(); _offsets.push_back(o); } } uint16 format(){return _indexToLocFormat;} std::vector offsets(){return _offsets;} }; class LocaTableLong: public LocaTable { private: uint16 _indexToLocFormat; std::vector _offsets; public: LocaTableLong():_indexToLocFormat(LocaLongFormat){}; ~LocaTableLong(){}; LocaTableLong(uint16 num):LocaTable(num),_indexToLocFormat(LocaLongFormat){} LocaTableLong(uint16 num, reader *rd):LocaTable(num),_indexToLocFormat(LocaLongFormat){read(rd);} void read(reader *rd){ for(auto i=0;ireadOffset32(); _offsets.push_back(o); } } uint16 format(){return _indexToLocFormat;} std::vector offsets(){return _offsets;} }; #endif