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

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

Issue 2622553002: Roll HarfBuzz to 1.4.1 (Closed)
Patch Set: Linux rebaselines Created 3 years, 11 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 © 2015 Mozilla Foundation. 2 * Copyright © 2015 Mozilla Foundation.
3 * Copyright © 2015 Google, Inc. 3 * Copyright © 2015 Google, Inc.
4 * 4 *
5 * This is part of HarfBuzz, a text shaping library. 5 * This is part of HarfBuzz, a text shaping library.
6 * 6 *
7 * Permission is hereby granted, without written agreement and without 7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this 8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the 9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in 10 * above copyright notice and the following two paragraphs appear in
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 552
553 /* Zero syllables now... */ 553 /* Zero syllables now... */
554 unsigned int count = buffer->len; 554 unsigned int count = buffer->len;
555 for (unsigned int i = 0; i < count; i++) 555 for (unsigned int i = 0; i < count; i++)
556 info[i].syllable() = 0; 556 info[i].syllable() = 0;
557 557
558 HB_BUFFER_DEALLOCATE_VAR (buffer, use_category); 558 HB_BUFFER_DEALLOCATE_VAR (buffer, use_category);
559 } 559 }
560 560
561 static bool 561 static bool
562 decompose_use (const hb_ot_shape_normalize_context_t *c,
563 hb_codepoint_t ab,
564 hb_codepoint_t *a,
565 hb_codepoint_t *b)
566 {
567 switch (ab)
568 {
569 /* Chakma:
570 * Special case where the Unicode decomp gives matras in the wrong order
571 * for cluster validation.
572 */
573 case 0x1112Eu : *a = 0x11127u; *b= 0x11131u; return true;
574 case 0x1112Fu : *a = 0x11127u; *b= 0x11132u; return true;
575
576 /*
577 * Decompose split matras that don't have Unicode decompositions.
578 */
579
580 /* Limbu */
581 case 0x1925u : *a = 0x1920u; *b= 0x1923u; return true;
582 case 0x1926u : *a = 0x1920u; *b= 0x1924u; return true;
583
584 /* Balinese */
585 case 0x1B3Cu : *a = 0x1B42u; *b= 0x1B3Cu; return true;
586
587 #if 0
588 /* Lepcha */
589 case 0x1C29u : *a = no decomp, -> LEFT; return true;
590
591 /* Javanese */
592 case 0xA9C0u : *a = no decomp, -> RIGHT; return true;
593
594 /* Sharada */
595 case 0x111BFu : *a = no decomp, -> ABOVE; return true;
596 #endif
597 }
598
599 return (bool) c->unicode->decompose (ab, a, b);
600 }
601
602 static bool
562 compose_use (const hb_ot_shape_normalize_context_t *c, 603 compose_use (const hb_ot_shape_normalize_context_t *c,
563 hb_codepoint_t a, 604 hb_codepoint_t a,
564 hb_codepoint_t b, 605 hb_codepoint_t b,
565 hb_codepoint_t *ab) 606 hb_codepoint_t *ab)
566 { 607 {
567 /* Avoid recomposing split matras. */ 608 /* Avoid recomposing split matras. */
568 if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (c->unicode->general_category (a))) 609 if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (c->unicode->general_category (a)))
569 return false; 610 return false;
570 611
571 return (bool)c->unicode->compose (a, b, ab); 612 return (bool)c->unicode->compose (a, b, ab);
572 } 613 }
573 614
574 615
575 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use = 616 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
576 { 617 {
577 "use", 618 "use",
578 collect_features_use, 619 collect_features_use,
579 NULL, /* override_features */ 620 NULL, /* override_features */
580 data_create_use, 621 data_create_use,
581 data_destroy_use, 622 data_destroy_use,
582 NULL, /* preprocess_text */ 623 NULL, /* preprocess_text */
583 NULL, /* postprocess_glyphs */ 624 NULL, /* postprocess_glyphs */
584 HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, 625 HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
585 NULL, /* decompose */ 626 decompose_use,
586 compose_use, 627 compose_use,
587 setup_masks_use, 628 setup_masks_use,
629 NULL, /* disable_otl */
588 HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY, 630 HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
589 false, /* fallback_position */ 631 false, /* fallback_position */
590 }; 632 };
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-shape-complex-tibetan.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-shape-private.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698