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
Please add support for SVG OpenType fonts! #21
Comments
Note that this would require writing an SVG implementation which the original announcement post said wouldn't be likely:
The subset mentioned there was a hopeful comment on SVG usage in emojis being limited. Your examples seem to not be so limited. You'd need an SVG implementation (possibly using pathfinder for path rendering) that you could then plug in to pathfinder. Perhaps you could wire librsvg up for this but I suspect it'll be non-trivial. |
I think that it will be necessary for two reasons:
|
You may not need to add much to pathfinder in order to support everything needed to render SVG but the harder part will be parsing SVG to generate the rendering commands. |
@Emasoft sounds you know a lot. Help pathfinder project by submitting pull request of SVG implementation. |
I'm working on full scene rasterization, which would enable SVG. The hard part here is avoiding swamping the GPU in draw calls. This will require a rewrite of most of Pathfinder, but it looks promising so far. |
@pcwalton This is an awesome news! |
Interesting approach from http://gaps-zju.org/pathrendering/GPUpathrendering.pdf "We generate both fragments and spans as line primitives |
I'm working on demonstrating how to render a subset of SVG as part of the demo. Supporting all of SVG, however, is out of scope for Pathfinder, as filters, clipping, etc. would duplicate code in WebRender. If you need broad support for SVG, use WebRender instead, which Pathfinder will eventually integrate into. |
@imoldfella I do not believe that that approach can ever be as fast as Pathfinder 2's B-mesh tessellation. |
@pcwalton Wow! Do you have any benchmark yet? I suppose your code could become the reference for 2D tessellation, as Pixar OpenSubdiv is for 3D bezier patches tesselation ( https://github.com/PixarAnimationStudios/OpenSubdiv )! |
@pcwalton The part I thought was interesting is that they use the compute shader to build the data for one big draw command. I'm not sure how color pathfinder depth/color peels an SVG drawing into coverage buffers, but I was imagining something similar could happen where the fill stage of pathfinder creates multiple coverage buffers while simultaneously creating data for an attribute-less draw command to assemble them into the overall image. Frostbite apparently does something similar. https://frostbite-wp-prd.s3.amazonaws.com/wp-content/uploads/2016/03/29204330/GDC_2016_Compute.pdf. Your comment about swamping the GPU in draw calls prompted the thought. They note that this approach has a side benefit of making it easy to fit the vector rendering into a more comprehensive pipeline; e.g in pathfinders case it might make an elegant way to integrate with webrender. They give the example of using nvidia's nvpr extension to do clipping of their output. |
I have an SVG demo now successfully rendering the tiger. Let's close this and open more specific bugs for particular SVG features that folks need. |
Please add support for SVG OpenType fonts!
We use them extensively in our opengl games!
https://blogs.adobe.com/creativecloud/photoshop-cc-adds-support-for-opentype−svg-fonts-an-in-depth-look/
https://www.microsoft.com/typography/otspec/svg.htm
The text was updated successfully, but these errors were encountered: