Skip to main content

hb_buffer_t

Struct hb_buffer_t 

Source
pub struct hb_buffer_t {
Show 25 fields pub flags: BufferFlags, pub cluster_level: u32, pub invisible: Option<GlyphId>, pub not_found_variation_selector: Option<u32>, pub direction: Direction, pub script: Option<Script>, pub language: Option<Language>, pub successful: bool, pub(crate) have_output: bool, pub have_separate_output: bool, pub have_positions: bool, pub idx: usize, pub len: usize, pub out_len: usize, pub info: Vec<GlyphInfo>, pub pos: Vec<GlyphPosition>, pub context: [[u32; 5]; 2], pub context_len: [usize; 2], pub(crate) digest: hb_set_digest_t, pub(crate) glyph_set: U32Set, pub allocated_var_bits: u8, pub serial: u8, pub scratch_flags: u32, pub max_len: usize, pub max_ops: i32,
}

Fields§

§flags: BufferFlags§cluster_level: u32§invisible: Option<GlyphId>§not_found_variation_selector: Option<u32>§direction: Direction§script: Option<Script>§language: Option<Language>§successful: bool

Allocations successful.

§have_output: bool

Whether we have an output buffer going on.

§have_separate_output: bool§have_positions: bool

Whether we have positions

§idx: usize§len: usize§out_len: usize§info: Vec<GlyphInfo>§pos: Vec<GlyphPosition>§context: [[u32; 5]; 2]§context_len: [usize; 2]§digest: hb_set_digest_t§glyph_set: U32Set§allocated_var_bits: u8§serial: u8§scratch_flags: u32§max_len: usize

Maximum allowed len.

§max_ops: i32

Maximum allowed operations.

Implementations§

Source§

impl hb_buffer_t

Source

pub const MAX_LEN_FACTOR: usize = 256

Source

pub const MAX_LEN_MIN: usize = 65536

Source

pub const MAX_LEN_DEFAULT: usize = 0x3FFF_FFFF

Source

pub const MAX_OPS_FACTOR: i32 = 4096

Source

pub const MAX_OPS_MIN: i32 = 65536

Source

pub const MAX_OPS_DEFAULT: i32 = 0x1FFF_FFFF

Source

pub fn new() -> Self

Creates a new Buffer.

Source

pub fn allocate_var(&mut self, shape: buffer_var_shape)

Source

pub fn try_allocate_var(&mut self, shape: buffer_var_shape) -> bool

Source

pub fn deallocate_var(&mut self, shape: buffer_var_shape)

Source

pub fn assert_var(&self, shape: buffer_var_shape)

Source

pub fn info_slice_mut(&mut self) -> &mut [GlyphInfo]

Source

pub fn out_info(&self) -> &[GlyphInfo]

Source

pub fn out_info_mut(&mut self) -> &mut [GlyphInfo]

Source

fn set_out_info(&mut self, i: usize, info: GlyphInfo)

Source

pub fn cur(&self, i: usize) -> &GlyphInfo

Source

pub fn cur_mut(&mut self, i: usize) -> &mut GlyphInfo

Source

pub fn cur_pos_mut(&mut self) -> &mut GlyphPosition

Source

pub fn prev(&self) -> &GlyphInfo

Source

pub fn prev_mut(&mut self) -> &mut GlyphInfo

Source

pub fn update_digest(&mut self)

Source

pub fn update_glyph_set(&mut self)

Source

fn clear(&mut self)

Source

pub fn backtrack_len(&self) -> usize

Source

pub fn lookahead_len(&self) -> usize

Source

fn next_serial(&mut self) -> u8

Source

fn add(&mut self, codepoint: u32, cluster: u32)

Source

pub fn reverse(&mut self)

Source

pub fn reverse_range(&mut self, start: usize, end: usize)

Source

pub fn reverse_groups<F>(&mut self, group: F, merge_clusters: bool)
where F: Fn(&GlyphInfo, &GlyphInfo) -> bool,

Source

pub fn group_end<F>(&self, start: usize, group: F) -> usize
where F: Fn(&GlyphInfo, &GlyphInfo) -> bool,

Source

fn reset_clusters(&mut self)

Source

pub fn guess_segment_properties(&mut self)

Source

pub fn sync(&mut self) -> bool

Source

pub fn clear_output(&mut self)

Source

pub fn clear_positions(&mut self)

Source

pub fn replace_glyphs( &mut self, num_in: usize, num_out: usize, glyph_data: &[u32], )

Source

pub fn replace_glyph(&mut self, glyph_index: u32)

Source

pub fn output_glyph(&mut self, glyph_index: u32)

