29 #ifndef HB_NO_OT_SHAPE
42 if ((
u & ~0xFF) == 0x0E00u)
173 #ifdef HB_NO_OT_SHAPE_FALLBACK
179 for (
unsigned int i = 0;
i <
count;
i++)
181 unsigned int combining_class = _hb_glyph_info_get_modified_combining_class (&
info[
i]);
182 combining_class = recategorize_combining_class (
info[
i].codepoint, combining_class);
183 _hb_glyph_info_set_modified_combining_class (&
info[
i], combining_class);
192 bool adjust_offsets_when_zeroing)
198 if (adjust_offsets_when_zeroing)
214 unsigned int combining_class)
217 if (!
font->get_glyph_extents (
buffer->info[
i].codepoint, &mark_extents))
223 pos.x_offset =
pos.y_offset = 0;
229 switch (combining_class)
267 switch (combining_class)
274 base_extents.
height -= y_gap;
281 if ((y_gap > 0) == (
pos.y_offset > 0))
295 base_extents.
height -= y_gap;
302 if ((y_gap > 0) != (
pos.y_offset > 0))
304 int correction = -
pos.y_offset / 2;
306 base_extents.
height -= correction;
307 pos.y_offset += correction;
321 bool adjust_offsets_when_zeroing)
332 zero_mark_advances (
buffer,
base + 1,
end, adjust_offsets_when_zeroing);
342 unsigned int lig_id = _hb_glyph_info_get_lig_id (&
buffer->info[
base]);
345 int num_lig_components = _hb_glyph_info_get_lig_num_comps (&
buffer->info[
base]);
354 int last_lig_component = -1;
355 unsigned int last_combining_class = 255;
359 if (_hb_glyph_info_get_modified_combining_class (&
info[
i]))
361 if (num_lig_components > 1) {
362 unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&
info[
i]);
363 int this_lig_component = _hb_glyph_info_get_lig_comp (&
info[
i]) - 1;
365 if (!lig_id || lig_id != this_lig_id || this_lig_component >= num_lig_components)
366 this_lig_component = num_lig_components - 1;
367 if (last_lig_component != this_lig_component)
369 last_lig_component = this_lig_component;
370 last_combining_class = 255;
371 component_extents = base_extents;
379 component_extents.
x_bearing += (this_lig_component * component_extents.
width) / num_lig_components;
381 component_extents.
x_bearing += ((num_lig_components - 1 - this_lig_component) * component_extents.
width) / num_lig_components;
382 component_extents.
width /= num_lig_components;
386 unsigned int this_combining_class = _hb_glyph_info_get_modified_combining_class (&
info[
i]);
387 if (last_combining_class != this_combining_class)
389 last_combining_class = this_combining_class;
390 cluster_extents = component_extents;
393 position_mark (plan,
font,
buffer, cluster_extents,
i, this_combining_class);
397 buffer->pos[
i].x_offset += x_offset;
398 buffer->pos[
i].y_offset += y_offset;
402 x_offset -=
buffer->pos[
i].x_advance;
403 y_offset -=
buffer->pos[
i].y_advance;
405 x_offset +=
buffer->pos[
i].x_advance;
406 y_offset +=
buffer->pos[
i].y_advance;
417 bool adjust_offsets_when_zeroing)
425 if (!_hb_glyph_info_is_unicode_mark (&
info[
i]))
430 if (!_hb_glyph_info_is_unicode_mark (&
info[
j]))
433 position_around_base (plan,
font,
buffer,
i,
j, adjust_offsets_when_zeroing);
443 bool adjust_offsets_when_zeroing)
445 #ifdef HB_NO_OT_SHAPE_FALLBACK
449 if (!
buffer->message (
font,
"start fallback mark"))
452 _hb_buffer_assert_gsubgpos_vars (
buffer);
454 unsigned int start = 0;
457 for (
unsigned int i = 1;
i <
count;
i++)
458 if (
likely (!_hb_glyph_info_is_unicode_mark (&
info[
i]))) {
459 position_cluster (plan,
font,
buffer,
start,
i, adjust_offsets_when_zeroing);
468 #ifndef HB_DISABLE_DEPRECATED
495 #ifdef HB_NO_OT_SHAPE_FALLBACK
499 #ifndef HB_DISABLE_DEPRECATED
501 !
font->has_glyph_h_kerning_func () :
502 !
font->has_glyph_v_kerning_func ())
505 if (!
buffer->message (
font,
"start fallback kern"))
535 for (
unsigned int i = 0;
i <
count;
i++)
536 if (_hb_glyph_info_is_unicode_space (&
info[
i]) && !_hb_glyph_info_ligated (&
info[
i]))
542 pos[
i].x_advance = +
font->x_scale / 4;
544 pos[
i].y_advance = -
font->y_scale / 4;
564 pos[
i].x_advance = +(
font->x_scale + ((int) space_type)/2) / (
int) space_type;
566 pos[
i].y_advance = -(
font->y_scale + ((int) space_type)/2) / (
int) space_type;
569 case t::SPACE_4_EM_18:
571 pos[
i].x_advance = (int64_t) +
font->x_scale * 4 / 18;
573 pos[
i].y_advance = (int64_t) -
font->y_scale * 4 / 18;
576 case t::SPACE_FIGURE:
577 for (
char u =
'0';
u <=
'9';
u++)
578 if (
font->get_nominal_glyph (
u, &glyph))
581 pos[
i].x_advance =
font->get_glyph_h_advance (glyph);
583 pos[
i].y_advance =
font->get_glyph_v_advance (glyph);
588 case t::SPACE_PUNCTUATION:
589 if (
font->get_nominal_glyph (
'.', &glyph) ||
590 font->get_nominal_glyph (
',', &glyph))
593 pos[
i].x_advance =
font->get_glyph_h_advance (glyph);
595 pos[
i].y_advance =
font->get_glyph_v_advance (glyph);
599 case t::SPACE_NARROW:
606 pos[
i].x_advance /= 2;
608 pos[
i].y_advance /= 2;
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
hb_direction_t hb_script_get_horizontal_direction(hb_script_t script)
void const void *obj HB_UNUSED
void _hb_ot_shape_fallback_kern(const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer)
void _hb_ot_shape_fallback_spaces(const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font, hb_buffer_t *buffer)
void _hb_ot_shape_fallback_mark_position_recategorize_marks(const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
void _hb_ot_shape_fallback_mark_position(const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer, bool adjust_offsets_when_zeroing)
#define HB_MODIFIED_COMBINING_CLASS_CCC16
#define HB_MODIFIED_COMBINING_CLASS_CCC24
#define HB_MODIFIED_COMBINING_CLASS_CCC122
#define HB_MODIFIED_COMBINING_CLASS_CCC21
#define HB_MODIFIED_COMBINING_CLASS_CCC31
#define HB_MODIFIED_COMBINING_CLASS_CCC23
#define HB_MODIFIED_COMBINING_CLASS_CCC32
#define HB_MODIFIED_COMBINING_CLASS_CCC17
#define HB_MODIFIED_COMBINING_CLASS_CCC130
#define HB_MODIFIED_COMBINING_CLASS_CCC30
#define HB_MODIFIED_COMBINING_CLASS_CCC33
#define HB_MODIFIED_COMBINING_CLASS_CCC103
#define HB_MODIFIED_COMBINING_CLASS_CCC129
#define HB_MODIFIED_COMBINING_CLASS_CCC13
#define HB_MODIFIED_COMBINING_CLASS_CCC27
#define HB_MODIFIED_COMBINING_CLASS_CCC19
#define HB_MODIFIED_COMBINING_CLASS_CCC11
#define HB_MODIFIED_COMBINING_CLASS_CCC26
#define HB_MODIFIED_COMBINING_CLASS_CCC29
#define HB_MODIFIED_COMBINING_CLASS_CCC20
#define HB_MODIFIED_COMBINING_CLASS_CCC25
#define HB_MODIFIED_COMBINING_CLASS_CCC14
#define HB_MODIFIED_COMBINING_CLASS_CCC118
#define HB_MODIFIED_COMBINING_CLASS_CCC34
#define HB_MODIFIED_COMBINING_CLASS_CCC18
#define HB_MODIFIED_COMBINING_CLASS_CCC132
#define HB_MODIFIED_COMBINING_CLASS_CCC107
#define HB_MODIFIED_COMBINING_CLASS_CCC22
#define HB_MODIFIED_COMBINING_CLASS_CCC28
#define HB_MODIFIED_COMBINING_CLASS_CCC35
#define HB_MODIFIED_COMBINING_CLASS_CCC12
#define HB_MODIFIED_COMBINING_CLASS_CCC15
#define HB_MODIFIED_COMBINING_CLASS_CCC36
#define HB_MODIFIED_COMBINING_CLASS_CCC10
backing_store_ptr info
[4]
GLenum GLenum GLsizei count
GLenum GLuint GLsizei const GLenum * props
#define HB_DIRECTION_IS_FORWARD(dir)
#define HB_DIRECTION_IS_BACKWARD(dir)
#define HB_DIRECTION_IS_HORIZONTAL(dir)
@ HB_UNICODE_COMBINING_CLASS_BELOW
@ HB_UNICODE_COMBINING_CLASS_ABOVE
@ HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT
@ HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE
@ HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW
@ HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW
@ HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT
@ HB_UNICODE_COMBINING_CLASS_BELOW_LEFT
@ HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT
@ HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT
@ HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT
@ HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE
@ HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW void kern(hb_font_t *font, hb_buffer_t *buffer, hb_mask_t kern_mask, bool scale=true) const
void get_glyph_kerning_for_direction(hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
hb_ot_shape_fallback_kern_driver_t(hb_font_t *font_, hb_buffer_t *buffer)
hb_position_t get_kerning(hb_codepoint_t first, hb_codepoint_t second) const
hb_segment_properties_t props