Open grochat opened 4 years ago
@Laurent: I will need guidance on how to add (and use) a new text font to verovio, for use in lyrics ;-)
There is no way to do this yet, but it would be good to have it in place. The main difficulty will be to provide Verovio with a way to know the bounding boxes of all glyphs in the font. For the text font (Times), this is now embedded as an XML file. We could change this to something more standard (e.g., a JSON file exported from FontForge?). This would much better but it is probably not a minor development. Eventually, we also need to see how this can work with the JavaScript toolkit. We probably do not want to embed all fonts and related font files withing the toolkit, so there should be a way to pass data.
Hi Laurent, as a first step, yes producing the bounding boxes as either json or xml is fairly easy! So contrary to music glyphs that are embedded in the svg, the assumption for the text font is that it is available on the local computer running Verovio, correct? I don't think we want any font to be actually embedded (as base64 data) in the svg output, do we?.. So we can add any .otf text font file to be installed on macOS or Linux with the verovio executable. Alternatively a font can be loaded at runtime (from the /data directory) without being actually installed (I know how to do it on macOS or Windows, I believe that is not too hard on Linux...), but we need to take the PDF export (with embedded fonts) into account. For the javascript toolkit, the font can also be loaded as a resource at runtime.
Look up IM Fell font family (already included in Medieval2). NB: Check with Igino Marini for permission. IM Fell would look nice for lyrics. It might be slightly anachronic, but let us take the risk! How technically in verovio a new text font can be added?..