1 // -*- related-file-name: "../../libefont/ttfkern.cc" -*- 2 #ifndef EFONT_TTFKERN_HH 3 #define EFONT_TTFKERN_HH 4 #include <efont/otfgpos.hh> 5 namespace Efont { namespace OpenType { 6 7 class KernTable { public: 8 9 KernTable(const Data &, ErrorHandler * = 0) throw (Error); 10 // default destructor 11 ok() const12 bool ok() const { return _error >= 0; } 13 14 bool unparse_automatics(Vector<Positioning> &, ErrorHandler * = 0) const; 15 16 private: 17 18 Data _d; 19 int _version; 20 int _error; 21 22 enum { 23 COV_V0_HORIZONTAL = 0x0001, COV_V0_MINIMUM = 0x0002, 24 COV_V0_CROSS_STREAM = 0x0004, COV_V0_OVERRIDE = 0x0008, 25 COV_V0_FORMAT = 0xFF00, COV_V0_FORMAT0 = 0x0000, 26 COV_V1_VERTICAL = 0x8000, COV_V1_CROSS_STREAM = 0x4000, 27 COV_V1_VARIATION = 0x2000, 28 COV_V1_FORMAT = 0x00FF, COV_V1_FORMAT0 = 0x0000 29 }; 30 ntables() const31 inline uint32_t ntables() const { 32 return _version == 0 ? _d.u16(2) : _d.u32(4); 33 } first_offset() const34 inline uint32_t first_offset() const { 35 return _version == 0 ? 4 : 8; 36 } 37 inline Data subtable(uint32_t &off) const throw (Error); 38 39 }; 40 41 }} 42 #endif 43