pub struct Engine {
fonts: Option<Fonts>,
hyphen_penalty: i32,
stretch_tolerance: f32,
pub margin: Edge,
pub font_size: f32,
pub text_align: TextAlign,
pub line_height: f32,
pub dims: (u32, u32),
pub dpi: u16,
}Fields§
§fonts: Option<Fonts>§hyphen_penalty: i32§stretch_tolerance: f32§margin: Edge§font_size: f32§text_align: TextAlign§line_height: f32§dims: (u32, u32)§dpi: u16Implementations§
Source§impl Engine
impl Engine
pub fn new() -> Engine
pub fn load_fonts(&mut self)
pub fn set_hyphen_penalty(&mut self, hyphen_penalty: i32)
pub fn set_stretch_tolerance(&mut self, stretch_tolerance: f32)
pub fn set_margin(&mut self, margin: &Edge)
pub fn set_font_size(&mut self, font_size: f32)
pub fn layout(&mut self, width: u32, height: u32, font_size: f32, dpi: u16)
pub fn set_text_align(&mut self, text_align: TextAlign)
pub fn set_font_family(&mut self, family_name: &str, search_path: &str)
pub fn set_margin_width(&mut self, width: i32)
pub fn set_line_height(&mut self, line_height: f32)
pub fn rect(&self) -> Rectangle
pub fn build_display_list( &mut self, node: NodeRef<'_>, parent_style: &StyleData, loop_context: &LoopContext, stylesheet: &StyleSheet, root_data: &RootData, resource_fetcher: &mut dyn ResourceFetcher, draw_state: &mut DrawState, display_list: &mut Vec<Page>, ) -> ChildArtifact
fn compute_column_widths( &mut self, node: NodeRef<'_>, parent_style: &StyleData, loop_context: &LoopContext, stylesheet: &StyleSheet, root_data: &RootData, resource_fetcher: &mut dyn ResourceFetcher, draw_state: &mut DrawState, )
fn gather_inline_material( &self, node: NodeRef<'_>, stylesheet: &StyleSheet, parent_style: &StyleData, spine_dir: &PathBuf, markers: &mut Vec<usize>, inlines: &mut Vec<InlineMaterial>, )
fn make_paragraph_items( &mut self, inlines: &[InlineMaterial], parent_style: &StyleData, line_width: i32, resource_fetcher: &mut dyn ResourceFetcher, ) -> (Vec<ParagraphItem<ParagraphElement>>, Vec<ImageElement>)
fn place_paragraphs( &mut self, inlines: &[InlineMaterial], style: &StyleData, root_data: &RootData, markers: &[usize], resource_fetcher: &mut dyn ResourceFetcher, draw_state: &mut DrawState, rects: &mut Vec<Option<Rectangle>>, display_list: &mut Vec<Page>, )
fn box_from_chunk( &mut self, chunk: &str, index: usize, element: &TextElement, ) -> ParagraphItem<ParagraphElement>
fn hyphenate_paragraph( &mut self, style: &StyleData, dictionary: &Standard, items: Vec<ParagraphItem<ParagraphElement>>, hyph_indices: &mut Vec<[usize; 2]>, ) -> Vec<ParagraphItem<ParagraphElement>>
fn cleanup_paragraph( &mut self, items: Vec<ParagraphItem<ParagraphElement>>, hyph_indices: &[[usize; 2]], glue_drifts: &mut Vec<f32>, bps: &mut Vec<Breakpoint>, ) -> Vec<ParagraphItem<ParagraphElement>>
pub fn render_page( &mut self, page: &[DrawCommand], scale_factor: f32, samples: usize, resource_fetcher: &mut dyn ResourceFetcher, ) -> Option<Pixmap>
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl !Send for Engine
impl !Sync for Engine
impl Unpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.