| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 hb_bool_t | 91 hb_bool_t |
| 92 _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, | 92 _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, |
| 93 hb_font_t *font, | 93 hb_font_t *font, |
| 94 hb_buffer_t *buffer, | 94 hb_buffer_t *buffer, |
| 95 const hb_feature_t *features HB_UNUSED, | 95 const hb_feature_t *features HB_UNUSED, |
| 96 unsigned int num_features HB_UNUSED) | 96 unsigned int num_features HB_UNUSED) |
| 97 { | 97 { |
| 98 hb_codepoint_t space; | 98 hb_codepoint_t space; |
| 99 font->get_glyph (' ', 0, &space); | 99 font->get_glyph (' ', 0, &space); |
| 100 | 100 |
| 101 buffer->guess_segment_properties (); | |
| 102 buffer->clear_positions (); | 101 buffer->clear_positions (); |
| 103 | 102 |
| 104 unsigned int count = buffer->len; | 103 unsigned int count = buffer->len; |
| 105 | 104 |
| 106 for (unsigned int i = 0; i < count; i++) | 105 for (unsigned int i = 0; i < count; i++) |
| 107 { | 106 { |
| 108 if (buffer->unicode->is_default_ignorable (buffer->info[i].codepoint)) { | 107 if (buffer->unicode->is_default_ignorable (buffer->info[i].codepoint)) { |
| 109 buffer->info[i].codepoint = space; | 108 buffer->info[i].codepoint = space; |
| 110 buffer->pos[i].x_advance = 0; | 109 buffer->pos[i].x_advance = 0; |
| 111 buffer->pos[i].y_advance = 0; | 110 buffer->pos[i].y_advance = 0; |
| 112 continue; | 111 continue; |
| 113 } | 112 } |
| 114 font->get_glyph (buffer->info[i].codepoint, 0, &buffer->info[i].codepoint); | 113 font->get_glyph (buffer->info[i].codepoint, 0, &buffer->info[i].codepoint); |
| 115 font->get_glyph_advance_for_direction (buffer->info[i].codepoint, | 114 font->get_glyph_advance_for_direction (buffer->info[i].codepoint, |
| 116 buffer->props.direction, | 115 buffer->props.direction, |
| 117 &buffer->pos[i].x_advance, | 116 &buffer->pos[i].x_advance, |
| 118 &buffer->pos[i].y_advance); | 117 &buffer->pos[i].y_advance); |
| 119 font->subtract_glyph_origin_for_direction (buffer->info[i].codepoint, | 118 font->subtract_glyph_origin_for_direction (buffer->info[i].codepoint, |
| 120 buffer->props.direction, | 119 buffer->props.direction, |
| 121 &buffer->pos[i].x_offset, | 120 &buffer->pos[i].x_offset, |
| 122 &buffer->pos[i].y_offset); | 121 &buffer->pos[i].y_offset); |
| 123 } | 122 } |
| 124 | 123 |
| 125 if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) | 124 if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) |
| 126 hb_buffer_reverse (buffer); | 125 hb_buffer_reverse (buffer); |
| 127 | 126 |
| 128 return true; | 127 return true; |
| 129 } | 128 } |
| OLD | NEW |