Templarian / MaterialDesign-Font

Distribution Repo for the TTF font
https://materialdesignicons.com/
Other
148 stars 8 forks source link

Does this font support name ligatures, showing as icons? #1

Closed okyr-ux closed 3 years ago

okyr-ux commented 4 years ago

I use Figma on macOS, I've installed the font, it works if I insert the Unicode character. But if I insert the name string, like "ab-testing", it doesn't show an icon instead. I assume it should work like that, but maybe it's not supposed to.

Templarian commented 4 years ago

@okyr-ux We would need to add it to our build script.

https://github.com/nfroidure/svgicons2svgfont Looks like the package supports it.

JohnnyWestlake commented 4 years ago

I would say it's not supposed too, AFAIK OTF/TTF files can't store names for glyphs inside the fonts, glyphs can only be referenced by id and codepoint. So Figma would have to manually create a codepoint -> icon name mapping for this font.

(I've done this for software I've worked on, but would be more reliable if the version number propagated to the final TTF file's version tag).

Templarian commented 4 years ago

@JohnnyWestlake Nah, we can use the built in ligature support I believe to make this work. I'm working out the code right now for this. Hopefully have a proof of concept done that we can roll out into production shortly.

Templarian commented 4 years ago

Running into an issue. Putting more than 2209 ligatures into the TTF breaks and we have 5k icons, so not sure we can make this work. Will have to do some more research.

https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6lcar.html

mririgoyen commented 4 years ago

We have determined that we cannot support ligatures based on the number of icons in the library.

Templarian commented 3 years ago

Going to close this out as this seems to be a limitation in the ligature table. To get around it we would need to breakup the font as there are too many characters.

Going to close this one.