[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

@@ -14,6 +14,7 @@ LiteGraphGlobal {
"CONNECTING_LINK_COLOR": "#AFA",
"ContextMenu": [Function],
"CurveEditor": [Function],
"DEFAULT_FONT": "Arial",
"DEFAULT_GROUP_FONT": 24,
"DEFAULT_GROUP_FONT_SIZE": undefined,
"DEFAULT_POSITION": [
@@ -26,6 +27,7 @@ LiteGraphGlobal {
"EVENT": -1,
"EVENT_LINK_COLOR": "#A86",
"GRID_SHAPE": 6,
"GROUP_FONT": "Arial",
"Globals": {},
"HIDDEN_LINK": -1,
"INPUT": 1,
@@ -57,6 +59,7 @@ LiteGraphGlobal {
"NODE_DEFAULT_COLOR": "#333",
"NODE_DEFAULT_SHAPE": 2,
"NODE_ERROR_COLOUR": "#E00",
"NODE_FONT": "Arial",
"NODE_MIN_WIDTH": 50,
"NODE_MODES": [
"Always",