feat: subtitle size, face and placement, set from the player
One fixed size cannot suit everyone — the default was too big, then too small. The subtitle menu in the transport bar now carries an Appearance section: Size (S/M/L/XL), Font (Sans/Serif/Mono) and Place (Bottom/Raised/Top). Choices apply at once and are remembered across videos and launches, like every other preference. Size and face are written into a style element rather than the stylesheet: ::cue takes no custom properties, so the values have to be literal. Placement is not a CSS property at all — WebVTT carries position on the cue — so it is rewritten into the cues themselves and the track re-cut. Every source is text now, including the sidecars beside older downloads, so all three can be placed the same way. The default lands at 85%, between WebKit's own size and the 58% that replaced it. Re-cutting a track exposed a bug in the guard that applies the subtitle preference: it keyed on how many text tracks there were, and re-cutting one leaves that unchanged, so the fresh track would have stayed disabled and the subtitles would have vanished on any change of Place. It keys on the tracks themselves.
This commit is contained in:
@@ -1366,7 +1366,10 @@ pub async fn list_subtitles(
|
||||
.next()
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
out.push((lang, path.to_string_lossy().to_string()));
|
||||
let Ok(text) = tokio::fs::read_to_string(&path).await else {
|
||||
continue;
|
||||
};
|
||||
out.push((lang, tidy_vtt(&text)));
|
||||
}
|
||||
out.sort();
|
||||
Ok(out)
|
||||
|
||||
Reference in New Issue
Block a user