Scalable drawing primitives
As you probably realized from the previous example, all the items that we have rendered so far are vector graphics. This means that they are described by lines, curves, and high-level parameters instead of a collection of pixels. Because of this, these components are called scalable (like in scalable vector graphics (SVG) files), meaning that they can be drawn at any scale. The Fyne toolkit is a scalable toolkit, which means that a Fyne application can be drawn at any scale and render at a high quality.
Let's look at the text component in more detail, for example. We define a simple text component as before:
w.SetContent(canvas.NewText("Text", color.Black))
We can then place that line of code into the standard main()
function that we wrote in the first section of this chapter, Anatomy of a Fyne application, and then run it. The output will be as expected—drawing text at the normal size—but if we override the preferred...