Example to draw text with installed fonts.
![draw Text with Fonts draw Text with Fonts](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjh50Cc8sW0ivm6rD7fpvXUBmz4F4AdM9QUiWVrOMncWTXp7TkWYt2xO0XLrDOu2n2ZORLiAiTCLOeMu0ptfmthantIJFjROgGhXwcD-P-JK-HImwSQBHlaxrEAhAkTTCdYOOZG20gp82g/s400/Processing_Text.png) |
draw Text with Fonts |
PFont fontBitstreamCharter20;
PFont fontBitstreamCharterBoldItalic20;
PFont fontDejaVuSans16;
void setup() {
size(600, 300);
background(255);
//Create fonts
fontBitstreamCharter20 = createFont("Bitstream Charter", 20, true); //name, size, smooth
fontBitstreamCharterBoldItalic20 = createFont("Bitstream Charter Bold Italic", 20); //name, size
fontDejaVuSans16 = createFont("DejaVu Sans", 16); //name, size
fill(0);
textFont(fontBitstreamCharter20);
text("fontBitstreamCharter20", 10, 25);
textFont(fontBitstreamCharter20, 16);
text("fontBitstreamCharter20, 16", 10, 50);
textFont(fontBitstreamCharterBoldItalic20);
text("fontBitstreamCharterBoldItalic20", 10, 75);
textFont(fontBitstreamCharterBoldItalic20, 32);
text("fontBitstreamCharterBoldItalic20, 32", 10, 100);
textFont(fontDejaVuSans16);
text("fontDejaVuSans16", 10, 125);
textFont(fontDejaVuSans16, 32);
text("fontDejaVuSans16, 32", 10, 150);
}
void draw() {
}
No comments:
Post a Comment