erikflowers / weather-icons

215 Weather Themed Icons and CSS
https://github.com/erikflowers/weather-icons
6.95k stars 855 forks source link

add glyph-name attributes to svg-font glyph tags #227

Open AlexxBoo opened 4 years ago

AlexxBoo commented 4 years ago

Hi there, It would be really great, if the svg font (\font\weathericons-regular-webfont.svg) could be generated with included glyph-name attributes (see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/glyph-name). There are applications that implement icon selection solely with the svg font and their respective attributes. Would this be possible?

fox91 commented 4 years ago

Hi @AlexxBoo, following the link you posted there is this disclaimer in the very first part of the page:

Deprecated since SVG 2 This feature is no longer recommended...

so it appears that in browsers this is no longer supported.

Can you give some examples of applications that allow its use (and in which there are no other methods, perhaps supported, usable)?

AlexxBoo commented 4 years ago

Hi @fox91,

Thanks for pointing that out. I'm aware of the deprecated warning for the glyph-name attribute. But the <glyph> tag itself, that is used for the SVG font elements, is deprecated as well. However, the warning is for SVG version 2 and up, and this project declares v1.1 for the SVG font, for which the usage of the attribute seems perfectly fine.

I stumbled upon the issue while trying to add custom icons to my HomeAssistant installation. The respective plugin relies on the glyph-name attributes in the SVG font to identify the icons by name. Also e.g. the Fontello service produces web-fonts containing SVG versions with this attribute.

Only when at one time upgrading the SVG font to a newer version, finding an alternative for the <glyph> tag (and the glyp-name attribute respectively) would need concideration. Attempts seem to go towards WOFF anyway.