mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
## Summary Vocal Star (and other commercial producers) need CDG files in their own house style. Matt's 2025-02-20 email showed our CDG up card overflowing its bordered design. He asked for his simpler card instead: logo on top, then title, a small "MADE FAMOUS BY" line, then the artist. Two pipeline limits blocked that: - the CDG title card was hardcoded; - a theme could only have **one font** for everything. The shared `font` asset (`intro.font`) overwrites `karaoke.font_path` and `cdg.font_path` at render time. ## Changes - **Title card (cdgmaker composer):** new optional keys; all defaults reproduce today's output. - `title_separator_text` / `_color` / `_font_size`: a line between title and artist. - `title_font_size`, `artist_font_size`, `title_max_height`. - `title_block_top`: centre the block below a logo baked into the background. - It shrinks the title first, then the artist, so it can't loop forever. - **Outro:** respects `title_block_top` and shrinks long text. Before, an `assert` crashed when the text was taller than 200px. - **Fonts:** - The CDG title card and outro use the theme's main font (`cdg.title_font_path`, fed by the shared `font` asset). - A theme may keep a **distinct CDG lyrics font** via a new `cdg_font` asset. The theme service emits it only when it differs from `intro.font`, and `update_asset_paths` applies the shared font first so section overrides win. - No visible change for existing themes, which all use one font. - **Tenant theme editor:** keeps a distinct, available CDG font on save, and copies it into the theme's assets if it's bundled. - Docs: API.md. ## Testing - New `tests/unit/lyrics_transcriber/output/test_cdg_title_card.py` renders **real CDG files**, decodes the packets back into frames and checks: - the separator sits between title and artist; - text stays below `title_block_top` and inside the safe area; - the title font is applied, and a missing one falls back; - long outro text shrinks instead of crashing. - New tests for asset-mapping order, `cdg_font` emission, theme-editor font handling, and the updated mapping assertion. - Package unit tests: 2053 passed. Backend: 6056 passed (emulator tests excluded locally). - Local CodeRabbit with `--fresh`: no findings. - Rendered Vocal Star samples (short, wrapped-long and very long title/artist), decoded and visually checked against Matt's design. After deploy, the Vocal Star theme gets: a new up-card background (logo cropped from Matt's own card), separator "MADE FAMOUS BY", `title_block_top`, black border, Avenir as the main font and Oswald kept for CDG lyrics. @coderabbitai ignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Gp5fBmsmWJxgkEHb4JfhXR --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>