Rich text - the justification calculation
If you are laying out text then you will need to justify it. But what's the algorithm? Lets take a look...
A tech blog giving usable explainers, advice, tools, tricks and techniques for the Konva JavaScript canvas library, the HTML5 canvas, and related subjects.
If you are laying out text then you will need to justify it. But what's the algorithm? Lets take a look...
I found a frustration in the act of making arrays of acceptable values to use in input validation for closed lists when I'd already defined the same when setting the types. Could I find a way to set up the array once and use for both needs?
Ever needed to put a direction of flow indicator on some connector line? In this post I explain a simple approach to get that done.
The font loading process is a stumbling block for folks new to using web-fonts in conjunction with Konva.Text and in the canvas. In this short post I'll explain what the problem is, how to solve it, and provide links to sample code. Read on...
In part #1 I talked about setting up a Vite project from VSCode. That's only half the job because sooner or later you'll need to share what you made, and maybe one day even make it live. And let's not overlook testing.
When I moved over to TypeScript I could see the benefits but the code-transpile-test loop was way to slow, and I found a whole new world of pain in the form of bundlers. That was before I found Vite - since then my productivity is up and my frustration down. Here's why...
Editing line points or vertices of a polygon is a recurring question I see in the Konva Discord. It gets tricky when the line or its parents are affected by transforms. Here's how to make a bulletproof solution that handles that.
We are often required to position shapes relative to each other - maybe circles mark points on a line - but then you move one of the shapes and update the others position but it doesn't make sense. The answer is relativity!