github.com/Kintar/etxt@v0.0.0-20221224033739-2fc69f000137/emask/doc.go (about) 1 // The emask subpackage defines the [Rasterizer] interface used within etxt 2 // and provides multiple ready-to-use implementations. 3 // 4 // In this context, "[Rasterizer]" refers to a "glyph mask rasterizer": 5 // whenever we want to render text on a screen we first have to rasterize 6 // the individual font glyphs, extracted from font files as outlines 7 // (sets of lines and curves), and draw them into a raster image (a grid 8 // of pixels). 9 // 10 // In short, this subpackage allows anyone to pick different rasterizers 11 // or implement their own by targeting the [Rasterizer] interface. This 12 // opens the door to the creation of cool effects that may modify the 13 // glyph outlines (e.g.: glyph expansion), the rasterization algorithms 14 // (e.g.: hinting), the resulting glyph masks (e.g.: blurring) or any 15 // combination of the previous. 16 // 17 // That said, before you jump into the hype train, notice that some of these 18 // effects can also be achieved (often more easily) at later stages with 19 // shaders or custom blitting. 20 package emask