Source

pub fn output_info(&mut self, glyph_info: GlyphInfo)

Source

pub fn copy_glyph(&mut self)

Copies glyph at idx to output but doesn’t advance idx.

Source

pub fn next_glyph(&mut self)

Copies glyph at idx to output and advance idx.

If there’s no output, just advance idx.

Source

pub fn next_glyphs(&mut self, n: usize)

Copies n glyphs at idx to output and advance idx.

If there’s no output, just advance idx.

Source

pub fn skip_glyph(&mut self)

Advance idx without copying to output.

Source

pub fn reset_masks(&mut self, mask: u32)

Source

pub fn set_masks( &mut self, value: u32, mask: u32, cluster_start: u32, cluster_end: u32, )

Source

pub fn merge_clusters(&mut self, start: usize, end: usize)

Source

fn merge_clusters_impl(&mut self, start: usize, end: usize)

Source

pub fn merge_grapheme_clusters(&mut self, start: usize, end: usize)

Source

pub fn merge_out_clusters(&mut self, start: usize, end: usize)

Source

pub fn merge_out_grapheme_clusters(&mut self, start: usize, end: usize)

Source

fn merge_out_clusters_impl(&mut self, start: usize, end: usize)

Source

pub fn delete_glyph(&mut self)

Merge clusters for deleting current glyph, and skip it.

Source

pub fn delete_glyphs_inplace(&mut self, filter: impl Fn(&GlyphInfo) -> bool)

Source

pub fn unsafe_to_break(&mut self, start: Option<usize>, end: Option<usize>)

Source

pub fn safe_to_insert_tatweel( &mut self, start: Option<usize>, end: Option<usize>, )

Source

fn _set_glyph_flags_impl( &mut self, mask: u32, start: usize, end: usize, interior: bool, from_out_buffer: bool, )

Source

fn set_glyph_flags( &mut self, flags: GlyphFlags, start: Option<usize>, end: Option<usize>, interior: Option<bool>, from_out_buffer: Option<bool>, )

Adds glyph flags in mask to infos with clusters between start and end. The start index will be from out-buffer if from_out_buffer is true. If interior is true, then the cluster having the minimum value is skipped. */

Source

pub fn unsafe_to_concat(&mut self, start: Option<usize>, end: Option<usize>)

Source

pub fn unsafe_to_break_from_outbuffer( &mut self, start: Option<usize>, end: Option<usize>, )

Source

pub fn unsafe_to_concat_from_outbuffer( &mut self, start: Option<usize>, end: Option<usize>, )

Source

pub fn move_to(&mut self, i: usize) -> bool

Source

pub fn ensure(&mut self, size: usize) -> bool

Source

fn enlarge(&mut self, size: usize) -> bool

Source

fn make_room_for(&mut self, num_in: usize, num_out: usize) -> bool

Source

fn shift_forward(&mut self, count: usize) -> bool

Source

fn clear_context(&mut self, side: usize)

Source

pub fn sort( &mut self, start: usize, end: usize, cmp: impl Fn(&GlyphInfo, &GlyphInfo) -> bool, )

Source

pub fn set_cluster(info: &mut GlyphInfo, cluster: u32, mask: u32)

Source

pub(crate) fn enter(&mut self)

Source

pub(crate) fn leave(&mut self)

Source

fn _infos_find_min_cluster( &self, info: &[GlyphInfo], start: usize, end: usize, cluster: Option<u32>, ) -> u32

Source

fn _infos_set_glyph_flags( &mut self, out_info: bool, start: usize, end: usize, cluster: u32, mask: u32, )

Source

pub fn is_empty(&self) -> bool

Checks that buffer contains no elements.

Source

fn push_str(&mut self, text: &str)

Source

fn set_pre_context(&mut self, text: &str)

Source

fn set_pre_context_codepoints(&mut self, codepoints: &[u32])

Source

fn set_post_context(&mut self, text: &str)

Source

fn set_post_context_codepoints(&mut self, codepoints: &[u32])

Source

pub fn next_syllable(&self, start: usize) -> usize

Source

pub fn allocate_lig_id(&mut self) -> u8

Source§

impl hb_buffer_t

Source

pub(crate) fn allocate_unicode_vars(&mut self)

Source

pub(crate) fn deallocate_unicode_vars(&mut self)

Source

pub(crate) fn assert_unicode_vars(&mut self)

Source

pub(crate) fn allocate_gsubgpos_vars(&mut self)

Source

pub(crate) fn deallocate_gsubgpos_vars(&mut self)

Source

pub(crate) fn assert_gsubgpos_vars(&mut self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.