OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2012,2013 Google, Inc. | 2 * Copyright © 2012,2013 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 hb_font_t *font, | 304 hb_font_t *font, |
305 hb_buffer_serialize_format_t format, | 305 hb_buffer_serialize_format_t format, |
306 hb_buffer_serialize_flags_t flags) | 306 hb_buffer_serialize_flags_t flags) |
307 { | 307 { |
308 assert (start <= end && end <= buffer->len); | 308 assert (start <= end && end <= buffer->len); |
309 | 309 |
310 unsigned int sconsumed; | 310 unsigned int sconsumed; |
311 if (!buf_consumed) | 311 if (!buf_consumed) |
312 buf_consumed = &sconsumed; | 312 buf_consumed = &sconsumed; |
313 *buf_consumed = 0; | 313 *buf_consumed = 0; |
| 314 if (buf_size) |
| 315 *buf = '\0'; |
314 | 316 |
315 assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALI
D) || | 317 assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALI
D) || |
316 buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); | 318 buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); |
317 | 319 |
318 if (!buffer->have_positions) | 320 if (!buffer->have_positions) |
319 flags |= HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS; | 321 flags |= HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS; |
320 | 322 |
321 if (unlikely (start == end)) | 323 if (unlikely (start == end)) |
322 return 0; | 324 return 0; |
323 | 325 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 return _hb_buffer_deserialize_glyphs_json (buffer, | 447 return _hb_buffer_deserialize_glyphs_json (buffer, |
446 buf, buf_len, end_ptr, | 448 buf, buf_len, end_ptr, |
447 font); | 449 font); |
448 | 450 |
449 default: | 451 default: |
450 case HB_BUFFER_SERIALIZE_FORMAT_INVALID: | 452 case HB_BUFFER_SERIALIZE_FORMAT_INVALID: |
451 return false; | 453 return false; |
452 | 454 |
453 } | 455 } |
454 } | 456 } |
OLD | NEW |