[API] Allow canvas font customisation (#987)

Allows customisation of fonts via `LiteGraph` global var:

```ts
LiteGraph.NODE_FONT = "wingdings"
```


![image](https://github.com/user-attachments/assets/36bec38d-ea5f-4ec6-a2a3-bc5a57826c1e)
This commit is contained in:
filtered
2025-05-01 10:19:36 +10:00
committed by GitHub
parent c695b2e2bd
commit 0cdee75460
5 changed files with 14 additions and 6 deletions

View File

@@ -200,7 +200,7 @@ export class LGraphGroup implements Positionable, IPinnable, IColorable {
ctx.fill()
// Title
ctx.font = `${font_size}px Arial`
ctx.font = `${font_size}px ${LiteGraph.GROUP_FONT}`
ctx.textAlign = "left"
ctx.fillText(this.title + (this.pinned ? "📌" : ""), x + padding, y + font_size)