Closed alcalin closed 5 years ago
I don't think we do any special thing in the unit generator to solve this: https://github.com/spatialillusions/milsymbol-generator/blob/253cdae451467e3483a5ff5732e48601d66c0544/src/render-symbol.js However the unit generator is using the latest master branch of milsymbol and not the npm release, so there might be someting I have fixed in the main library. The next version of milsymbol will be released really soon, I was planning to do it this weekend but got a really bad cold unfortunately.
Get well soon!
On Thu, Apr 25, 2019 at 9:38 AM Måns Beckman notifications@github.com wrote:
I don't think we do any special thing in the unit generator to solve this:
https://github.com/spatialillusions/milsymbol-generator/blob/253cdae451467e3483a5ff5732e48601d66c0544/src/render-symbol.js However the unit generator is using the latest master branch of milsymbol and not the npm release, so there might be someting I have fixed in the main library. The next version of milsymbol will be released really soon, I was planning to do it this weekend but got a really bad cold unfortunately.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spatialillusions/milsymbol/issues/221#issuecomment-486676272, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJYBXJNDAFEYTFGK5L4D5LPSGX4XANCNFSM4HIK2POQ .
Release published! Both here and on NPM.
Get well soon! Awesome, thanks! I'll try again with the latest version.
I've upgraded to 2.0.0. I have the same issue. While debugging the unitgenerator I see there is catch for the toDataURL() function:
elm.querySelector("a.png").href = downloadSymbol.asCanvas().toDataURL();
try {
elm.querySelector("a.svg").href = downloadSymbol.toDataURL();
} catch (err) {
elm.querySelector("a.svg").href = "";
}
So the library also throws the same exception in the unitgenerator but it gets handled, and the actual image gets set in the first place using downloadSymbol.asCanvas().toDataURL()
.
I guess svg is preferred though.
Thanks for the prompt response!
Hello, I'm having some troubles trying to export a specific symbol with the code EFFPB------- . While it is working fine in your https://spatialillusions.com/unitgenerator/ when I try to create and export it using
toDataUrl()
it throws the following:The call to
window.btoa(this.asSVG())
insidetoDataUrl
is the one that is causing it and I presume it is because it contains the '€' character. How is the unitgenerator handling this?