Im trying to make a code which changes the letters in a text, and places a image on top of the certain letter that is changed.
So far I have managed to replace the characters and upload the images, that belongs to the certain letters.
What I'm missing now is a variable that decides the placement of the image - depending on where on the canvas the letter is placed. And also a variable that counts the letters in the word the certain letter is placed, which should decide the size of the image.
This is my script so far, hope someone can and will help me, it will be much appreciated! :)
Hi! I'm very new at Processing, and would appreciate some help!
What I'm trying to do is to make a pronunciation-translation code. I want to find certain characters in a textfile and replace them with others. I would also like to put in certain symbols on top of the letter.
Soo.. What I want to do is change the first letters to the second ones.
O -- Å
CCH -- KK
CH -- K
CI -- TSJI
CCI -- TSJI
GLI -- JLI
U -- O
ZI -- DZI
CCE -- TSHE
CE -- TSHE
GI -- DJI
GGI -- DJI
GE -- DJE
GGE -- DJE
After that I want to place a symbol on top, with size varying on the length of the word the letters are placed in.
This is the code I have so far, so as you can see, I need some help. hehe
PFont f;
void setup(){
size(500,700);
background(255);
noStroke();
smooth();
noLoop();
// load
f= loadFont ("Lane-Narrow-20.vlw");
}
// variables
int yp=80;
void draw(){
String quote1[] = loadStrings("BM1.txt");
//Decides the font and the fill color.
textFont (f,20);
fill(0);
for (int c=0; c<quote1.length; c++) {
String[] words = split(quote1[c], ' ');
println(words);
char[] chars = quote1[c].toCharArray();
println(chars);
}
for (int i=0; i<quote1.length; i++){
text((quote1[i]),40,yp);
yp=yp+40;
}
noLoop();
}
Hope someone would like to help me, it would be much appreciated