Use Custom Fonts and Large Amounts of Text

A typical scenario in a data visualization project is to use text with a custom font alongside graphic elements on the device display. Text labels and large amounts of body text quickly add complexity and a lot of work for our device to render the scene. We can enlist Processing’s OpenGL capabilities to help keep the frame rate up. Let’s create a sketch where we cover the screen dynamically with text positioned along the z (or depth) axis of the 3D scene, depending on where we touch the screen surface, as shown in the following screenshot. We’ll work with custom fonts for this project, both released by Google and available for us to use without restriction.

Processing uses a default font called Lucida ...

Get Rapid Android Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.