Hey guys! I was just playing around with text engines on Scratch, and came across this really cool concept of Bezier curves. What exactly is a Bezier curve? It's a way of defining a curve with only 3 points! This is super useful for programmers, because it uses a lot less storage space than having to define hundreds of points along the curve. It also allows you to render the curve with as many or as few points as you'd like, meaning that you can render it really fast at lower quality, or slower but super high quality. This is a powerful way of optimising your projects. What can I use this for? As you can see in the demonstration, Bezier curves can be used to display letters. But it can also be used to define many other things! Did you know that many images are defined using a lot of Bezier curves? This is how the SVG image storage system is so efficient! Unlike PNG, which stores every pixel of an image, the Scalable Vector Graphics system uses mathematical equations to display images. This means that you can zoom in forever, and they will still retain the quality they originally had! Isn't that awesome? To render the letters, I joined a bunch of curves together into something called a spline. A spline is a combination of continuous curves. This is where the curve is smooth and without any sudden "kinks". Most letters are made using a single spline. But what about letters that need sudden bends? Letters like "k" or "w"? This can be fixed by simply moving the defining point of one curve out of line with the defining point of the other curve. This allows the two curves to act independently of each other, but still be joined at the middle. Bezier curves are really awesome!
For more cool stuff, check out my text engine here: https://scratch.mit.edu/projects/1154837343/ It has a cool letter editor that allows you to create your own glyphs! Credit to Scratch for their awesome site :D