1 #ifndef OT_VAR_VARC_COORD_SETTER_HH 2 #define OT_VAR_VARC_COORD_SETTER_HH 3 4 5 #include "../../../hb.hh" 6 7 8 namespace OT { 9 //namespace Var { 10 11 12 struct coord_setter_t 13 { coord_setter_tOT::coord_setter_t14 coord_setter_t (hb_array_t<const int> coords) : 15 coords (coords) {} 16 operator []OT::coord_setter_t17 int& operator [] (unsigned idx) 18 { 19 if (unlikely (idx >= HB_VAR_COMPOSITE_MAX_AXES)) 20 return Crap(int); 21 if (coords.length < idx + 1) 22 coords.resize (idx + 1); 23 return coords[idx]; 24 } 25 get_coordsOT::coord_setter_t26 hb_array_t<int> get_coords () 27 { return coords.as_array (); } 28 29 hb_vector_t<int> coords; 30 }; 31 32 33 //} // namespace Var 34 35 } // namespace OT 36 37 #endif /* OT_VAR_VARC_COORD_SETTER_HH */ 38