• Home
  • Raw
  • Download

Lines Matching full:levels

127 /// The `original_classes` and `levels` vectors are indexed by code unit offsets into the text.  If…
140 pub levels: Vec<Level>, field
150 /// Split the text into paragraphs and determine the bidi embedding levels for each paragraph.
166 …/// Split the text into paragraphs and determine the bidi embedding levels for each paragraph, wit…
183 let mut levels = Vec::<Level>::with_capacity(text.len()); in new_with_data_source() localVariable
197 &mut levels, in new_with_data_source()
205 levels, in new_with_data_source()
209 /// Produce the levels for this paragraph as needed for reordering, one level per *byte*
224 assert!(line.start <= self.levels.len()); in reordered_levels()
225 assert!(line.end <= self.levels.len()); in reordered_levels()
227 let mut levels = self.levels.clone(); in reordered_levels() localVariable
229 let line_levels = &mut levels[line.clone()]; in reordered_levels()
234 levels in reordered_levels()
237 /// Produce the levels for this paragraph as needed for reordering, one level per *character*
256 let levels = self.reordered_levels(para, line); in reordered_levels_per_char() localVariable
257 self.text.char_indices().map(|(i, _)| levels[i]).collect() in reordered_levels_per_char()
260 /// Re-order a line based on resolved levels and return the line in display order.
268 if !level::has_rtl(&self.levels[line.clone()]) { in reorder_line()
271 let (levels, runs) = self.visual_runs(para, line.clone()); in reorder_line()
272 reorder_line(self.text, line, levels, runs) in reorder_line()
275 /// Reorders pre-calculated levels of a sequence of characters.
278 …/// intended to be used when an application has determined the levels of the objects (character se…
286 …/// Furthermore, if `levels` is an array that is aligned with code units, bytes within a codepoint…
300 /// let levels = vec![l0, l0, l0, l0];
301 /// let index_map = BidiInfo::reorder_visual(&levels);
302 /// assert_eq!(levels.len(), index_map.len());
305 /// let levels: Vec<Level> = vec![l0, l0, l0, l1, l1, l1, l2, l2];
306 /// let index_map = BidiInfo::reorder_visual(&levels);
307 /// assert_eq!(levels.len(), index_map.len());
312 pub fn reorder_visual(levels: &[Level]) -> Vec<usize> { in reorder_visual()
313 reorder_visual(levels) in reorder_visual()
318 /// `line` is a range of bytes indices within `levels`.
320 /// The first return value is a vector of levels used by the reordering algorithm,
347 let levels = self.reordered_levels(para, line.clone()); in visual_runs() localVariable
348 visual_runs_for_line(levels, &line) in visual_runs()
351 /// If processed text has any computed RTL levels
356 level::has_rtl(&self.levels) in has_rtl()
362 /// The `original_classes` and `levels` vectors are indexed by code unit offsets into the text. If…
374 pub levels: Vec<Level>, field
417 let mut levels = Vec::<Level>::with_capacity(text.len()); in new_with_data_source() localVariable
435 &mut levels, in new_with_data_source()
441 levels, in new_with_data_source()
447 /// Produce the levels for this paragraph as needed for reordering, one level per *code unit*
456 assert!(line.start <= self.levels.len()); in reordered_levels()
457 assert!(line.end <= self.levels.len()); in reordered_levels()
459 let mut levels = self.levels.clone(); in reordered_levels() localVariable
461 let line_levels = &mut levels[line.clone()]; in reordered_levels()
470 levels in reordered_levels()
473 /// Produce the levels for this paragraph as needed for reordering, one level per *character*
482 let levels = self.reordered_levels(line); in reordered_levels_per_char() localVariable
483 self.text.char_indices().map(|(i, _)| levels[i]).collect() in reordered_levels_per_char()
486 /// Re-order a line based on resolved levels and return the line in display order.
493 if !level::has_rtl(&self.levels[line.clone()]) { in reorder_line()
496 let (levels, runs) = self.visual_runs(line.clone()); in reorder_line()
497 reorder_line(self.text, line, levels, runs) in reorder_line()
500 /// Reorders pre-calculated levels of a sequence of characters.
505 pub fn reorder_visual(levels: &[Level]) -> Vec<usize> { in reorder_visual()
506 reorder_visual(levels) in reorder_visual()
511 /// `line` is a range of code-unit indices within `levels`.
519 let levels = self.reordered_levels(line.clone()); in visual_runs() localVariable
520 visual_runs_for_line(levels, &line) in visual_runs()
523 /// If processed text has any computed RTL levels
531 /// Return the paragraph's Direction (Ltr, Rtl, or Mixed) based on its levels.
534 para_direction(&self.levels) in direction()
538 /// Return a line of the text in display order based on resolved levels.
542 /// `levels` array of `Level` values, with `line`'s levels reordered into visual order
545 /// (`levels` and `runs` are the result of calling `BidiInfo::visual_runs()` or
557 levels: Vec<Level>, in reorder_line()
561 if runs.iter().all(|run| levels[run.start].is_ltr()) { in reorder_line()
567 if levels[run.start].is_rtl() { in reorder_line()
597 para_direction(&self.info.levels[self.para.range.clone()]) in direction()
604 self.info.levels[actual_position] in level_at()