top of page

Letter Sizing

void setup() {
size(600, 400);
background(0);
float x = 10;


String s = "OVERWHELMED" ; //this line just print the regular text


textSize(64);
text(s, 10 , 100);


for (int i= 0; i< s.length();i++) { //draw each character
char c=s.charAt(i);
textSize(random(12,128));
text(c, x, 300);
x = x + textWidth(c);
}
}

Code

Image

Screen Shot 2020-05-14 at 12.59.44 PM.pn

This exercise is a simple code that randomises the size of the text shown on the screen using the text(), random() and int functions. It gives the text a more chaotic look. For this exercise, I didn’t make a lot of modifications. I simply changed the text to the word “OVERWHELMED”. This was because I was testing out codes that I could include in my final code to represent one emotion during COVID-19. I also played around with the colour and the range of sizing that the text can be. I also tried adding fonts. The image above shows a minimal result.

 

(click the functions underlined to learn more about them)

Function

bottom of page