Home | History | Annotate | Download | only in src

Lines Matching refs:BUFFER

30 #include "hb-buffer-private.hh"
61 /* Here is how the buffer works internally:
73 * to an alternate buffer (which we reuse the pos buffer for!), and its
467 /* If we hit the start of buffer, continue in out-buffer. */
495 /* If we hit the end of out-buffer, continue in buffer. */
510 /* If script is set to INVALID, guess from buffer contents */
537 dump_var_allocation (const hb_buffer_t *buffer)
541 buf[i] = '0' + buffer->allocated_var_bytes[7 - i];
543 DEBUG_MSG (BUFFER, buffer,
552 if (DEBUG (BUFFER))
554 DEBUG_MSG (BUFFER, this,
567 if (DEBUG (BUFFER))
570 DEBUG_MSG (BUFFER, this,
584 if (DEBUG (BUFFER))
587 DEBUG_MSG (BUFFER, this,
609 hb_buffer_t *buffer;
611 if (!(buffer = hb_object_create<hb_buffer_t> ()))
614 buffer->reset ();
616 return buffer;
641 hb_buffer_reference (hb_buffer_t *buffer)
643 return hb_object_reference (buffer);
647 hb_buffer_destroy (hb_buffer_t *buffer)
649 if (!hb_object_destroy (buffer)) return;
651 hb_unicode_funcs_destroy (buffer->unicode);
653 free (buffer->info);
654 free (buffer->pos);
656 free (buffer);
660 hb_buffer_set_user_data (hb_buffer_t *buffer,
666 return hb_object_set_user_data (buffer, key, data, destroy, replace);
670 hb_buffer_get_user_data (hb_buffer_t *buffer,
673 return hb_object_get_user_data (buffer, key);
678 hb_buffer_set_content_type (hb_buffer_t *buffer,
681 buffer->content_type = content_type;
685 hb_buffer_get_content_type (hb_buffer_t *buffer)
687 return buffer->content_type;
692 hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
695 if (unlikely (hb_object_is_inert (buffer)))
703 hb_unicode_funcs_destroy (buffer->unicode);
704 buffer->unicode = unicode;
708 hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
710 return buffer->unicode;
714 hb_buffer_set_direction (hb_buffer_t *buffer,
718 if (unlikely (hb_object_is_inert (buffer)))
721 buffer->props.direction = direction;
725 hb_buffer_get_direction (hb_buffer_t *buffer)
727 return buffer->props.direction;
731 hb_buffer_set_script (hb_buffer_t *buffer,
734 buffer)))
737 buffer->props.script = script;
741 hb_buffer_get_script (hb_buffer_t *buffer)
743 return buffer->props.script;
747 hb_buffer_set_language (hb_buffer_t *buffer,
750 if (unlikely (hb_object_is_inert (buffer)))
753 buffer->props.language = language;
757 hb_buffer_get_language (hb_buffer_t *buffer)
759 return buffer->props.language;
763 hb_buffer_set_segment_properties (hb_buffer_t *buffer,
766 if (unlikely (hb_object_is_inert (buffer)))
769 buffer->props = *props;
773 hb_buffer_get_segment_properties (hb_buffer_t *buffer,
776 *props = buffer->props;
781 hb_buffer_set_flags (hb_buffer_t *buffer,
784 if (unlikely (hb_object_is_inert (buffer)))
787 buffer->flags = flags;
791 hb_buffer_get_flags (hb_buffer_t *buffer)
793 return buffer->flags;
798 hb_buffer_reset (hb_buffer_t *buffer)
800 buffer->reset ();
804 hb_buffer_clear_contents (hb_buffer_t *buffer)
806 buffer->clear ();
810 hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
812 return buffer->ensure (size);
816 hb_buffer_allocation_successful (hb_buffer_t *buffer)
818 return !buffer->in_error;
822 hb_buffer_add (hb_buffer_t *buffer,
826 buffer->add (codepoint, cluster);
827 buffer->clear_context (1);
831 hb_buffer_set_length (hb_buffer_t *buffer,
834 if (unlikely (hb_object_is_inert (buffer)))
837 if (!buffer->ensure (length))
841 if (length > buffer->len) {
842 memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len));
843 if (buffer->have_positions)
844 memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len));
847 buffer->len = length;
850 buffer->clear_context (0);
851 buffer->clear_context (1);
857 hb_buffer_get_length (hb_buffer_t *buffer)
859 return buffer->len;
862 /* Return value valid as long as buffer not modified */
864 hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
868 *length = buffer->len;
870 return (hb_glyph_info_t *) buffer->info;
873 /* Return value valid as long as buffer not modified */
875 hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
878 if (!buffer->have_positions)
879 buffer->clear_positions ();
882 *length = buffer->len;
884 return (hb_glyph_position_t *) buffer->pos;
888 hb_buffer_reverse (hb_buffer_t *buffer)
890 buffer->reverse ();
894 hb_buffer_reverse_clusters (hb_buffer_t *buffer)
896 buffer->reverse_clusters ();
900 hb_buffer_guess_segment_properties (hb_buffer_t *buffer)
902 buffer->guess_segment_properties ();
907 hb_buffer_add_utf (hb_buffer_t *buffer,
913 assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE ||
914 (!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID));
916 if (unlikely (hb_object_is_inert (buffer)))
925 buffer->ensure (buffer->len + item_length * sizeof (T) / 4);
927 /* If buffer is empty and pre-context provided, install it.
934 if (!buffer->len && item_offset > 0)
937 buffer->clear_context (0);
940 while (start < prev && buffer->context_len[0] < buffer->CONTEXT_LENGTH)
944 buffer->context[0][buffer->context_len[0]++] = u;
955 buffer->add (u, old_next - (const T *) text);
959 buffer->clear_context (1);
961 while (next < end && buffer->context_len[1] < buffer->CONTEXT_LENGTH)
965 buffer->context[1][buffer->context_len[1]++] = u;
968 buffer->content_type = HB_BUFFER_CONTENT_TYPE_UNICODE;
972 hb_buffer_add_utf8 (hb_buffer_t *buffer,
978 hb_buffer_add_utf (buffer, (const uint8_t *) text, text_length, item_offset, item_length);
982 hb_buffer_add_utf16 (hb_buffer_t *buffer,
988 hb_buffer_add_utf (buffer, text, text_length, item_offset, item_length);
992 hb_buffer_add_utf32 (hb_buffer_t *buffer,
998 hb_buffer_add_utf (buffer, text, text_length, item_offset, item_length);
1010 normalize_glyphs_cluster (hb_buffer_t *buffer,
1015 hb_glyph_position_t *pos = buffer->pos;
1044 hb_bubble_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start);
1053 hb_bubble_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1);
1058 hb_buffer_normalize_glyphs (hb_buffer_t *buffer)
1060 assert (buffer->have_positions);
1061 assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
1063 bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);
1065 unsigned int count = buffer->len;
1067 hb_glyph_info_t *info = buffer->info;
1073 normalize_glyphs_cluster (buffer, start, end, backward);
1076 normalize_glyphs_cluster (buffer, start, end, backward);