Subtitle Layout Design
Default Policy & Input
Successfully rendered footage defaults to entering formal post-production. The text layer takes the user-provided body text, line breaks, timeline, font, and platform as factual input; the original audio track is preserved. By default, do not extract frames to measure source brightness, texture, or contrast, do not reject based on visibility scores, and do not automatically transcribe, re-dub, or alter dialogue.
First record the actual canvas, font ID, platform, scene, and explicit parameters; the following design values are used to generate schemes, with user explicit requirements taking priority. Suggested line counts, word counts, or concurrent count limits must not be treated as default deletion thresholds.
1. Process Criteria & Font Size Derivation
Font Size = Short Side × Scene Base Ratio × Stroke Weight Correction × Platform Multiplier
Stroke Weight Correction = 1 + (2.5 − Font Stroke Weight) × 0.04
Stroke Outline Suggestion = Font Size × 0.06; for complex backgrounds, 0.08
Safe Margin Suggestion = Short Side × 0.05
| Scene | Base Ratio | Suggested Stroke Weight | Design Purpose |
|---|---|---|---|
| Title | 0.11 | 3..5 | Short-term recognition, distinct from subtitle layer |
| Subtitle | 0.048 | 0.5..3 | Continuous reading, minimal decoration |
| Danmaku | 0.04 | 2..4 | Instant recognition, lane-based layout |
| Sticker | 0.07 | 2..5 | Express personality, position in specified area |
Historical design references (subtitle short-side ratio 3.8%..7.5%, title 8.5%..16%) are not post-hoc quality gates for already rendered videos. Fixed subtitles should preferably be broken into lines first to avoid compressing character spacing; long text must be fully retained, never silently omitted.
2. Platform Position & Font Size Reference
| Platform | Aspect Ratio Reference | Subtitle Position | Title / Multiplier Suggestion |
|---|---|---|---|
| Default | 16:9 | Bottom center, margin 5% | Top center, subtitle multiplier 1.0 |
| Douyin / Kuaishou | 9:16 | Optionally lift 18% | Subtitle 1.05, Title 1.15 |
| Bilibili | 16:9 | Bottom center 6% | Top danmaku lane reserved |
| Xiaohongshu | 3:4 | Bottom 8% | Title multiplier 1.2, optional decorative text |
| WeChat Channels | 9:16 | Optionally lift 16% | Subtitle multiplier 1.10 |
| YouTube | 16:9 | Bottom or Lower-third | Subtitle multiplier 0.95..1.0 |
Platform references come from the included font_db.json layout_policy; they are not real-time platform UI guarantees. Existing account font locking takes priority, and actual PlayResX/Y use the current canvas.
3. Safe Zone & Stroke Strategy
Platform interaction bars, bottom copy, and top subscription areas are provided by the formula's occlusion_zones as design references. When planning, prioritize lifting/lowering, breaking lines, or switching sides; user-specified positions must be executed faithfully. If actual illegal coordinates, missing fonts, or rendering failures occur, stop and do not bypass by frame-sampling reviews that pass the shot as successful.
- By default, use the fixed formula's text color, stroke, and background. When dark text, light text, or semi-transparent backgrounds are needed, explicitly write them into the scheme.
- For decorative backgrounds, you may suggest "font size × 0.08" stroke or a semi-transparent black background; a restrained style may use 0.04.
- Do not automatically reject or loop rearrange based on historical diagnostic values like source brightness ≥62% or detail density ≥28%.
4. Line Breaks & Rhythm
- Vertical screen design reference: approximately 18 Chinese characters / 42 English characters per line; horizontal screen: approximately 22 Chinese characters. When exceeded, break lines completely, never truncate body text.
- Subtitles and titles can initially be designed for 2 lines; if the user has already provided multiple lines of body text, retain its content and execute according to actual line breaks and layout.
- Intro title duration can reference 1.5..4 seconds, commonly 3 seconds; the actual timeline provided takes precedence.
- Stickers can be designed with 200ms entrance and 1.5..3 second stay; do not override explicit time windows.
- For bilingual subtitles, the second language can be 12% smaller and shifted down one line; retain the original body text and timeline for each language.
- Danmaku is arranged by scrolling, top, and bottom modes. By default, retain all incoming entries; only enforce max_chars / max_concurrent constraints when explicitly set, and report processing accordingly. Do not default to 20 characters / 8 entry pruning.
5. Parameter Boundaries
- Font size, canvas, and time must be valid finite values. Cue start must not be negative, and end must be later than start.
- Fonts must actually exist and have a current use license; silent fallback to system fonts is prohibited.
- It is forbidden to overwrite source footage, delete user body text, re-transcribe based on audio quality, or supplement with TTS.
- Actual rendering failures must be explicitly reported. If no frame comparison is performed, presence.reviewed=false; if delta/ok is not measured, set to null.
6. SOP & Evidence
- Trigger: User requests text track. Read actual canvas, cues, fonts, and platform. Receipt: Input SHA-256, cue count, original text and timeline. Failure: Stop if no timeline, empty body, illegal paths, or missing permissions.
- Trigger: Layout parameters are complete. Run subtitlewrite.plan to generate ASS, using actual line breaks and PlayRes. Receipt: ASS file, font ID, font size, margins, and actual entry count. Failure: Report scheme generation errors as-is; do not delete entries to ensure success.
- Trigger: Explicit request to burn-in or softmux. Execute the target operation once. Receipt: fontselect, output hash, audio track preserved, and actual canvas. Failure: Stop delivery if tool exits non-zero, font fallback occurs, or artifacts are missing; leave source footage untouched.
7. Failure Modes (Cause → Disposition)
| Symptom | Cause / Detector | Disposition |
|---|---|---|
| Font size differs from plan | PlayRes mismatches actual canvas or font multiplier | Correct the request scheme, save a version; do not regenerate the shot |
| Characters appear as boxes | Font does not contain the character or font parsing failed | Identify missing characters and font, re-execute after selecting a licensed font |
| Missing multi-line body text or words | ASS conversion, line break, or expired default length rules | Retain complete words and original cues, fix the conversion; do not bypass by shortening dialogue. Note: current SRT Chinese punctuation cleanup is an explicit formatting rule; numbers and English punctuation are kept |
| Fewer danmaku entries than requested | Implicit density threshold or explicit constraint handling left no trace | By default, retain all; when explicit constraints are present, record each entry's processing and count |
| User wants a different position | Subjective feedback | Return via text layer rework, output new scheme and receipt |
| Burn-in tool fails | Path escaping, filter, or encoder error | Report the original error; do not claim subtitle completion |