-
-
Notifications
You must be signed in to change notification settings - Fork 4
createFont_
PFont myFont;
void setup() {
size(200, 200);
// Uncomment the following two lines to see the available fonts
//String[] fontList = PFont.list();
//println(fontList);
myFont = createFont("FFScala", 32);
textFont(myFont);
text("!@#$%", 10, 50);
}
Dynamically converts a font to the format used by Processing from either a font name that's installed on the computer, or from a .ttf or .otf inside the data folder of the sketch. Use thePFont.list() method to first determine the names for the fonts recognized by the computer. If you're going to be sharing the program with other people or posting it on the web, it's important to include a .ttf or .otf version of your font the the data directory of the sketch because other people might not have the font installed on their computer.Use thePFont.list() method to first determine the names for the fonts recognized by the computer. Thesize parameter states the font size you want to generate. Thecharset parameter is an array of chars which specifies the characters to generate and thesmooth parameter specifies if the font should be antialiased or not. Processing displays fonts using the .vlw font format, which uses images for each letter, rather than defining them through vector data.
createFont(<font color="#996600">name</font>, <font color="#996600">size</font>)
createFont(<font color="#996600">name</font>, <font color="#996600">size</font>, <font color="#996600">charset</font>)
createFont(<font color="#996600">name</font>, <font color="#996600">size</font>, <font color="#996600">smooth</font>)
createFont(<font color="#996600">name</font>, <font color="#996600">size</font>, <font color="#996600">charset</font>, <font color="#996600">smooth</font>)
PFont
Web & Applicações
A referência de Processing está sob a licença Creative Commons BY-NC conforme indicado aqui. Esta Wiki-tradução é baseada na tradução e adaptação para o Português do Brasil do professor Luiz Ernesto Merkle