opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Support searching or filtering by glyph name

Open ahaoboy opened this issue 1 year ago • 4 comments
trafficstars

You can quickly find the desired glyph within a font by searching or filtering through its glyph names.

[...font.glyphs].filter(i=>i.name.includes('close')).map(i=>i.index)

ahaoboy avatar Dec 25 '23 04:12 ahaoboy

So what is the issue or question? Do you want a wrapper function for comfortability?

Connum avatar Dec 25 '23 11:12 Connum

So what is the issue or question? Do you want a wrapper function for comfortability?

Something like this image

ahaoboy avatar Dec 25 '23 14:12 ahaoboy

Oh, so you're talking about the glyph inspector demo page. Sure, that shouldn't be too hard to implement

Connum avatar Dec 25 '23 14:12 Connum

This is a demo build by https://github.com/ahaoboy/opentype.js/tree/search, I'm not sure if there are any issues with this implementation, but this is the simplest way I can think of, and it seems to work fine.

https://opentype-js.vercel.app/docs/glyph-inspector.html image

ahaoboy avatar Dec 26 '23 02:12 ahaoboy