sorry its a bit messy
final float startNum = 1;
final float endNum = 2;
int lastTime;
float stepSize;
//Added the output String, which stores the ouput
String output = "";
//The font declaration
PFont font;
void setup() {
//Increase the size of the frame
size(1024, 720);
lastTime = millis();
stepSize = endNum - startNum;
//Initialize the font
font = loadFont("ACaslonPro-Regular-48.vlw");
textFont(font);
//Set the size to be 12
textSize(12);
}
void draw() {
//Redraw the background
background(76);
//Because we are redrawing the background, we also have to redraw the text every frame
//Also, make the text box bigger
text(output, 15, 20, width - 15, height - 20);
//
if (millis() - lastTime > 1000) {
String result = "";
for (float j = startNum; j <= endNum; j += stepSize) {
result = result + j + " ";
}
//Assign the output to be the result
output = result;
float C = textWidth(output);
// float N = pow(1.5,output);
//textSize(300/N)
// textSize(textSize/2);
// float D = textAscent(output)+textDescent(output);
lastTime = millis();
stepSize /= 2;
println( C );
}
}
Even if the font size just gets smaller by half of the previous until it gets to like 0.5 font, the majority of the text would stay on the page.