Skip to content

Commit 4b0bfa5

Browse files
committed
[docs] Document withEmoji API
1 parent ed0d3b5 commit 4b0bfa5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎docs/content/docs/plugins/takumi.mdx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ const img2 = await ctx.takumi.renderHtml(`
7373

7474
`renderJsx` 和 `renderHtml` 都接受三个参数。第一个参数是需要渲染的内容,后两个参数分别是传递给 `Renderer` 的渲染选项和可选的 `AbortSignal`。
7575

76+
### Emoji 支持
77+
78+
`TakumiService` 还提供了 `renderJsxWithEmoji` 和 `renderHtmlWithEmoji` 方法,用于渲染包含 Emoji 的内容。这两个方法与 `renderJsx` 和 `renderHtml` 相比,在末尾多了一个 `emojiType: EmojiType` 参数,用于指定使用哪种 Emoji 风格。
79+
80+
```typescript
81+
type EmojiType =
82+
| 'twemoji'
83+
| 'blobmoji'
84+
| 'noto' // 默认值
85+
| 'openmoji'
86+
| 'fluent'
87+
| 'fluentFlat';
88+
```
89+
90+
为了保持与 Noto Sans SC 字体的风格一致,`renderJsxWithEmoji` 和 `renderHtmlWithEmoji` 默认使用 `noto` 作为 Emoji 风格。
91+
7692
## 使用字体
7793

7894
`@fraqjs/plugin-takumi` 内置了多种字体:

0 commit comments

Comments
 (0)