The file FreeSerif-130.vlw, mentioned below in the loadFont function, should be created by clicking on the menu item Tools, followed by Create Font. This opens a window with a list of all fonts available on your computer. Choose one, define it's size and click Ok. This will save a .vlw-file in the data folder inside the folder of your sketch. One remark: save a new started sketch before creating a font!
Some computers ran into memory problems during the lesson. It appears that big fonts make Processing use a lot of memory. The solution is to open the Processing Preferences. Check the selectbox before the line "Increase maximum available memory to" and change the value to 512 (standard set to 256) MB. This should do the trick.
Some Processing apps would not save this setting and would return to the original state after restart of the application.
PFont f;
void setup() {
size(300, 300);
f = loadFont("FreeSerif-130.vlw");
textFont(f);
}
void draw() {
background(50, 0, 50);
fill(255, 0, 255, 90);
String message = "Put your text here..!";
text(message, mouseY, mouseX);
text("Hello World!", mouseX, 50);
textSize(130);
for (int i = 0; i < 10; i++) {
text(i, 100 + (i * 20), 100 + (i*20));
}
}
Geen opmerkingen:
Een reactie posten