91 92 /* 93 * hb_font_t 94 */ 95 96 struct hb_font_t { 97 hb_object_header_t header; 98 ASSERT_POD (); 99 100 hb_bool_t immutable; 101 102 hb_font_t *parent; 103 hb_face_t *face; 104 105 int x_scale; 106 int y_scale; 107 108 unsigned int x_ppem; 109 unsigned int y_ppem; 110 111 /* Font variation coordinates. */ 112 unsigned int num_coords; 113 int *coords; 114 115 hb_font_funcs_t *klass; 116 void *user_data; 117 hb_destroy_func_t destroy; 118 119 struct hb_shaper_data_t shaper_data; 120 121 122 /* Convert from font-space to user-space */ 123 inline int dir_scale (hb_direction_t direction) 124 { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } 125 inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } 126 inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } 127 inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } 128 inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } 129 inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) 130 { return em_scale (v, dir_scale (direction)); } | 91 92 /* 93 * hb_font_t 94 */ 95 96 struct hb_font_t { 97 hb_object_header_t header; 98 ASSERT_POD (); 99 100 hb_bool_t immutable; 101 102 hb_font_t *parent; 103 hb_face_t *face; 104 105 int x_scale; 106 int y_scale; 107 108 unsigned int x_ppem; 109 unsigned int y_ppem; 110 111 float ptem; 112 113 /* Font variation coordinates. */ 114 unsigned int num_coords; 115 int *coords; 116 117 hb_font_funcs_t *klass; 118 void *user_data; 119 hb_destroy_func_t destroy; 120 121 struct hb_shaper_data_t shaper_data; 122 123 124 /* Convert from font-space to user-space */ 125 inline int dir_scale (hb_direction_t direction) 126 { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } 127 inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } 128 inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } 129 inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } 130 inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } 131 inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) 132 { return em_scale (v, dir_scale (direction)); } |