Struct svgbob::Grid [] [src]

pub struct Grid { /* fields omitted */ }

Methods

impl Grid
[src]

instantiate a grid from input ascii text Issues: 1. 2-width, 5 bytes, single character i.e. 统 2. 1-width, 2 bytes, single character i.e. ö 3. 1-width, 3 bytes, single character i.e. o͡͡͡

reassemble the Grid content into a string trimming unneeded whitespace to the right for every line

get the maximum row len

get a character at this location widths are computed since there are characters that spans 2 columns and characters that has 0 width

put a text into this location prepare the grid for this location first

insert a new line to at this point

join this line to the previous line

get the line len at this index

prepare the grid to accomodate this loc if loc.y < 0 => insert abs(loc.y) rows at element 0 to self.index if loc.y > row.y => append (loc.y-row.y) rows to the self.x if loc.x < 0 => insert abs(loc.x) columns at element 0, to all rows if loc.x > row.x => append (loc.x-row.x) elements to the row returns the corrected location, -1,-1 will be on 0,0

Vector arranged in row x col

get the focus char at this location

get the generated svg according to the settings specified

Trait Implementations

impl Debug for Grid
[src]

Formats the value using the given formatter.