Discussion:
SVG icon inclusion support
Zlobin Nikita
2014-01-26 18:40:54 UTC
Permalink
Hello.
For introduction: appart to include other svg files by file name, there could
be ability specially for icon files to refer to other icons, just like desktop
launchers do it.

Some known icons contain elements, which itself may be found as icons -
various arrows, dots, analog clock, etc. And now i would like to just refer to
some generic download icon (some generic download manager like kget, gwget,
etc), instead of to manually copy icon's contents. With such approach icons
for more special applications could better follow to system icon theme.

Ideally in this case icon theme could contain special category, called like
"library", "elements", "atoms"... specially and sometimes only for inclusion
(though mentioned above arrows and analog clock could be icons itself, and
even more - analog clock could include arrows, border, etc... :).

And about mentioned example with download manager: i'm doing gui for youtube-
dl (youtube-dl-applet on kde-apps), and i would like to combine download
manager icon with some video-related icon.

And since referenced icon is not mandatory to exist (for not installed
application), there could be order of fallbacks, always ending with embedded
svg content for last resort.

Some svg editors, e.g. inkscape, allow to edit svg content directly in text
format. I guess, icon references could be implemented by some special tag
(could be compared with doxygen and gtkdoc comments, treated only by doc
generation utils).

Did not learn honestly, is it possible in svg, but hope, someone else knowes.
If not possible, probably it makes sence to push such proposal for svg format.

(or svg supposes ability to ignore unknown xml tags, used by more specialized
stuff - again, just my guessment)
Krzysztof Kosiński
2014-01-26 19:00:09 UTC
Permalink
Post by Zlobin Nikita
Some svg editors, e.g. inkscape, allow to edit svg content directly in text
format. I guess, icon references could be implemented by some special tag
(could be compared with doxygen and gtkdoc comments, treated only by doc
generation utils).
Did not learn honestly, is it possible in svg, but hope, someone else knowes.
If not possible, probably it makes sence to push such proposal for svg format.
If I understand that right, you could do this by using the svg:use tag
(known as a "clone" in Inkscape) to refer to an element in an external
document. However, there would be no fallback mechanism as there is
with icons.

http://www.w3.org/TR/SVG11/struct.html#UseElement

Regards, Krzysztof
Zlobin Nikita
2014-01-26 19:21:35 UTC
Permalink
Post by Krzysztof Kosiński
If I understand that right, you could do this by using the svg:use tag
(known as a "clone" in Inkscape) to refer to an element in an external
document. However, there would be no fallback mechanism as there is
with icons.
http://www.w3.org/TR/SVG11/struct.html#UseElement
Regards, Krzysztof
Thanks for link. I meaned implementation scheme, comparable with code
documentation system. I.e., when special code is written to svg property,
supposed only for humans (properties metadata, desc).

I expect metadata to be best util for that:
http://www.w3.org/TR/SVG11/metadata.html#MetadataElement

These metadata should be for element, rendered as is only as last resort, and
if possible - replaced by inclusion of file for referenced icon.

Another case: icon-related stuff (i mean code) could parse svg "code" for
special tags and insert inclusions and other necessary stuff before to pass it
to svg rendering code.

In this case special tags may be implemented as some extension for svg, but
in this case i don't know, will pure svg parsers smartly skip such unknown
elements or fail on them.
Zlobin Nikita
2014-01-26 19:26:57 UTC
Permalink
Making it more clear - i propose to standartize it so, that there could be
single way for all software and toolkits, what is essentially important for
icon theme authors.

Loading...