You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Node.js 23.1.0 on Windows 11 23H2, I've tried to subset a small number of emoji from Noto Color Emoji which I've downloaded from Google Fonts. For context, I'm looking to address godotengine/godot-demo-projects#1119 without committing a 24 MB file to that repository.
Using the following script:
#!/usr/bin/env node
constfs=require('fs');constsubsetFont=require('subset-font');constinputFile='NotoColorEmoji-Regular.ttf';constoutputFile='NotoColorEmoji-Regular-subset.woff2';constsubsetText='🥳🧁🍰🎁🎂🎈🎺🎉🎊📧〽️🧿🌶️🔋😂❤️😍🤣😊🥺🙏💕😭😘👍😅👏';constmySfntFontBuffer=Buffer.from(fs.readFileSync(inputFile));(async()=>{constsubsetBuffer=awaitsubsetFont(mySfntFontBuffer,subsetText,{targetFormat: 'woff2',});fs.writeFile(outputFile,subsetBuffer,'binary',(err)=>{if(!err){console.log(`Subset written to: ${outputFile}`);}else{console.error(err);}});})();
The font generation process works, but the resulting font doesn't have working emoji, even though they are included in the font. You don't see emoji when trying to enter them using an emoji keyboard (or copy-pasting from a website listing emoji).
I've tried both WOFF2 and SFNT (.ttf) output to no avail.
Wakamai Fondue has this to say about the generated subset:
The original TTF in comparison:
Loading the original font in Godot 4.3:
Loading either of the subset fonts:
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
Subsetting emojis from an emoji font results in Unicode codepoints being shifted around
Subsetting emojis from an emoji font results in a non-working font
Oct 29, 2024
Using Node.js 23.1.0 on Windows 11 23H2, I've tried to subset a small number of emoji from Noto Color Emoji which I've downloaded from Google Fonts. For context, I'm looking to address godotengine/godot-demo-projects#1119 without committing a 24 MB file to that repository.
Using the following script:
package.json
:The font generation process works, but the resulting font doesn't have working emoji, even though they are included in the font. You don't see emoji when trying to enter them using an emoji keyboard (or copy-pasting from a website listing emoji).
I've tried both WOFF2 and SFNT (
.ttf
) output to no avail.Wakamai Fondue has this to say about the generated subset:
The original TTF in comparison:
Loading the original font in Godot 4.3:
Loading either of the subset fonts:
The text was updated successfully, but these errors were encountered: