satori 0.0.45 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.wasm.cjs +9 -9
- package/dist/index.wasm.cjs.map +1 -1
- package/dist/index.wasm.js +8 -8
- package/dist/index.wasm.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ Satori uses the same Flexbox [layout engine](https://yogalayout.com) as React Na
|
|
|
159
159
|
<tr><td><code>borderBottomRightRadius</code></td><td>Supported</td></tr>
|
|
160
160
|
<tr><td>Shorthand</td><td>Supported, i.e. <code>5px</code>, <code>50% / 5px</code></td></tr>
|
|
161
161
|
|
|
162
|
-
<tr><td rowspan="
|
|
162
|
+
<tr><td rowspan="11">Flex</td></tr>
|
|
163
163
|
<tr><td><code>flexDirection</code></td><td><code>column</code>, <code>row</code>, <code>row-reverse</code>, <code>column-reverse</code>, default to <code>row</code></td></tr>
|
|
164
164
|
<tr><td><code>flexWrap</code></td><td><code>wrap</code>, <code>nowrap</code>, <code>wrap-reverse</code>, default to <code>wrap</code></td></tr>
|
|
165
165
|
<tr><td><code>flexGrow</code></td><td>Supported</td></tr>
|
|
@@ -169,6 +169,7 @@ Satori uses the same Flexbox [layout engine](https://yogalayout.com) as React Na
|
|
|
169
169
|
<tr><td><code>alignContent</code></td><td>Supported</td></tr>
|
|
170
170
|
<tr><td><code>alignSelf</code></td><td>Supported</td></tr>
|
|
171
171
|
<tr><td><code>justifyContent</code></td><td>Supported</td></tr>
|
|
172
|
+
<tr><td><code>gap</code></td><td>Supported</td></tr>
|
|
172
173
|
|
|
173
174
|
<tr><td rowspan="5">Font</td></tr>
|
|
174
175
|
<tr><td><code>fontFamily</code></td><td>Supported</td></tr>
|
|
@@ -297,6 +298,20 @@ await satori(
|
|
|
297
298
|
|
|
298
299
|
The image will be resized to the current font-size (both width and height) as a square.
|
|
299
300
|
|
|
301
|
+
#### Locales
|
|
302
|
+
|
|
303
|
+
Satori supports rendering text in different locales. You can specify the supported locales via the `lang` attribute:
|
|
304
|
+
|
|
305
|
+
```jsx
|
|
306
|
+
await satori(
|
|
307
|
+
<div lang="ja-JP">骨</div>
|
|
308
|
+
)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Same characters can be rendered differently in different locales, you can specify the locale when necessary to force it to render with a specific font and locale. Check out [this example](https://og-playground.vercel.app/?share=nVLdSsMwFH6VcEC86VgdXoyweTMVpyiCA296kzWnbWaalCZ160rfwAcRH8Bn0rcwWVdQEYTdnJzz_ZyEnNNArDkChQkXz5EixNha4rRpfE4IF6aQrKbkOJG4OQ461OfnosTYCq0cF2tZ5apnMxRpZh18EoZHPbgW3Ga_sIJxLlS6Q4sNGbnQU0yKVM0t5sa3R2Wx7KlVZaxI6pl2oPLX_KQTh1-yXEj_6LlnAhLBLXOJYJLMY61MBN_VD2KLlIzGe2jJ4qe01JXiMy116bqsM2Gxc7Stj2edcmIKpohkKp1GsGKD6_sI9hQhn2-vHy_ve-HQK_9ybbPB7O4Q1-LxENfVzX-uydDtgTshAF348RqgDeymB3QchgF04wV66guOyyoFmjBpMADM9Uos6sLvk13vKtfH__FFvkQO1JYVtu0X) to learn more.
|
|
312
|
+
|
|
313
|
+
Supported locales are exported as the `Locale` enum type.
|
|
314
|
+
|
|
300
315
|
#### Dynamically Load Emojis and Fonts
|
|
301
316
|
|
|
302
317
|
Satori supports dynamically loading emoji images (grapheme pictures) and fonts. The `loadAdditionalAsset` function will be called when a text segment is rendered but missing the image or font:
|