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

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

Issue 2858683002: Roll HarfBuzz to 1.4.6 (Closed)
Patch Set: Rebase Created 3 years, 7 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 © 2009,2010 Red Hat, Inc. 2 * Copyright © 2009,2010 Red Hat, Inc.
3 * Copyright © 2010,2011,2012 Google, Inc. 3 * Copyright © 2010,2011,2012 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 (feature->start == 0 && feature->end == (unsigned int) -1) ? 121 (feature->start == 0 && feature->end == (unsigned int) -1) ?
122 F_GLOBAL : F_NONE); 122 F_GLOBAL : F_NONE);
123 } 123 }
124 } 124 }
125 125
126 126
127 /* 127 /*
128 * shaper face data 128 * shaper face data
129 */ 129 */
130 130
131 HB_SHAPER_DATA_ENSURE_DEFINE(ot, face)
132
131 hb_ot_shaper_face_data_t * 133 hb_ot_shaper_face_data_t *
132 _hb_ot_shaper_face_data_create (hb_face_t *face) 134 _hb_ot_shaper_face_data_create (hb_face_t *face)
133 { 135 {
134 return _hb_ot_layout_create (face); 136 return _hb_ot_layout_create (face);
135 } 137 }
136 138
137 void 139 void
138 _hb_ot_shaper_face_data_destroy (hb_ot_shaper_face_data_t *data) 140 _hb_ot_shaper_face_data_destroy (hb_ot_shaper_face_data_t *data)
139 { 141 {
140 _hb_ot_layout_destroy (data); 142 _hb_ot_layout_destroy (data);
141 } 143 }
142 144
143 145
144 /* 146 /*
145 * shaper font data 147 * shaper font data
146 */ 148 */
147 149
150 HB_SHAPER_DATA_ENSURE_DEFINE(ot, font)
151
148 struct hb_ot_shaper_font_data_t {}; 152 struct hb_ot_shaper_font_data_t {};
149 153
150 hb_ot_shaper_font_data_t * 154 hb_ot_shaper_font_data_t *
151 _hb_ot_shaper_font_data_create (hb_font_t *font HB_UNUSED) 155 _hb_ot_shaper_font_data_create (hb_font_t *font HB_UNUSED)
152 { 156 {
153 return (hb_ot_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; 157 return (hb_ot_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED;
154 } 158 }
155 159
156 void 160 void
157 _hb_ot_shaper_font_data_destroy (hb_ot_shaper_font_data_t *data) 161 _hb_ot_shaper_font_data_destroy (hb_ot_shaper_font_data_t *data)
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 { 371 {
368 pre_mask = c->plan->numr_mask | c->plan->frac_mask; 372 pre_mask = c->plan->numr_mask | c->plan->frac_mask;
369 post_mask = c->plan->frac_mask | c->plan->dnom_mask; 373 post_mask = c->plan->frac_mask | c->plan->dnom_mask;
370 } 374 }
371 else 375 else
372 { 376 {
373 pre_mask = c->plan->frac_mask | c->plan->dnom_mask; 377 pre_mask = c->plan->frac_mask | c->plan->dnom_mask;
374 post_mask = c->plan->numr_mask | c->plan->frac_mask; 378 post_mask = c->plan->numr_mask | c->plan->frac_mask;
375 } 379 }
376 380
377 /* TODO look in pre/post context text also. */
378 unsigned int count = buffer->len; 381 unsigned int count = buffer->len;
379 hb_glyph_info_t *info = buffer->info; 382 hb_glyph_info_t *info = buffer->info;
380 for (unsigned int i = 0; i < count; i++) 383 for (unsigned int i = 0; i < count; i++)
381 { 384 {
382 if (info[i].codepoint == 0x2044u) /* FRACTION SLASH */ 385 if (info[i].codepoint == 0x2044u) /* FRACTION SLASH */
383 { 386 {
384 unsigned int start = i, end = i + 1; 387 unsigned int start = i, end = i + 1;
385 while (start && 388 while (start &&
386 _hb_glyph_info_get_general_category (&info[start - 1]) == 389 _hb_glyph_info_get_general_category (&info[start - 1]) ==
387 HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) 390 HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER)
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 hb_set_t copy; 916 hb_set_t copy;
914 copy.init (); 917 copy.init ();
915 do { 918 do {
916 copy.set (glyphs); 919 copy.set (glyphs);
917 for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index) ;) 920 for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index) ;)
918 hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); 921 hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs);
919 } while (!copy.is_equal (glyphs)); 922 } while (!copy.is_equal (glyphs));
920 923
921 hb_shape_plan_destroy (shape_plan); 924 hb_shape_plan_destroy (shape_plan);
922 } 925 }
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-math.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698