@taole/giftstage 0.1.16 → 0.1.17

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 CHANGED
@@ -460,6 +460,34 @@ SVGA 文本配置会按目标 frame 自动适配字号,避免文字超出槽
460
460
  - `minFontSize?: number` / `maxFontSize?: number`:限制自适应字号范围。
461
461
  - `padding?: number`:文字纹理内边距,默认 `2`。
462
462
  - `scale?: number`:文字纹理栅格倍率,SVGA 默认 `3`,用于保持清晰度。
463
+ - `fontStyle?: string | { font?: string; color?: string }`:字体样式,SVGA / VAP 都支持。
464
+
465
+ `fontStyle` 可以直接传 canvas font 字符串:
466
+
467
+ ```ts
468
+ svgaSlots: {
469
+ title: {
470
+ text: 'Hello',
471
+ fontStyle: 'bold 40px Arial',
472
+ },
473
+ }
474
+ ```
475
+
476
+ 也可以传对象:
477
+
478
+ ```ts
479
+ vapSlots: {
480
+ welcome01: {
481
+ text: '欢迎进入房间',
482
+ fontStyle: {
483
+ font: 'bold 40px Arial',
484
+ color: '#ffffff',
485
+ },
486
+ },
487
+ }
488
+ ```
489
+
490
+ 对象形式目前生效字段是 `font` 和 `color`。如果同时传了外层 `color` 和 `fontStyle.color`,以 `fontStyle.color` 为准。VAP 文本如果没有传 `fontStyle`,会回退使用 VAP 配置里的 `src.fontStyle`。
463
491
 
464
492
  ### VAP / VAPX
465
493