Skip to content

fix: 修复歌词图片导出未沿用字体配置的问题 - #408

Merged
imsyy merged 1 commit into
SPlayer-Dev:devfrom
d4yt1m3:codex/fix-lyric-poster-font
Oct 24, 2026
Merged

imsyy merged 1 commit into
SPlayer-Dev:devfrom
d4yt1m3:codex/fix-lyric-poster-font

Conversation

@d4yt1m3

@d4yt1m3 d4yt1m3 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

改动类型

  • 缺陷修复(fix)

是否包含破坏性变更

  • 否

改动说明

歌词图片原先通过 Canvas 使用固定系统字体绘制,即使已配置全局字体或歌词字体,导出图片仍不会采用这些设置。

现在将现有字体配置和歌词语言传入海报生成函数,按「分语言歌词字体 → 歌词字体 → 全局字体 → 系统字体」选择字体;歌名、歌手和水印使用全局字体。翻译和音译根据文本语言选择字体,等待字体加载完成后再测量和绘制,确保换行计算与实际输出使用一致的字体。

沿用现有设置,不新增导出选项。新增回归测试覆盖字体继承、分语言字体、修改字体后的长句换行,以及加载完成前不测量或绘制。

关联 Issue

无

测试情况

  • Node 与 Web 双目标类型检查通过
  • 全仓库 ESLint:0 错误,2 条既有警告位于未修改的 src/settings/categories/player.spec.ts
  • 全部改动文件通过 Prettier 检查
  • Node 测试:50 项通过
  • Vitest:63 个文件、486 项测试通过,包含本次新增的 4 项回归测试
  • macOS 手动导出验证通过,修改前后对比已确认所配置的歌词字体生效

自查清单

  • 本 PR 只包含一个字体导出修复,没有夹带无关改动
  • 已检查代码并完成自动化测试,贡献者已手动验证导出效果
  • 已格式化全部改动文件,类型检查与 ESLint 通过
  • 未修改原生模块或手写原生类型声明
  • 已向 dev 分支提交

Copilot AI balanced review requested due to automatic review settings October 22, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@d4yt1m3

d4yt1m3 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

歌词字体使用霞鹜文楷作为前后对比
街道 - 林俊杰 - 歌词分享
街道 - 林俊杰 - 歌词分享 (2)

@imsyy
imsyy merged commit e2461e5 into SPlayer-Dev:dev Oct 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants