(str, x, y, width, height, options = {})
| 720 | Returns an array of line objects, each containing { text, x, y, glyphs: [ {g, path} ] } |
| 721 | */ |
| 722 | _lineateAndPathify(str, x, y, width, height, options = {}) { |
| 723 | |
| 724 | let renderer = options?.graphics?._renderer || this._pInst._renderer; |
| 725 | renderer.push(); |
| 726 | renderer.textFont(this); |
| 727 | |
| 728 | // lineate and compute bounds for the text |
| 729 | let { lines, bounds } = renderer._computeBounds |
| 730 | (textCoreConstants._FONT_BOUNDS, str, x, y, width, height, |
| 731 | { ignoreRectMode: true, ...options }); |
| 732 | |
| 733 | // compute positions for each of the lines |
| 734 | lines = this._position(renderer, lines, bounds, width, height); |
| 735 | |
| 736 | // convert lines to paths |
| 737 | let uPE = this.data?.head?.unitsPerEm || 1000; |
| 738 | let scale = renderer.states.textSize / uPE; |
| 739 | |
| 740 | const axs = this._currentAxes(renderer); |
| 741 | let pathsForLine = lines.map(l => this._lineToGlyphs(l, { scale, axs })); |
| 742 | |
| 743 | renderer.pop(); |
| 744 | |
| 745 | return pathsForLine; |
| 746 | } |
| 747 | |
| 748 | _currentAxes(renderer) { |
| 749 | let axs; |
no test coverage detected