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

Unified Diff: third_party/harfbuzz-ng/src/hb-ot-shape.cc

Issue 1867053004: Roll HarfBuzz to 1.2.6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Roll to 1.2.6 instead Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/harfbuzz-ng/src/hb-ot-shape.cc
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape.cc b/third_party/harfbuzz-ng/src/hb-ot-shape.cc
index c13d94bfd633a172a7e04b18b82ec0e69c275659..7811cb7f8e891834e161250ac8f21160aeebad44 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape.cc
@@ -456,7 +456,7 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
return;
hb_codepoint_t space;
- if (c->font->get_glyph (' ', 0, &space))
+ if (c->font->get_nominal_glyph (' ', &space))
{
/* Replace default-ignorables with a zero-advance space glyph. */
for (/*continue*/; i < count; i++)
@@ -524,32 +524,6 @@ hb_ot_map_glyphs_fast (hb_buffer_t *buffer)
}
static inline void
-hb_synthesize_glyph_classes (hb_ot_shape_context_t *c)
-{
- unsigned int count = c->buffer->len;
- hb_glyph_info_t *info = c->buffer->info;
- for (unsigned int i = 0; i < count; i++)
- {
- hb_ot_layout_glyph_props_flags_t klass;
-
- /* Never mark default-ignorables as marks.
- * They won't get in the way of lookups anyway,
- * but having them as mark will cause them to be skipped
- * over if the lookup-flag says so, but at least for the
- * Mongolian variation selectors, looks like Uniscribe
- * marks them as non-mark. Some Mongolian fonts without
- * GDEF rely on this. Another notable character that
- * this applies to is COMBINING GRAPHEME JOINER. */
- klass = (_hb_glyph_info_get_general_category (&info[i]) !=
- HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ||
- _hb_glyph_info_is_default_ignorable (&info[i])) ?
- HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH :
- HB_OT_LAYOUT_GLYPH_PROPS_MARK;
- _hb_glyph_info_set_glyph_props (&info[i], klass);
- }
-}
-
-static inline void
hb_ot_substitute_default (hb_ot_shape_context_t *c)
{
hb_buffer_t *buffer = c->buffer;
@@ -580,9 +554,6 @@ hb_ot_substitute_complex (hb_ot_shape_context_t *c)
hb_ot_layout_substitute_start (c->font, buffer);
- if (!hb_ot_layout_has_glyph_classes (c->face))
- hb_synthesize_glyph_classes (c);
-
c->plan->substitute (c->font, buffer);
return;
@@ -615,23 +586,6 @@ zero_mark_width (hb_glyph_position_t *pos)
}
static inline void
-zero_mark_widths_by_unicode (hb_buffer_t *buffer, bool adjust_offsets)
-{
- if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII))
- return;
-
- unsigned int count = buffer->len;
- hb_glyph_info_t *info = buffer->info;
- for (unsigned int i = 0; i < count; i++)
- if (_hb_glyph_info_get_general_category (&info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
- {
- if (adjust_offsets)
- adjust_mark_offsets (&buffer->pos[i]);
- zero_mark_width (&buffer->pos[i]);
- }
-}
-
-static inline void
zero_mark_widths_by_gdef (hb_buffer_t *buffer, bool adjust_offsets)
{
unsigned int count = buffer->len;
@@ -705,15 +659,8 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
zero_mark_widths_by_gdef (c->buffer, adjust_offsets_when_zeroing);
break;
- /* Not currently used for any shaper:
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
- zero_mark_widths_by_unicode (c->buffer, adjust_offsets_when_zeroing);
- break;
- */
-
default:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
break;
}
@@ -746,17 +693,12 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
switch (c->plan->shaper->zero_width_marks)
{
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
- zero_mark_widths_by_unicode (c->buffer, adjust_offsets_when_zeroing);
- break;
-
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
zero_mark_widths_by_gdef (c->buffer, adjust_offsets_when_zeroing);
break;
default:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
- //case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
break;
}
@@ -877,12 +819,12 @@ add_char (hb_font_t *font,
hb_set_t *glyphs)
{
hb_codepoint_t glyph;
- if (font->get_glyph (u, 0, &glyph))
+ if (font->get_nominal_glyph (u, &glyph))
glyphs->add (glyph);
if (mirror)
{
hb_codepoint_t m = unicode->mirroring (u);
- if (m != u && font->get_glyph (m, 0, &glyph))
+ if (m != u && font->get_nominal_glyph (m, &glyph))
glyphs->add (glyph);
}
}
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-map.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-shape-complex-default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698