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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-layout-private.hh

Issue 12438036: Update harfbuzz-ng to 0.9.14 from 0.9.10 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright © 2007,2008,2009 Red Hat, Inc. 2 * Copyright © 2007,2008,2009 Red Hat, Inc.
3 * Copyright © 2012 Google, Inc. 3 * Copyright © 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 25 matching lines...) Expand all
36 #include "hb-font-private.hh" 36 #include "hb-font-private.hh"
37 #include "hb-buffer-private.hh" 37 #include "hb-buffer-private.hh"
38 #include "hb-set-private.hh" 38 #include "hb-set-private.hh"
39 39
40 40
41 /* buffer var allocations, used during the GSUB/GPOS processing */ 41 /* buffer var allocations, used during the GSUB/GPOS processing */
42 #define glyph_props() var1.u16[0] /* GDEF glyph properties */ 42 #define glyph_props() var1.u16[0] /* GDEF glyph properties */
43 #define syllable() var1.u8[2] /* GSUB/GPOS shaping boundaries */ 43 #define syllable() var1.u8[2] /* GSUB/GPOS shaping boundaries */
44 #define lig_props() var1.u8[3] /* GSUB/GPOS ligature tracking */ 44 #define lig_props() var1.u8[3] /* GSUB/GPOS ligature tracking */
45 45
46 /* buffer var allocations, used during the entire shaping process */
47 #define unicode_props0() var2.u8[0]
48 #define unicode_props1() var2.u8[1]
49
50
51 inline void
52 _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *uni code)
53 {
54 info->unicode_props0() = ((unsigned int) unicode->general_category (info->code point)) |
55 (unicode->is_default_ignorable (info->codepoint) ? 0x 80 : 0) |
56 (info->codepoint == 0x200C ? 0x40 : 0) |
57 (info->codepoint == 0x200D ? 0x20 : 0);
58 info->unicode_props1() = unicode->modified_combining_class (info->codepoint);
59 }
60
61 inline hb_unicode_general_category_t
62 _hb_glyph_info_get_general_category (const hb_glyph_info_t *info)
63 {
64 return (hb_unicode_general_category_t) (info->unicode_props0() & 0x1F);
65 }
66
67 inline void
68 _hb_glyph_info_set_modified_combining_class (hb_glyph_info_t *info, unsigned int modified_class)
69 {
70 info->unicode_props1() = modified_class;
71 }
72
73 inline unsigned int
74 _hb_glyph_info_get_modified_combining_class (const hb_glyph_info_t *info)
75 {
76 return info->unicode_props1();
77 }
78
79 inline hb_bool_t
80 _hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
81 {
82 return !!(info->unicode_props0() & 0x80);
83 }
84
85 inline hb_bool_t
86 _hb_glyph_info_is_zwnj (const hb_glyph_info_t *info)
87 {
88 return !!(info->unicode_props0() & 0x40);
89 }
90
91 inline hb_bool_t
92 _hb_glyph_info_is_zwj (const hb_glyph_info_t *info)
93 {
94 return !!(info->unicode_props0() & 0x20);
95 }
96
97
46 #define hb_ot_layout_from_face(face) ((hb_ot_layout_t *) face->shaper_data.ot) 98 #define hb_ot_layout_from_face(face) ((hb_ot_layout_t *) face->shaper_data.ot)
47 99
48 /* 100 /*
49 * GDEF 101 * GDEF
50 */ 102 */
51 103
52 typedef enum { 104 typedef enum {
53 HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED»= 0x0001, 105 HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED»= 1 << HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSI FIED,
54 HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH» = 0x0002, 106 HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH» = 1 << HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLY PH,
55 HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE» = 0x0004, 107 HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE» = 1 << HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE ,
56 HB_OT_LAYOUT_GLYPH_PROPS_MARK»» = 0x0008, 108 HB_OT_LAYOUT_GLYPH_PROPS_MARK»» = 1 << HB_OT_LAYOUT_GLYPH_CLASS_MARK,
57 HB_OT_LAYOUT_GLYPH_PROPS_COMPONENT» = 0x0010 109 HB_OT_LAYOUT_GLYPH_PROPS_COMPONENT» = 1 << HB_OT_LAYOUT_GLYPH_CLASS_COMPONEN T
58 } hb_ot_layout_glyph_class_mask_t; 110 } hb_ot_layout_glyph_class_mask_t;
59 111
60 112
61 113
62 /* 114 /*
63 * GSUB/GPOS 115 * GSUB/GPOS
64 */ 116 */
65 117
66 /* lig_id / lig_comp 118 /* lig_id / lig_comp
67 * 119 *
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 199
148 /* Should be called before all the substitute_lookup's are done. */ 200 /* Should be called before all the substitute_lookup's are done. */
149 HB_INTERNAL void 201 HB_INTERNAL void
150 hb_ot_layout_substitute_start (hb_font_t *font, 202 hb_ot_layout_substitute_start (hb_font_t *font,
151 hb_buffer_t *buffer); 203 hb_buffer_t *buffer);
152 204
153 HB_INTERNAL hb_bool_t 205 HB_INTERNAL hb_bool_t
154 hb_ot_layout_substitute_lookup (hb_font_t *font, 206 hb_ot_layout_substitute_lookup (hb_font_t *font,
155 hb_buffer_t *buffer, 207 hb_buffer_t *buffer,
156 unsigned int lookup_index, 208 unsigned int lookup_index,
157 » » » » hb_mask_t mask); 209 » » » » hb_mask_t mask,
210 » » » » hb_bool_t auto_zwj);
158 211
159 /* Should be called after all the substitute_lookup's are done */ 212 /* Should be called after all the substitute_lookup's are done */
160 HB_INTERNAL void 213 HB_INTERNAL void
161 hb_ot_layout_substitute_finish (hb_font_t *font, 214 hb_ot_layout_substitute_finish (hb_font_t *font,
162 hb_buffer_t *buffer); 215 hb_buffer_t *buffer);
163 216
164 217
165 /* Should be called before all the position_lookup's are done. Resets positions to zero. */ 218 /* Should be called before all the position_lookup's are done. Resets positions to zero. */
166 HB_INTERNAL void 219 HB_INTERNAL void
167 hb_ot_layout_position_start (hb_font_t *font, 220 hb_ot_layout_position_start (hb_font_t *font,
168 hb_buffer_t *buffer); 221 hb_buffer_t *buffer);
169 222
170 HB_INTERNAL hb_bool_t 223 HB_INTERNAL hb_bool_t
171 hb_ot_layout_position_lookup (hb_font_t *font, 224 hb_ot_layout_position_lookup (hb_font_t *font,
172 hb_buffer_t *buffer, 225 hb_buffer_t *buffer,
173 unsigned int lookup_index, 226 unsigned int lookup_index,
174 » » » hb_mask_t mask); 227 » » » hb_mask_t mask,
228 » » » hb_bool_t auto_zwj);
175 229
176 /* Should be called after all the position_lookup's are done */ 230 /* Should be called after all the position_lookup's are done */
177 HB_INTERNAL void 231 HB_INTERNAL void
178 hb_ot_layout_position_finish (hb_font_t *font, 232 hb_ot_layout_position_finish (hb_font_t *font,
179 » » » hb_buffer_t *buffer, 233 » » » hb_buffer_t *buffer);
180 » » » hb_bool_t zero_width_attached_marks);
181 234
182 235
183 236
184 /* 237 /*
185 * hb_ot_layout_t 238 * hb_ot_layout_t
186 */ 239 */
187 240
188 namespace OT { 241 namespace OT {
189 struct GDEF; 242 struct GDEF;
190 struct GSUB; 243 struct GSUB;
(...skipping 20 matching lines...) Expand all
211 264
212 HB_INTERNAL hb_ot_layout_t * 265 HB_INTERNAL hb_ot_layout_t *
213 _hb_ot_layout_create (hb_face_t *face); 266 _hb_ot_layout_create (hb_face_t *face);
214 267
215 HB_INTERNAL void 268 HB_INTERNAL void
216 _hb_ot_layout_destroy (hb_ot_layout_t *layout); 269 _hb_ot_layout_destroy (hb_ot_layout_t *layout);
217 270
218 271
219 272
220 #endif /* HB_OT_LAYOUT_PRIVATE_HH */ 273 #endif /* HB_OT_LAYOUT_PRIVATE_HH */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698