My goal is to extract specific characters from SVG fonts created for music engraving. Music fonts typically include a large collection of characters (> 3500), but I only require a small subset of them for caching glyphs in compressed form to ensure quick access.
An example of a typical glyph node looks like this:
<glyph unicode="" horiz-adv-x="621" d="...">
To achieve this, I need to identify the necessary glyphs by their "unicode" attribute. I believe this can be done using querySelector or jQuery.
However, I am struggling with how the selector should be formatted. The following simple selector does not seem to work:
var myGlyph = document.querySelector("glyph[unicode=e050]");
Another challenge I face is that some glyphs have more than one unicode codepoint:
<glyph unicode="" horiz-adv-x="671" d="...">
I understand that I need to create the appropriate selector to handle both cases. As a newcomer to this field, I do not fully grasp the syntax of selectors outlined in the existing documentation.
Could someone provide guidance on this issue?
Thank you in advance!