P5 text() and console.log treat multiline strings differently

Your editor and the console are probably using a fixed-width font, while text() is using a proportional font. Set a fixed-width font for p5 and it should match.