-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update generator for Unicode 12.1 #426
Conversation
This comes with some significant changes since the generated code as the structure was before could not be compiled. We now chunk the emojis into configurable lists which each get a class in the style of ActivitiesCategoryChunk0. Also, the categories have changed a bit, so these get now normalized to what we had before. Finally this fixes a bug causing low(er) image quality.
const maxY = emojiByStrip[i].map(it => it.sheet_y).reduce((a, b) => Math.max(a, b), 0); | ||
const height = (maxY + 1) * 66; | ||
const strip = await new Jimp(66, height); | ||
await strip.blit(sheet, 0, 0, i * 66, 0, 66, height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the cause of lower quality images.
const maxY = emojiByStrip[i].map(it => it.sheet_y).reduce((a, b) => Math.max(a, b), 0); | ||
const height = (maxY + 1) * 66; | ||
|
||
const strip = await sheet.clone().crop(i * 66, 0, 66, height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now simply crop.
|
||
result.set("SmileysAndPeople", smileysAndEmotion.concat(peopleAndBody)) | ||
result.delete("SmileysAndEmotion") | ||
result.delete("PeopleAndBody") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our upstream source slightly changed the categories. Here we normalize them back to what we had previously.
|
||
await fs.writeFile(`${dir}/${target.name}.java`, _(emojiTemplate).template()({ | ||
await fs.writeFile(`${valuesDir}/strings.xml`, template(stringsTemplate)({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now also generate the strings.xml
file automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
I have added the generated files and will merge once CI passes and @mario approves 🙂. |
Approved by Mario (tm) |
This PR is a bigger overhaul of the generator to support the latest changes to our data source among other things:
This comes with a significant change how we generate the categories. Due to too many icons being present now we started to run into "code too large" exceptions. I have changed the generator so that it generates "chunk" classes of 250 emojis at most and concats them together in the actual category.
Before:
Now:
As always this PR comes without the generated code to make review easier.
Would close #344 and #356.