let myCell = requestCell(),
engine = myCell.engine;
let self = this,
host = (this.group && this.group.getHost) ? this.group.getHost() : false;
let textGlyphs,
textGlyphWidths = [],
textLines = [],
textLineWidths = [],
textLineWords = [],
textPositions = [],
spacesArray = [],
gStyle, gPos, item,
starts, ends, cursor, word, height,
space, i, iz, j, jz, k, kz;
let fragment, len, glyphArr, glyph, nextGlyph, glyphWidth, lineLen, totalLen,
singles = [],
pairs = [],
path = this.getTextPath(),
direction, loop, rotate;
let fontAttributes = this.fontAttributes,
glyphAttributes = fontAttributes.clone({});
let sectionStyles = this.sectionStyles;
let state = this.state,
fontLibrary = {},
fontArray = [];
let scale = this.currentScale,
dims = this.currentDimensions,
width = dims[0] * scale,
treatWordAsGlyph = this.treatWordAsGlyph,
lineHeight = this.lineHeight,
justify = this.justify,
handle, handleX, handleY;
fontAttributes.updateMetadata(scale, lineHeight, host);
glyphAttributes.updateMetadata(scale, lineHeight, host);
let defaultFont = fontAttributes.getFontString(),
defaultFillStyle = makeStyle(state.fillStyle),
defaultStrokeStyle = makeStyle(state.strokeStyle),
defaultSpace = this.letterSpacing * scale,
currentFont = defaultFont,
currentFillStyle = defaultFillStyle,
currentStrokeStyle = defaultStrokeStyle,
currentSpace = defaultSpace;
let highlightStyle = (this.highlightStyle) ? makeStyle(this.highlightStyle) : false,
highlightFlag = false;
let underlineStyle = (this.underlineStyle) ? makeStyle(this.underlineStyle) : false,
underlinePosition = this.underlinePosition,
underlineFlag = false;
let overlineStyle = (this.overlineStyle) ? makeStyle(this.overlineStyle) : false,
overlinePosition = this.overlinePosition,
overlineFlag = false;
let maxHeight = 0;