It is posible to make a variable in Processing or Java that self contain the typography (ttf or otf) in format of String to be able to load it in the same way that you can do it with images, since LoadImage () works from an array of integers. I can do it with the Images. Is there any way to do it for the case of typography? Thanks!
int[][] var = {
// R G B A
{255, 0, 0, 128},
{ 0, 255, 0, 128}
};
PImage loadPixelsArray(int xDiv, int yDiv, float[][] dots) {
PImage img = createImage(xDiv, yDiv, ARGB);
img.loadPixels();
int size = img.pixels.length;
for (int i = 0; i < size; i++) {
img.pixels[i] = color(dots[i][0], dots[i][1], dots[i][2], dots[i][3]);
}
img.updatePixels();
return img;
}
ps: returns PImage of 2 pixels. I need the same for PFont.
See Question&Answers more detail:os