Skip to content

Add persistence of unicodes for glyphs between builds#230

Draft
mondeja wants to merge 6 commits intosimple-icons:developfrom
mondeja:fix-221
Draft

Add persistence of unicodes for glyphs between builds#230
mondeja wants to merge 6 commits intosimple-icons:developfrom
mondeja:fix-221

Conversation

@mondeja
Copy link
Copy Markdown
Member

@mondeja mondeja commented May 4, 2025

Resolves #221

Is not really a breaking change, as we don't have persistence now. But I prefer to push it with the next v15 major change.

@mondeja mondeja marked this pull request as draft May 4, 2025 17:26
@mondeja mondeja added the breaking change Issues or pull requests that include a breaking change and scheduled for the next major release label May 4, 2025
@mondeja mondeja added the enhancement New feature or request label May 4, 2025
@mondeja mondeja changed the title Add persistence of unicodes for glyphs Add persistence of unicodes for glyphs between builds May 4, 2025
@mondeja mondeja requested a review from LitoMore May 4, 2025 17:38
@LitoMore
Copy link
Copy Markdown
Member

LitoMore commented May 4, 2025

This might not be a good solution for persisting unicodes. Some of them used a preserved code of emoji. Here is the preview:

For example the "gofundme": 128207 (0x1f4cf) is for the 📏 emoji.

I think it's fine to keep our current solution due to the special nature of our icon library. The unicode that will be changed can be understood as a feature rather than a bug.

What do you think?

@mondeja
Copy link
Copy Markdown
Member Author

mondeja commented May 4, 2025

Good catch. I think that we must not use these reserved symbols, like the emoji ones. Not sure about what you're referring to the "special nature of the library". I'll expect that the font would behave like whatever another icons font.

I don't know how could be a feature something that breaks the usage of the font directly, even with minor version changes. You only need to remove the remove the unicode.json file and set the maximum unicode value to 59905 + 3282 (previous start plus current number of icons) to revert to the previous behaviour. The generated unicode values are not hashed to an absolute, are hashed + mapped inside a range.

I'll tweak the range to not use emojis.

@mondeja
Copy link
Copy Markdown
Member Author

mondeja commented May 4, 2025

Should be good now 👍🏼

@LitoMore
Copy link
Copy Markdown
Member

LitoMore commented May 6, 2025

I’m a bit busy these days. I will take a deeper review later this week.

@LitoMore
Copy link
Copy Markdown
Member

@mondeja Can we move it to v16? I just noticed some projects are using both simple-icons-font and simple-icons and assuming the unicode follows the index in the data JSON file.

https://github.com/jlnrrg/simple_icons/blob/8355761040946e84410314efce9622fe7daed2ac/tool/build.sh#L25-L31

https://github.com/jlnrrg/simple_icons/blob/8355761040946e84410314efce9622fe7daed2ac/lib/src/icon_data.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Issues or pull requests that include a breaking change and scheduled for the next major release enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The icon is subject to change as the version change

2 participants