Disable font antialiasing

I’m making a game using processing 3. I use a pixel art font. But when I set the font size to large values like 60 and 100 the font becomes blurry. I know this is because of anti-aliasing, but how do I disable it? I have disabled antialiasing for textures using ((PGraphicsOpenGL) g).textureSampling(2); but it does not affect fonts. Any way to disable antialiasing for fonts?

Have you checked out noSmooth()?

One caveat: Using this will disable aliasing for all objects drawn to the canvas. If its just the text you want non-aliased, perhaps you can draw it to a separate p5.Graphics object. LMK if it works! I haven’t tried it myself :sweat_smile:

2 Likes