| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * Copyright © 2011 Google, Inc. | 3 * Copyright © 2011 Google, Inc. |
| 4 * | 4 * |
| 5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
| 6 * | 6 * |
| 7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
| 8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
| 9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
| 10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 unsigned int y_ppem; | 109 unsigned int y_ppem; |
| 110 | 110 |
| 111 /* Font variation coordinates. */ | 111 /* Font variation coordinates. */ |
| 112 unsigned int num_coords; | 112 unsigned int num_coords; |
| 113 int *coords; | 113 int *coords; |
| 114 | 114 |
| 115 hb_font_funcs_t *klass; | 115 hb_font_funcs_t *klass; |
| 116 void *user_data; | 116 void *user_data; |
| 117 hb_destroy_func_t destroy; | 117 hb_destroy_func_t destroy; |
| 118 | 118 |
| 119 enum dirty_t { |
| 120 NOTHING = 0x0000, |
| 121 FACE = 0x0001, |
| 122 PARENT = 0x0002, |
| 123 FUNCS = 0x0004, |
| 124 SCALE = 0x0008, |
| 125 PPEM = 0x0010, |
| 126 VARIATIONS = 0x0020, |
| 127 } dirty; |
| 128 |
| 119 struct hb_shaper_data_t shaper_data; | 129 struct hb_shaper_data_t shaper_data; |
| 120 | 130 |
| 121 | 131 |
| 122 /* Convert from font-space to user-space */ | 132 /* Convert from font-space to user-space */ |
| 123 inline int dir_scale (hb_direction_t direction) | 133 inline int dir_scale (hb_direction_t direction) |
| 124 { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } | 134 { 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); } | 135 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); } | 136 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_scal
e); } | 137 inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scal
e); } |
| 128 inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scal
e); } | 138 inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scal
e); } |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 int64_t scaled = v * (int64_t) scale; | 546 int64_t scaled = v * (int64_t) scale; |
| 537 scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */ | 547 scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */ |
| 538 return (hb_position_t) (scaled / upem); | 548 return (hb_position_t) (scaled / upem); |
| 539 } | 549 } |
| 540 inline hb_position_t em_scalef (float v, int scale) | 550 inline hb_position_t em_scalef (float v, int scale) |
| 541 { | 551 { |
| 542 return (hb_position_t) (v * scale / face->get_upem ()); | 552 return (hb_position_t) (v * scale / face->get_upem ()); |
| 543 } | 553 } |
| 544 }; | 554 }; |
| 545 | 555 |
| 556 HB_MARK_AS_FLAG_T (hb_font_t::dirty_t); |
| 557 |
| 546 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS | 558 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
| 547 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font); | 559 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font); |
| 548 #include "hb-shaper-list.hh" | 560 #include "hb-shaper-list.hh" |
| 549 #undef HB_SHAPER_IMPLEMENT | 561 #undef HB_SHAPER_IMPLEMENT |
| 550 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS | 562 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
| 551 | 563 |
| 552 | 564 |
| 553 #endif /* HB_FONT_PRIVATE_HH */ | 565 #endif /* HB_FONT_PRIVATE_HH */ |
| OLD | NEW |