Path.fromSvg() #599
Replies: 3 comments 1 reply
-
I just tried again and i realized that im still not able to call the fromSVG function on the Path object. I am still using the following script tag to load opentype.js:
The Path.fromSVG() function whitch is already described in the readme doesnt seems to exist in the current published version of opentype. So i have searched for it in the src folder of the GitHub Repo. I found the following function in the path.js file:
}; /**
Am i Right with my suggestion? Is it already foreseeable when a new version of OpenType.js will be released, in which the fromSVG() function will be available? |
Beta Was this translation helpful? Give feedback.
-
Are you running the latest version from the master branch? Because I think that function wasn't available in the last official release yet. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have created svg elements using the p5.js-svg librarie. Now i want to convert the svgs into paths so i can create glyphs with it. and the push the glyphs into a new fontfile. In the README file i found the Path.fromSVG() method whitch i think would do exactly what i try to do.
<script src="https://cdnjs.cloudflare.com/ajax/libs/opentype.js/1.3.4/opentype.min.js" integrity="sha512-Ro+jjHMdfC0ZYcLjWhxVxZtGWFbIGsfvZbVCU3EYCr/aP4dIyzHkSeuhF3wQHb43wz2UCs0M7o16+lAC3/muYA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>Im using the following script tag to load opentype.js:
Expected Behavior
I was expecting that the function gives me a Path whitch i can use to create a new Glyph. And then push the Glyphs in to a new Font File.
Current Behavior
However when im running my code i get the error that “Path.fromSVG is not a function”. I have logged the Path object to the console and look at the provided prototype functions. and fromSVG is not in this list.
Possible Solution
In the opentype.js repository under /src i have found the path.js file in whitch i have found a fromSVG() function. So probably it dont work because i have linked to cdn instead of downloading opentype.js and so the path.js file isnt available in the browser.
Another possible reason could be that the fromSVG() function is still work in progress and not yet published in the opetype.min.js 1.3.4.
How can i solve my Problem?
Im Happy for every Help/Suggestions;)
Beta Was this translation helpful? Give feedback.
All reactions