A kerning problem with an .otf font called NewgroundsFont-Regular has been posted on Stack Overflow and there have been no answers which address the underlying problem, so I am reposting a shortened version of the source code here to see if any of our forum members have an explanation. The basic problem is that there is no kerning (letter spacing) of the printed text, so that all the letters are positioned on top of one another. A link to the actual post is here: https://stackoverflow.com/questions/72281238/broken-otf-file-in-p5 . The font may be obtained at this URL: https://www.newgrounds.com/dump/download/f858f852e56f5dda50ae2aa869455495 or you can click on the link in StackOverflow. The same font run in Java mode in Processing 4.08b runs as expected with normal kerning. A simple demo to be run in p5.js Editor follows:
let newgroundsFont;
function preload() {
newgroundsFont = loadFont("NewgroundsFont-Regular.otf");
}
function setup() {
createCanvas(200, 200);
background(220);
textFont(newgroundsFont);
textSize(40)
text("test", 5, 120)
}
function draw() {
}
Output: