Skip to content
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

Support SVGUseElement child within SVGClipPathElement? #125

Open
dirkschulze opened this issue Dec 22, 2020 · 6 comments
Open

Support SVGUseElement child within SVGClipPathElement? #125

dirkschulze opened this issue Dec 22, 2020 · 6 comments
Labels
question Further information is requested

Comments

@dirkschulze
Copy link
Member

SVG 1.1 allows a <use> element within a <clipPath> element as long as the reference chain ends with an SVGShapeElement.

As far as I recall, SVG Native wasn't supposed to support an SVGUseElement as child. However, the spec does not disallow it. @litherum, is this an issue in the spec or is a SVGUseElement child supported in SVG Native?

@dirkschulze dirkschulze added the question Further information is requested label Dec 27, 2020
@anthrotype
Copy link
Contributor

I would also like to know the answer to this question.

In our nanoemoji color font compiler we would like to use <use> element to reuse similar shapes within/across glyphs to reduce the file size.
However, neither Adobe apps nor Safari seem to like that:
googlefonts/nanoemoji#264 (comment)
googlefonts/nanoemoji#266 (comment)

@dirkschulze question was specifically about allowing <use> element within a <clipPath>. My question is more general, is <use> actually supported at all, not just as a child of <clipPath>?

@dirkschulze
Copy link
Member Author

@anthrotype Yes, <use> is supported in general. I can not speak for the macOS/Safari implementation but to my knowledge this is the case for Safari and its OT-SVG fonts implementation as well. I am unsure why Adobe Illustrator is not able to render your file as expected. This might be an issue in the used SVG parser or the with the SVG content itself.

@anthrotype
Copy link
Contributor

anthrotype commented Apr 13, 2021

as @litherum pointed out, we are using the unqualified href attribute whereas Safari expects the xlink:href (with appropriate xmlns declared) which the spec says it's deprecated, but apparently is still valid for SVG 1.1 content.

googlefonts/nanoemoji#266 (comment)

@moazin
Copy link
Collaborator

moazin commented May 25, 2021

@dirkschulze I would like to point out that NotoColorEmoji glyphs have a use element inside a clipPath element and it's very common. Given that it's so common, we'd like to have support for this.

@anthrotype
Copy link
Contributor

90% of the glyphs

that's a lot, where/how did you get those metrics?

@moazin
Copy link
Collaborator

moazin commented May 25, 2021

I should make a correction, it's not 90% and I don't have an exact metric. I iterated through ~3000 of those glyphs manually and almost every other glyph would not render properly due to this limitation of SNV. So it's a lot of glyphs but definitely not 90%. I confused this with another problem of SNV which I've pointed out in #154. That affected almost every glyph in NotoColor. Thanks for pointing out. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants