(rgba, width, x, y, line, scale)
| 310 | } |
| 311 | |
| 312 | function drawBitmapText(rgba, width, x, y, line, scale) { |
| 313 | let cursor = x; |
| 314 | for (const char of line) { |
| 315 | const glyph = glyphFor(char); |
| 316 | for (let gy = 0; gy < glyph.length; gy += 1) { |
| 317 | for (let gx = 0; gx < glyph[gy].length; gx += 1) { |
| 318 | if (glyph[gy][gx] !== "#") continue; |
| 319 | fillRect(rgba, width, cursor + gx * scale, y + gy * scale, scale, scale, [255, 255, 255, 255]); |
| 320 | } |
| 321 | } |
| 322 | cursor += (glyph[0].length + 1) * scale; |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | async function writeLabelImage(text, targetPath) { |
| 327 | const paddingX = 16; |
no test coverage detected