| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2011 Google, Inc. | 2 * Copyright © 2011 Google, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO | 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 * | 23 * |
| 24 * Google Author(s): Behdad Esfahbod | 24 * Google Author(s): Behdad Esfahbod |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #define HB_SHAPER fallback | 27 #define HB_SHAPER fallback |
| 28 #include "hb-shaper-impl-private.hh" | 28 #include "hb-shaper-impl-private.hh" |
| 29 | 29 |
| 30 | 30 |
| 31 //HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face) |
| 32 //HB_SHAPER_DATA_ENSURE_DEFINE(fallback, font) |
| 33 |
| 34 |
| 31 /* | 35 /* |
| 32 * shaper face data | 36 * shaper face data |
| 33 */ | 37 */ |
| 34 | 38 |
| 35 struct hb_fallback_shaper_face_data_t {}; | 39 struct hb_fallback_shaper_face_data_t {}; |
| 36 | 40 |
| 37 hb_fallback_shaper_face_data_t * | 41 hb_fallback_shaper_face_data_t * |
| 38 _hb_fallback_shaper_face_data_create (hb_face_t *face HB_UNUSED) | 42 _hb_fallback_shaper_face_data_create (hb_face_t *face HB_UNUSED) |
| 39 { | 43 { |
| 40 return (hb_fallback_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED; | 44 return (hb_fallback_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 hb_glyph_info_t *info = buffer->info; | 122 hb_glyph_info_t *info = buffer->info; |
| 119 hb_glyph_position_t *pos = buffer->pos; | 123 hb_glyph_position_t *pos = buffer->pos; |
| 120 for (unsigned int i = 0; i < count; i++) | 124 for (unsigned int i = 0; i < count; i++) |
| 121 { | 125 { |
| 122 if (has_space && unicode->is_default_ignorable (info[i].codepoint)) { | 126 if (has_space && unicode->is_default_ignorable (info[i].codepoint)) { |
| 123 info[i].codepoint = space; | 127 info[i].codepoint = space; |
| 124 pos[i].x_advance = 0; | 128 pos[i].x_advance = 0; |
| 125 pos[i].y_advance = 0; | 129 pos[i].y_advance = 0; |
| 126 continue; | 130 continue; |
| 127 } | 131 } |
| 128 font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint); | 132 (void) font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint); |
| 129 font->get_glyph_advance_for_direction (info[i].codepoint, | 133 font->get_glyph_advance_for_direction (info[i].codepoint, |
| 130 direction, | 134 direction, |
| 131 &pos[i].x_advance, | 135 &pos[i].x_advance, |
| 132 &pos[i].y_advance); | 136 &pos[i].y_advance); |
| 133 font->subtract_glyph_origin_for_direction (info[i].codepoint, | 137 font->subtract_glyph_origin_for_direction (info[i].codepoint, |
| 134 direction, | 138 direction, |
| 135 &pos[i].x_offset, | 139 &pos[i].x_offset, |
| 136 &pos[i].y_offset); | 140 &pos[i].y_offset); |
| 137 } | 141 } |
| 138 | 142 |
| 139 if (HB_DIRECTION_IS_BACKWARD (direction)) | 143 if (HB_DIRECTION_IS_BACKWARD (direction)) |
| 140 hb_buffer_reverse (buffer); | 144 hb_buffer_reverse (buffer); |
| 141 | 145 |
| 142 return true; | 146 return true; |
| 143 } | 147 } |
| OLD | NEW |