Hi, wondering if there is further literature or guides on this note in the dev 2.0 limitations readme:
For v2.x, graphical and text drawing via nanovg will be supported. You can preview the status in the v2.0-dev branch. It works by using an adaptor to go from nanovg to our native GUI engine. TTF fonts are supported for drawing text.
I notice that some parts of a library I am trying to port use
NSVGimage* mySvg = svg->handle;
But svg->handle is a nullptr in the metamodule-rack-interface. Is there an example of what to do in this case?
Btw - my exercises with the SquinkyLabs port have proven to be very fruitful. I’ve gotten a few of them already in (Mutable Instruments alt firmware VCV rack ports)
nanosvg is not supported at all, unfortunately. nanovg is partially supported (and it’s confusingly named – not related to nanosvg)
The thing to do is to convert SVGs to PNGs on your computer. If you use the Rack native functions rack::asset::user() and rack::asset::plugin() then the MetaModule will replace the .svg extension with .png. So make sure you keep the naming the same, e.g. “Coolimage.svg” becomes “Coolimage.png” (case-sensitive of course).
But not all ways to load an SVG are going to work – I’m not sure even what the limits are because my only goal was to have it load SVGs for the active widgets (params, lights, jacks). So if you are loading an SVG for a Transparent widget or something else, then it probably won’t work.
What’s the specific use-case for loading an SVG file?
SanguineMutants has a few lines that fail to compile, which I had to comment out, which are used for the mode light colors.
I don’t know if necessarily an SVG is needed here, but not familiar enough with VCV Rack development generally (which I am trying to learn) to understand which parts can be replaced with a PNG or not.