-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser Font Loading/SVG Painting Issue #28
Comments
I know this is kind of a pain but it acts as an identifier for the
I might be getting sidetracked but cdnfonts seems to have only WOFF format (which dropflow doesn't support) and those URLs return CSS, so not sure how your code snippets work. Did I miss any error reporting here or did you handle that?Anyways...
... I do understand needing deeper hooks into dropflow. Supposing I allow an object implementing the
If you need content to be more finely grouped than paint output will do (painting is naturally layering stuff without any grouping) do consider painting multiple documents/layout trees if you haven't. I've optimized it to be used that way. |
I totally get the need for a string identifier for each font, the weird thing is in having to provide a The reason I want the CDN URLs in my final output is so when someone exports my document as SVG, they can send it to someone else with reasonable assurance that the receiver's viewer can retrieve the fonts the document uses, without having to either install the fonts on their system or me having to embed font subsets in the output SVG. See my new comment here about an interim solution for a paint back-end. I don't think I need anything finely grouped, just the in-order drawing commands. The main advantage of still having something more than a duck-type proxy like in the comment, would be not having to re-parse string structures like |
Oh, and at least on my Mac, both the Mac SVG preview function and browser-based viewers like https://www.svgviewer.dev/ automatically retrieve and use the WOFF2 fonts just fine. |
an old TODO. the way you had to pass a URL was weird, so now it generates one (that's for logging). file:// urls load sync, and no longer fail in Node (idk how that went uncaught so long, but it has to do with the examples not using the public API... shame on me). Next up: update the examples and update loadNotoFonts Ref #28 Also #27 (comment)
an old TODO. the way you had to pass a URL was weird, so now it generates one (that's for logging). file:// urls load sync, and no longer fail in Node (idk how that went uncaught so long, but it has to do with the examples not using the public API... shame on me). Next up: update the examples and update loadNotoFonts Ref #28 Also #27 (comment)
an old TODO. the way you had to pass a URL was weird, so now it generates one (that's for logging). file:// urls load sync, and no longer fail in Node (idk how that went uncaught so long, but it has to do with the examples not using the public API... shame on me). Next up: update the examples and update loadNotoFonts Ref #28 Also #27 (comment)
an old TODO. the way you had to pass a URL was weird, so now it generates one (that's for logging). file:// urls load sync, and no longer fail in Node (idk how that went uncaught so long, but it has to do with the examples not using the public API... shame on me). Next up: update the examples and update loadNotoFonts Ref #28 Also #27 (comment)
You'll notice from my comment here that I have a field in my loaded fonts data structure for a "placeholder URL":
I had to do this because even though I use the browser
fetch
API to retrieve my font data, the DropFlow API doesn't let me use anything other an afile:
URL withregisterFont
:However, I want the output SVG to include the CDN URLs for the font's I may be declaring, except DropFlow rejects these:
So I use the placeholder URL and then have to do a textual replacement on the painted SVG:
This is part of why I'd like to produce an SVG.js DOM instead of merely textual SVG output. I know I could use
paintToSvgElements
and just deal with the@font-face
declarations myself, but I'd rather have a DOM to manipulate directly to incorporate multiple laid out blocks of text along with the graphics of my document.The text was updated successfully, but these errors were encountered: