MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / fillText

Function fillText

packages/alphatab/src/platform/svg/SvgCanvas.ts:151–166  ·  view source on GitHub ↗
(text: string, x: number, y: number)

Source from the content-addressed store, hash-verified

149 }
150
151 public fillText(text: string, x: number, y: number): void {
152 if (text === '') {
153 return;
154 }
155 let s: string = `<text x="${x * this.scale}" y="${
156 y * this.scale
157 }" style='stroke: none; font:${this.font.toCssString(this.settings.display.scale)}; ${this.getSvgBaseLine()}'`;
158 if (this.color.rgba !== '#000000') {
159 s += ` fill="${this.color.rgba}"`;
160 }
161 if (this.textAlign !== TextAlign.Left) {
162 s += ` text-anchor="${this.getSvgTextAlignment(this.textAlign)}"`;
163 }
164 s += `>${SvgCanvas._escapeText(text)}</text>`;
165 this.buffer += s;
166 }
167
168 private static _escapeText(text: string) {
169 return text

Callers

nothing calls this directly

Calls 1

toCssStringMethod · 0.80

Tested by

no test coverage detected