firetype is a library which enables the use of hardware accelerated font rendering. ItÂ reads and parses TrueType fonts using the OpenType file format,Â converts the contained vector glyphs into polygon shapes and renders them using Stage3D via the GPU.
The library makes it easier to handle the resolutions of different versions of Flash or AIR application.Â It’s possible to arbitrarily scale the texts without worrying about texture resolutions or the performance impact of software rendering on mobile devices.
The rendering process does Â not have any impact on CPU performance, which avoids framerate drop. Additionally itÂ only renders pixels actually occupied by characters, saving memory and avoiding shaders and texture lookups operations on transparent pixels.
_hardwareText = new HardwareText(_context3d); _hardwareText.text = "Hello World!\nThis text is being rendered using firetype!"; _hardwareText.scaleX = _hardwareText.scaleY = 0.02; _hardwareText.x = -320; _hardwareText.calculateTransformations(viewProjection, true); _hardwareText.cache.render(); // formatting text _hardwareText.standardFormat.color = 0x333333; _hardwareText.text = "Just like this."; _hardwareText.text = "You can change the text color with the " + "color attribute.";