googlefonts / nanoemoji

A wee tool to build color fonts.
Apache License 2.0
239 stars 22 forks source link

Support specifying glyphmapping as a file #445

Open matthiasclasen opened 1 year ago

matthiasclasen commented 1 year ago

I was trying to use nanoemoji to generate an icon font from a bunch of svg icons.

It would be excellent if I could control the glyph names.

The commandline options for this seem to be a bit prickly, and I could not figure out how to make it use another generator. Ideally I would like to just pass in that csv file.

rsheeter commented 1 year ago

You would use --glyphmap_generator: A program that takes a list of filenames and outputs a file csv whose rows contain filename, codepoint(s), glyph name.

We could also just let you pass in such a file, I imagine that might be nicer for your use case?

matthiasclasen commented 1 year ago

By now, I've figured out how make a generator work, so this is less important for me

DeltaRazero commented 1 year ago

We could also just let you pass in such a file, I imagine that might be nicer for your use case?

Is the --glyphmap_file parameter supposed to do that? I can't get it to work at all, following the format --glyphmap_generator outputs. I see nanoemoji instead making its own blank Font.glyphmap file.

Okay I see now that isn't supported at all. I would like to have control over the glyph index for each svg without having it in the filename. I suppose that functionality is currently not present, so this feature would be beneficial to me.