Skip to content

Commit fd2a02f

Browse files
committed
Updated font styling to Inter with improved typography spacing
1 parent 952881b commit fd2a02f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/engine/Renderer.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { nodeTypes } from '../nodeDefinitions';
22

3+
const FONT_FAMILY = "'Inter', sans-serif";
4+
35
class Renderer {
46
constructor(camera, isDarkTheme, isGridVisible, isNodeRoundingEnabled) {
57
this.camera = camera;
@@ -45,12 +47,12 @@ class Renderer {
4547

4648
getNodeDimensions(node, ctx) {
4749
const nodeType = nodeTypes[node.type];
48-
ctx.font = 'bold 14px Arial';
50+
ctx.font = `600 14px ${FONT_FAMILY}`;
4951
const titleWidth = ctx.measureText(node.type).width;
5052

51-
ctx.font = '10px Arial';
53+
ctx.font = `400 13px ${FONT_FAMILY}`;
5254
const descriptionLines = this.wrapText(ctx, nodeType.description, 180);
53-
const descriptionHeight = descriptionLines.length * 12;
55+
const descriptionHeight = descriptionLines.length * 14;
5456

5557
const inputsHeight = nodeType.inputs.length * 20;
5658
const outputsHeight = nodeType.outputs.length * 20;
@@ -258,15 +260,15 @@ class Renderer {
258260

259261
// Node title
260262
ctx.fillStyle = 'white';
261-
ctx.font = 'bold 14px Arial';
263+
ctx.font = `600 14px ${FONT_FAMILY}`;
262264
currentHeight += 20;
263265
ctx.fillText(node.type, node.x + 10, node.y + currentHeight);
264266

265267
// Node description
266-
ctx.font = '10px Arial';
268+
ctx.font = `400 13px ${FONT_FAMILY}`;
267269
const descriptionLines = this.wrapText(ctx, nodeType.description, width - 20);
268270
descriptionLines.forEach((line, index) => {
269-
currentHeight += 12;
271+
currentHeight += 14;
270272
ctx.fillText(line, node.x + 10, node.y + currentHeight + 3);
271273
});
272274

@@ -319,7 +321,7 @@ class Renderer {
319321
// Node properties
320322
if (nodeType.properties) {
321323
ctx.fillStyle = 'white';
322-
ctx.font = '12px Arial';
324+
ctx.font = `500 13px ${FONT_FAMILY}`;
323325

324326
nodeType.properties.forEach((prop, index) => {
325327
// Check if property should be visible

0 commit comments

Comments
 (0)