Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: third_party/harfbuzz-ng/src/hb-uniscribe.cc

Issue 10510004: Roll harfbuzz-ng 3b8fd9c48f4bde368bf2d465c148b9743a9216ee (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 hb_uniscribe_font_get_hfont (hb_font_t *font) 216 hb_uniscribe_font_get_hfont (hb_font_t *font)
217 { 217 {
218 hb_uniscribe_font_data_t *font_data = _hb_uniscribe_font_get_data (font); 218 hb_uniscribe_font_data_t *font_data = _hb_uniscribe_font_get_data (font);
219 if (unlikely (!font_data)) 219 if (unlikely (!font_data))
220 return 0; 220 return 0;
221 return font_data->hfont; 221 return font_data->hfont;
222 } 222 }
223 223
224 224
225 hb_bool_t 225 hb_bool_t
226 hb_uniscribe_shape (hb_font_t *font, 226 _hb_uniscribe_shape (hb_font_t *font,
227 » » hb_buffer_t *buffer, 227 » » hb_buffer_t *buffer,
228 » » const hb_feature_t *features, 228 » » const hb_feature_t *features,
229 » » unsigned int num_features, 229 » » unsigned int num_features)
230 » » const char * const *shaper_options)
231 { 230 {
232 buffer->guess_properties (); 231 buffer->guess_properties ();
233 232
234 #define FAIL(...) \ 233 #define FAIL(...) \
235 HB_STMT_START { \ 234 HB_STMT_START { \
236 DEBUG_MSG (UNISCRIBE, NULL, __VA_ARGS__); \ 235 DEBUG_MSG (UNISCRIBE, NULL, __VA_ARGS__); \
237 return FALSE; \ 236 return FALSE; \
238 } HB_STMT_END; 237 } HB_STMT_END;
239 238
240 hb_uniscribe_face_data_t *face_data = _hb_uniscribe_face_get_data (font->face) ; 239 hb_uniscribe_face_data_t *face_data = _hb_uniscribe_face_get_data (font->face) ;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 wchars + chars_offset, 352 wchars + chars_offset,
354 item_chars_len, 353 item_chars_len,
355 glyphs_size - glyphs_offset, 354 glyphs_size - glyphs_offset,
356 /* out */ 355 /* out */
357 log_clusters + chars_offset, 356 log_clusters + chars_offset,
358 char_props + chars_offset, 357 char_props + chars_offset,
359 glyphs + glyphs_offset, 358 glyphs + glyphs_offset,
360 glyph_props + glyphs_offset, 359 glyph_props + glyphs_offset,
361 (int *) &glyphs_len); 360 (int *) &glyphs_len);
362 361
362 for (unsigned int j = chars_offset; j < chars_offset + item_chars_len; j++ )
363 log_clusters[j] += glyphs_offset;
364
363 if (unlikely (items[i].a.fNoGlyphIndex)) 365 if (unlikely (items[i].a.fNoGlyphIndex))
364 FAIL ("ScriptShapeOpenType() set fNoGlyphIndex"); 366 FAIL ("ScriptShapeOpenType() set fNoGlyphIndex");
365 if (unlikely (hr == E_OUTOFMEMORY)) 367 if (unlikely (hr == E_OUTOFMEMORY))
366 { 368 {
367 buffer->ensure (buffer->allocated * 2); 369 buffer->ensure (buffer->allocated * 2);
368 if (buffer->in_error) 370 if (buffer->in_error)
369 FAIL ("Buffer resize failed"); 371 FAIL ("Buffer resize failed");
370 goto retry; 372 goto retry;
371 } 373 }
372 if (unlikely (hr == USP_E_SCRIPT_NOT_IN_FONT)) 374 if (unlikely (hr == USP_E_SCRIPT_NOT_IN_FONT))
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 pos->x_advance = info->mask; 456 pos->x_advance = info->mask;
455 pos->x_offset = info->var1.u32; 457 pos->x_offset = info->var1.u32;
456 pos->y_offset = info->var2.u32; 458 pos->y_offset = info->var2.u32;
457 } 459 }
458 460
459 /* Wow, done! */ 461 /* Wow, done! */
460 return TRUE; 462 return TRUE;
461 } 463 }
462 464
463 465
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-uniscribe.h ('k') | third_party/harfbuzz-ng/src/hb-uniscribe-private.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698