bskyogcard: support emoji, more languages, long starter pack names (#4668)
This commit is contained in:
parent
f6b138f709
commit
49396451ec
12 changed files with 413 additions and 163 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue