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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-shape-fallback.cc

Issue 1005693006: Roll harfbuzz-ng to 0.9.40 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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,2012 Google, Inc. 2 * Copyright © 2011,2012 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 void 434 void
435 _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan, 435 _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
436 hb_font_t *font, 436 hb_font_t *font,
437 hb_buffer_t *buffer) 437 hb_buffer_t *buffer)
438 { 438 {
439 if (!plan->has_kern) return; 439 if (!plan->has_kern) return;
440 440
441 OT::hb_apply_context_t c (1, font, buffer); 441 OT::hb_apply_context_t c (1, font, buffer);
442 c.set_lookup_mask (plan->kern_mask); 442 c.set_lookup_mask (plan->kern_mask);
443 c.set_lookup_props (OT::LookupFlag::IgnoreMarks); 443 c.set_lookup_props (OT::LookupFlag::IgnoreMarks);
444 OT::hb_apply_context_t::skipping_iterator_t &skippy_iter = c.iter_input;
445 skippy_iter.init (&c);
444 446
445 unsigned int count = buffer->len; 447 unsigned int count = buffer->len;
446 hb_glyph_info_t *info = buffer->info; 448 hb_glyph_info_t *info = buffer->info;
447 hb_glyph_position_t *pos = buffer->pos; 449 hb_glyph_position_t *pos = buffer->pos;
448 for (unsigned int idx = 0; idx < count;) 450 for (unsigned int idx = 0; idx < count;)
449 { 451 {
450 OT::hb_apply_context_t::skipping_forward_iterator_t skippy_iter (&c, idx, 1) ; 452 skippy_iter.reset (idx, 1);
451 if (!skippy_iter.next ()) 453 if (!skippy_iter.next ())
452 { 454 {
453 idx++; 455 idx++;
454 continue; 456 continue;
455 } 457 }
456 458
457 hb_position_t x_kern, y_kern; 459 hb_position_t x_kern, y_kern;
458 font->get_glyph_kerning_for_direction (info[idx].codepoint, 460 font->get_glyph_kerning_for_direction (info[idx].codepoint,
459 info[skippy_iter.idx].codepoint, 461 info[skippy_iter.idx].codepoint,
460 buffer->props.direction, 462 buffer->props.direction,
(...skipping 13 matching lines...) Expand all
474 hb_position_t kern1 = y_kern >> 1; 476 hb_position_t kern1 = y_kern >> 1;
475 hb_position_t kern2 = y_kern - kern1; 477 hb_position_t kern2 = y_kern - kern1;
476 pos[idx].y_advance += kern1; 478 pos[idx].y_advance += kern1;
477 pos[skippy_iter.idx].y_advance += kern2; 479 pos[skippy_iter.idx].y_advance += kern2;
478 pos[skippy_iter.idx].y_offset += kern2; 480 pos[skippy_iter.idx].y_offset += kern2;
479 } 481 }
480 482
481 idx = skippy_iter.idx; 483 idx = skippy_iter.idx;
482 } 484 }
483 } 485 }
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-shape-complex-sea-machine.hh ('k') | third_party/harfbuzz-ng/src/hb-private.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698