Translate image dashes to underscore or otherwise filter out

What do you want to achieve?

I would like to have a stable, sensible name for image constants when exporting images that contain a dash character. Currently I get image constants named by some sort of number like this:

LV_IMG_DECLARE(ui_img_1993764591); // assets/Flags/FlagSH-HL.png

But I would really prefer one like this:

LV_IMG_DECLARE(ui_img_flags_flagsh_hl_png); // assets/Flags/FlagSH-HL.png

Or even this would be ok:

LV_IMG_DECLARE(ui_img_flags_flagshhl_png); // assets/Flags/FlagSH-HL.png

One thing to consider is what happens if two images are loaded with different names but would conflict after character escaping. Would be nice to get a warning.

Do you see alternative options and workaround to achieve it?

I could pre-process my images before loading into squareline, but these are from an image pack, so Iā€™d prefer not to need to.

Mention some use cases

Importing existing assets containing dashes.

No rush: forgot I was already rendering our flags with a python script, so I was able to replace ā€˜-ā€™ with ā€˜_ā€™ during the rendering export.

1 Like