I’m not an expert at all haha. Just seem to be more aware with all the distributable issues than most, apparently.
The issue is not just with fonts of course, but with any file you take from a different source and include into your project. Be it fonts, graphics, code. Without proper licensing (and “public domain” also counts here!) it just makes everything much more difficult in the long run.
In the case of fonts the best/easiest is to use fonts with the Open Font License, as it gives full freedom to modify and distribute the font files → SIL Open Font License - Wikipedia
Other licenses that are used by some fonts:
Bitstream-Vera (the OG before OFL was formalized)
CC0-1.0 (essentially “public domain”)
Apache-2.0 (well known opensource license)
Ubuntu Font License (based on OFL)
custom licenses that still allow free usage and distribution
If you can’t find any license for the font you want to include be wary that you likely do not have any rights to use or distribute it.
I have a license to use Proxima Nova, but not to distribute it. So I convert my text to paths when building the SVGs. If I needed the fonts at runtime, I think I’d have to either switch fonts (which I tried once, and failed to find anything I like) or renegotiate the license.
most of my panels render the fonts into the SVG, but there are a few places where I need to draw dynamic text, so I use fonts for that. And of course for music notation.
Personally, I would like to see a small collection of open source/license fonts included in the VCV Rack SDK, so that each developer who needs fonts doesn’t have to reinvent the wheel of discovery.
Is that the DejaVuSans.ttf and ShareTechMono-Regular.ttf fonts? I’m looking in the V1 SDK since I have not downloaded the V2 SDK source. That may be part of my problem, that I didn’t realize there were some UI fonts in the SDK.
Well, I learned something! I have been distributing DejaVuSansMono.ttf and license with my plugin And, I actually load that font in one draw() function. I confirmed that I do not need to load that font since as you said, it is the default context font. I also do not need to load the Ubuntu font nor distribute it, but if I use the context default font, I would need to tweak font sizes.
So, I will leave it as is for the time being, but it is good to know.
Do you know where it is documented that DejaVuSansMono.ttf is the Rack default context font and so does not need to be distributed or loaded?
Edit: Well, DejaVuSans.ttf is probably the default context font.
Very good idea, this would make some such choices a bit more standardized (with “sane defaults”) and somewhat reduce the amount of duplicate files in the library.
Once you start digging into modules you see several of the same fonts come back over and over.
I kind of doubt that redundant loading of fonts is a significant performance issue… But for sure the ones in VCV or OK. I’ll stick with my Robato, thought, thanks. Well, If I still made modules…
I have sort of a dumb question, but what is the best practice for using the 9 included fonts in plugins? Should we duplicate each needed font into our plugin /res folder? Or, should we load the font via a path to the Rack.exe /res/fonts folder? If the latter, what is the proper path syntax?