Text rendered with nvg blurry

Hi, we need to render text for a LED display and a lot of times the text is rendered blurry in VCV, depending on the zoom level. Is there any way around this?

The blur is anti-aliasing/font hinting.

You will have to twiddle around with the nanoVG state before drawing, none of the built-in text controls have an easy “antialiasing = no” property. And remember to set it back afterwards as it’s easy to accidentally change the font for half of the Rack UI from a stray module render call :face_with_head_bandage:

Screenshot…?

Cant post screenshot of the module yet as we didnt announce it yet so just gonna send a small screenshot where you can clearly see it being blurry. Blur goes away as soon as you zoom in.

NOTE: This is most obvious on non-retina screens.

49

Is that nvgText or an SVG path?

nvgText

I’ve often noticed that the text in a Label is blurry. If I move it by a pixel it changes.

What happens if you change the .tff file to a different font? :thinking:

yes correct…but then when you zoom in it changes again :wink:

I tried so many fonts, all the same…I am afraid only ttf is supported, tried using otf but does not get rendered.

stb_truetype.h 1.09 is used, which only supports TrueType fonts. 1.13 adds OpenType support, but this is not pulled into NanoVG yet.
However, the data structure of the font has nothing to do with the renderer, which is handled by NanoVG. Blurring occurs when text is drawn to a subpixel rather than an integer pixel coordinate. Quantizing of text positions would have to be done in a NanoVG patch.