Hi,
I'm working with Kateryna. I would like to give purpose of this feature. We are developing some sort of UI framework and we are having icon font included in it.
On our website, we are having page, where user can select glyph and see all data of it. Also user can generate css with glyph classes in his own conventions
As example developer set up convention in which he want to get resulting css:
.__icon-[name]:before,
.__icon-left-[name]:before,
.__icon-right-[name]:after {
content: "\[unicode]";
}
name and unicode got replaced from icon name and unicode of glyph.
Iconmoon app has no ability to set up few class names per one icon, so we are using javascript parser opentype.js to do this when page loads, here is an example of this script:
http://bluejamesbond.github.io/CharacterMap/
and link to plugin
http://nodebox.github.io/opentype.js/
As you can see on CharacterMap page icon name is "undefined".
In our case, we fill it with value and parse it to get "name" value to generate css.
In svg this attribute looks like this:
<glyph glyph-name="arrow_left" unicode="" d="M486 825l-486 -484l486 -483l145 144l-227 236h620v206h-631l238 237l-145 144v0z" />
glyph-name is included in glyph specification here, so its not something new we are inventing
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyph
The purpose of having this attribute is to minify actions required when icon font get updated, we simply replace one font with another, and class names automatically got generated from ttf
So our suggest of improvement is to:
1) add glyph-name as an attribute to font files, so it can be used by opentype.js or other parser to get glyph name attribute. It can be optional if you worries about font file size.
2) extend logic for creating css in preferences from only setting up "class prefix" and "class postfix" to something like this:
.__icon-[name]:before,
.__icon-left-[name]:before,
.__icon-right-[name]:after {
content: "\[unicode]";
}
which gives more flexability