pub fn to_drawing(mut self, font_id: FontId) -> Vec<Draw> {
        // Finish the layout
        self.layout_pending();

        let mut draw    = vec![];
        let mut glyphs  = vec![];

        for action in self.layout.into_iter() {
            match action {
                LayoutAction::Glyph(glyph)  => glyphs.push(glyph),
                LayoutAction::Draw(drawing) => {
                    // Draw any glyphs that are pending
                    let draw_glyphs = mem::take(&mut glyphs);
                    if draw_glyphs.len() > 0 {
                        draw.push(Draw::Font(font_id, FontOp::DrawGlyphs(draw_glyphs)));
                    }

                    // Followed up by the drawing action
                    draw.push(drawing);
                }
            }
        }

        // Remaining glyphs
        if glyphs.len() > 0 {
            draw.push(Draw::Font(font_id, FontOp::DrawGlyphs(glyphs)));
        }

        draw
    }
///
/// Finishes the layout and returns the drawing instructions
///
Finishes the layout and returns the drawing instructions
Finishes the layout and returns the drawing instructions
pub fn to_drawing(mut self, font_id: FontId) -> Vec<Draw> {
        // Finish the layout
        self.layout_pending();
        let mut draw    = vec![];
        let mut glyphs  = vec![];
        for action in self.layout.into_iter() {
            match action {
                LayoutAction::Glyph(glyph)  => glyphs.push(glyph),
                LayoutAction::Draw(drawing) => {
                    // Draw any glyphs that are pending
                    let draw_glyphs = mem::take(&mut glyphs);
                    if draw_glyphs.len() > 0 {
                        draw.push(Draw::Font(font_id, FontOp::DrawGlyphs(draw_glyphs)));
                    }
                    // Followed up by the drawing action
                    draw.push(drawing);
                }
            }
        }
        // Remaining glyphs
        if glyphs.len() > 0 {
            draw.push(Draw::Font(font_id, FontOp::DrawGlyphs(glyphs)));
        }
        draw
    }
pub fn to_drawing ( mut self , font_id : FontId ) -> Vec < Draw > { // Finish the layout self . layout_pending ( ) ; let mut draw = vec ! [ ] ; let mut glyphs = vec ! [ ] ; for action in self . layout . into_iter ( ) { match action { LayoutAction :: Glyph ( glyph ) => glyphs . push ( glyph ) , LayoutAction :: Draw ( drawing ) => { // Draw any glyphs that are pending let draw_glyphs = mem :: take ( & mut glyphs ) ; if draw_glyphs . len ( ) > 0 { draw . push ( Draw :: Font ( font_id , FontOp :: DrawGlyphs ( draw_glyphs ) ) ) ; } // Followed up by the drawing action draw . push ( drawing ) ; } } } // Remaining glyphs if glyphs . len ( ) > 0 { draw . push ( Draw :: Font ( font_id , FontOp :: DrawGlyphs ( glyphs ) ) ) ; } draw }
Finishes the layout and returns the drawing instructions
Finishes the layout and returns the drawing instructions
mut self
font_id
FontId