Templates and Use in SVG #1577
Replies: 8 comments 7 replies
-
It's also SVG-only. But it seems like a really good idea (first time I had a chance to look at it). Size of the SVG and the memory it consumes are the biggest problems I have with Smoosic rn for large scores. Also I notice these guys don't use beams much :) We would save a lot of svg space having the glyphs as variables, but we'd still have beams/stems that would be immediate renders. And for most real scores, the svg group can't be limited to the line since there are systems, slurs, etc. But still, this is worth some experimentation. |
Beta Was this translation helpful? Give feedback.
-
Tom and I discussed related topics (svg symbol / use) in 2021: #1127 |
Beta Was this translation helpful? Give feedback.
-
There is definitely value to this approach. While loading SMuFL font files works great for a web browser context, what happens when we want to export the output to an SVG tag (for use in a vector art editor)? It would definitely be nice to be able to render the paths as SVG templates / symbols and then use the |
Beta Was this translation helpful? Give feedback.
-
Just looping in @rvilarl because he has looked into SMuFL a lot recently. With VexFlow 5, we are moving in the direction of using the otf / woff files directly, and not including the glyph paths inside the VexFlow library. This has many benefits, including allowing a developer to choose her/his favorite font, without requiring VexFlow to bundle them all at build time. The main drawback is that we no longer have knowledge of what the SVG paths look like. If we ever need to render a SVG with the path information, we would have to take the opentype.js approach and parse the font files at runtime. Perhaps opentype.js could be an optional runtime dependency? So if the developer wants to use the glyph paths, we would require that opentype.js be available for vexflow to use. |
Beta Was this translation helpful? Give feedback.
-
This is much better than repeating the path several times. However I still believe that the best is to use the font directly for several reasons:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi all, Just letting you know that we have started reviewing Rodrigo's PRs for VexFlow 5 over at: https://github.com/vexflow/vexflow/pulls If you have any questions or comments on this work, please ask them over at the PR discussion. I'm excited to see what VexFlow 5 will become, but I think the more eyes we can get reviewing the code, the stronger the end product will be. |
Beta Was this translation helpful? Give feedback.
-
Regarding GDPR, does an approach like https://github.com/fontsource/fontsource work? It's a directory of open source fonts, that are each hosted individually on NPM. https://github.com/fontsource/font-files https://github.com/fontsource/font-files/tree/main/fonts/other/bravura See directions for installing Bravura via NPM: We could try to use fontsource and make sure all the font files are the most up to date versions (I see their version of Bravura might be slightly outdated...). Or we can take the same approach and publish all the vexflow compatible fonts as individual NPM packages. Then a developer can run |
Beta Was this translation helpful? Give feedback.
-
This is just to leave a "big idea" somewhere -- I was looking at the Corpus Monodicum site and saw how they managed to greatly shrink the size of their SVG by using "use" and templates in their code:
https://data.corpus-monodicum.de/AE10C10B3AAC65FA11DC04A22B24CBF02823A602AC54423993A772C5425BBDF7.svg
it's a different direction than the move to vector fonts, but it's an interesting way to get high level reuse without needing to put complex paths in multiple places.
Beta Was this translation helpful? Give feedback.
All reactions