-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add support context-fill / context-stroke for external SVG, used as object <image... /> #767
Comments
Is this even allowed by the spec? |
I don't remember the spec mentioning anything like that. |
I don’t know about the specification, but this is the only option where it is really in demand. A similar point exists only in the special SVG specification for color fonts fill="currentColor" |
It's not black, the default color is none, as mandated by the spec:
There's no mention about it applying to nested SVGs in The current release of So while I understand your use case, I don't think we can just deviate from what the specification mandates. |
This is not a deviation from specification. Content can be specified through any parent group. |
Oh, sorry. For some reason I assumed that you wanted to embed it via |
@Dimon-II Have you tested it in Chrome Canary? |
In general, exact adherence to SVG specifications is not important to me. I use RESVG as a rendering engine in my project: a new feature appeared and I tried to use it, saw the restrictions and asked about the possibility of circumventing them... |
I think it should be relatively straightforward to add support for loading files via |
I'm not sure you can link an SVG file via There reason why linking external SVG elements via Basically, if it works in Chrome - then we should probably implement it as well. If not - then no one cares. The SVG spec is pointless anyway. |
The previous engine (rsvg-convert.exe) I used supported <use...> references to external SVG parts (xlink:href="clipart.svg#Star"), but had other problems. Due to the rework on resvg, I was forced to create my own mechanism for embedding the SVG clipart into the main file at the time of rendering with renaming the links. With more recent support for external SVGs, this has been partially simplified, but it is often this color control that is missing. It looks like this is a completely new feature in Chrome, I’m not sure if it works fully. |
Just to clarify, are you expecting |
None of the options require changes to my program - just recommendations on how to use the icons more conveniently. image - now supported in resvg, use of external SVG is not yet available. Therefore, all existing projects only use image. Additionally, it is easier for the end user to have individual SVG files in the clipart folder (and see them in the catalog preview) rather than confusingly combining them into clipart. In addition, the image file is much more convenient due to automatic width/height scaling. In my case, this is a simplification of the template. Right now I'm translating Lorcana game cards and I had to create separate black and white SVG files of the same icon and make different macros for them because can't share the color from the surrounding text / parent group. |
Good. So everything is working as expected. |
I would like to be able to control the color of external SVG icons.
Currently, the image (containing a single path) is not displayed if fill="context-fill" is used in this file.
The text was updated successfully, but these errors were encountered: