fix(app): the subtitle preview is drawn in the chosen font

The preview drew every font in the app's own Inter, so picking one changed
nothing on screen. On Linux it now asks fontconfig for the face libass would
use — the family with the weight and slant wanted, or fontconfig's fallback
when it is not installed — loads it on a thread of its own and draws the
sample in it. A bold or italic the face lacks is made up, as libass does.
Windows and macOS have no fc-match and keep the app's font, as the hint there
still says.

The CJK fallback and the subtitle face are now both kept, so installing one
no longer drops the other.
This commit is contained in:
nvrl committed 2026-10-27 23:08:43 +01:00
1 parent ffd6e959bb
commit 648c35e92a
5 files changed
+255 -27

No files matched your search

+3
View File
@@ -108,6 +108,9 @@ pub struct SubtitleStyle {
}
impl SubtitleStyle {
/// The family a style with no font of its own is set in: mpv's default,
/// which fontconfig resolves to the system's sans-serif face.
pub const DEFAULT_FONT: &str = "sans-serif";
pub const MIN_SCALE: f64 = 0.5;
pub const MAX_SCALE: f64 = 2.5;
pub const MAX_OUTLINE: f64 = 10.0;