| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].clust
er)); | 197 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].clust
er)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) | 200 if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) |
| 201 { | 201 { |
| 202 if (pos[i].x_offset || pos[i].y_offset) | 202 if (pos[i].x_offset || pos[i].y_offset) |
| 203 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x
_offset, pos[i].y_offset)); | 203 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", pos[i].x
_offset, pos[i].y_offset)); |
| 204 | 204 |
| 205 *p++ = '+'; | 205 *p++ = '+'; |
| 206 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advan
ce)); | 206 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advan
ce)); |
| 207 if (pos->y_advance) | 207 if (pos[i].y_advance) |
| 208 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_ad
vance)); | 208 p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_ad
vance)); |
| 209 } | 209 } |
| 210 | 210 |
| 211 unsigned int l = p - b; | 211 unsigned int l = p - b; |
| 212 if (buf_size > l) | 212 if (buf_size > l) |
| 213 { | 213 { |
| 214 memcpy (buf, b, l); | 214 memcpy (buf, b, l); |
| 215 buf += l; | 215 buf += l; |
| 216 buf_size -= l; | 216 buf_size -= l; |
| 217 *buf_consumed += l; | 217 *buf_consumed += l; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 return _hb_buffer_deserialize_glyphs_json (buffer, | 390 return _hb_buffer_deserialize_glyphs_json (buffer, |
| 391 buf, buf_len, end_ptr, | 391 buf, buf_len, end_ptr, |
| 392 font); | 392 font); |
| 393 | 393 |
| 394 default: | 394 default: |
| 395 case HB_BUFFER_SERIALIZE_FORMAT_INVALID: | 395 case HB_BUFFER_SERIALIZE_FORMAT_INVALID: |
| 396 return false; | 396 return false; |
| 397 | 397 |
| 398 } | 398 } |
| 399 } | 399 } |
| OLD | NEW |