bskyogcard: support emoji, more languages, long starter pack names (#4668)

This commit is contained in:
devin ivy 2024-06-27 13:02:29 -04:00 committed by GitHub
parent f6b138f709
commit 49396451ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 413 additions and 163 deletions

View file

@ -13,6 +13,7 @@ import {
} from '../components/StarterPack.js'
import {AppContext} from '../context.js'
import {httpLogger} from '../logger.js'
import {loadEmojiAsSvg} from '../util.js'
import {handler, originVerifyMiddleware} from './util.js'
export default function (ctx: AppContext, app: Express) {
@ -65,6 +66,11 @@ export default function (ctx: AppContext, app: Express) {
fonts: ctx.fonts,
height: STARTERPACK_HEIGHT,
width: STARTERPACK_WIDTH,
loadAdditionalAsset: async (code, text) => {
if (code === 'emoji') {
return await loadEmojiAsSvg(text)
}
},
},
)
const output = await resvg.renderAsync(svg)