28 lines
1.6 KiB
Markdown
28 lines
1.6 KiB
Markdown
|
|
# Fix Burned-In Caption Styling
|
||
|
|
|
||
|
|
**Date:** 2026-09-21 23:37
|
||
|
|
**Task:** Fix ASS styling in burn-in export to be readable and match the preview better.
|
||
|
|
|
||
|
|
## Changes Made
|
||
|
|
|
||
|
|
**`src-tauri/src/services/clip_exporter.rs`** — Updated `vtt_to_ass_with_karaoke()` ASS style generation:
|
||
|
|
|
||
|
|
| ASS Field | Before (broken) | After (fixed) |
|
||
|
|
|-----------|-----------------|---------------|
|
||
|
|
| OutlineColour | `primary_colour` (white) | `&H00000000` (black) |
|
||
|
|
| SecondaryColour | Same color with alpha `&H99FFFFFF` | Distinct grey `&H99AAAAAA` |
|
||
|
|
| BorderStyle | `4` (opaque box) always | `1` (outline+shadow) when textOutline=true; `3` (box only) when false |
|
||
|
|
| Outline | 2 always (even with box) | 2 with BorderStyle=1; 0 with BorderStyle=3 |
|
||
|
|
|
||
|
|
### Why each change matters:
|
||
|
|
|
||
|
|
- **OutlineColour=black**: The preview uses `text-shadow: 1px 1px 2px rgba(0,0,0,0.9)` for readability. Setting OutlineColour to white made the outline invisible against white text and washed out the karaoke fill effect.
|
||
|
|
|
||
|
|
- **SecondaryColour=grey**: For `\kf` karaoke, libass sweeps from SecondaryColour to PrimaryColour. With both being variants of white (just different alpha), the sweep was barely visible. Using a distinct grey (`&H99AAAAAA`) makes upcoming words clearly dimmed grey, sweeping to bright white when spoken.
|
||
|
|
|
||
|
|
- **BorderStyle=1 vs 3**: `BorderStyle=4` draws an opaque background box AND renders the outline, creating a "double background" artifact. `BorderStyle=1` (outline+shadow, no box) matches the preview's outlined text look. `BorderStyle=3` (opaque box, no outline) is used when the user disables text outline, giving a clean box background.
|
||
|
|
|
||
|
|
## Build Verification
|
||
|
|
|
||
|
|
- `cargo test` — all 43 tests pass
|