Using System fonts into in processing is quite simple as seen in the examples below. This approach dynamically loads the and displays the font, using vectors information, but be aware that this might not work for all fonts and appearance may very vary from computer to computer. The advantages of this approach is that the fonts can easily be scaled and still look clean without looking pixelated on the screen.
Code Block |
---|
PFont font; size(200, 200); String[] fontList = PFont.list(); printArray(fontList); // print out a list of all system fonts available. font = createFont("comic-sans", 32); textFont(font); text("I (heart) Helvetica", 10, 50); |
...
Alternatively fonts can be saved in a the bitmap format that Processing uses. This will generally offer better performance and be more consistent across different computers, with the compromise that it can not be scaled up without looking pixelated. It is an option however, to save the font in multiple sizes. To create the .vlw file, open Processing and select the >Tools > Create Font> menu item.
...