TrueType loadFont


#1

Dear all,

according the example ( https://processing.org/reference/textFont_.html ) on the reference manual I wrote the following sketch:

PFont font32;
void setup()
{
    font32 = loadFont("steelfish rg.ttf");
    size(300,300);
    background(255);
}

void draw()
{
  fill(255,0,0);
  textFont(font32);
  text("word", 12, 60);
}

Unfortunately it doesn’t work because loadFont accepts only VLW file.
I converted the font in VLW format but, as soon as I try to display some text, the the image trasparency is compromised.

Did you have any similar problem ?
How do you fixed it ?
Thank you very much for your help and cooperation
Regards


#2

Did you adjust your code to „.vlw“? It might not be loading correctly if you still have .ttf as ending. Or if Thats not it, maybe the conversino didn‘t go Well and the font itself got transparent.


#3

Yes, of course.
I adjusted the code as following:

PFont font32;
PImage myImg;
void setup()
{
    font32 = loadFont("steelfish rg.vlw");
    size(300,300);
    background(255);
    myImg=loadImage("myImage.png");

}

void draw()
{
  image(myImg,100,100);
  fill(255,0,0);
  textFont(font32);
  text("word", 12, 60);
}

#4

That shouldn‘t be possible, since files arent allowed to have spaces, at least as far as i know. And if that doesn‘t work, try Setting the font after size().