Skip to content

Commit 824cc7f

Browse files
authored
Merge pull request #7998 from carlobeltrame/fix-combination-emoji
Fix rendering combined emoji 🧙‍♂️ in the PDF
2 parents 1527fd8 + 03fe2dc commit 824cc7f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pdf/src/CampPrint.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@ const registerFonts = async () => {
7575
})
7676
7777
Font.registerEmojiSource({
78-
formag: 'png',
79-
url: '/twemoji/assets/72x72/',
78+
withVariationSelectors: true,
79+
builder(code) {
80+
// If the code point does not contain 200d, remove any fe0f
81+
// https://github.com/twitter/twemoji/issues/419#issuecomment-637360325
82+
const filename = code.includes('200d')
83+
? code
84+
: code.replaceAll('fe0f', '').replaceAll(/--|^-|-$/g, '')
85+
return '/twemoji/assets/72x72/' + filename + '.png'
86+
},
8087
})
8188
8289
return await Promise.all([

0 commit comments

Comments
 (0)