I am having a hard time understanding how to calculate the size of a word in processing when there are different font sizes.
All I am trying to do is to put suffix right after the word "Metric".
Does anyone know how to accomplish this?
//code
PFont f;
PFont f2;
void setup(){
size(600, 300);
f = createFont("SegoeUI-Semibold-200", 100);
f2 = createFont("SegoeUI-Semibold-200", 20);
}
String metric = "Metric";
void draw(){
float sw = textWidth(metric); //how can I use sw?
fill(240);
textFont(f);
text(metric, 0, height-20);
fill(0);
textFont(f2);
text("sufix",300, height-20); //How can I calculate x to be at then of word Metric
}