From 8c3a7da6196c5de401463b71396aa6e0e1f6b924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 29 Oct 2024 21:38:55 +0100 Subject: [PATCH] sub/osd/console: adjust font sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current OSD font size is excessively large, causing most messages—except for very short ones to overflow horizontally. I conducted testing across multiple devices of varying screen sizes and under different scenarios. The adjusted font size strikes a good balance for readability on non-high-DPI displays, while high-DPI displays should utilize DPI scaling as needed. Additionally, I compared the font sizes of subtitles and UI elements across various VOD platforms, which generally use smaller font in most cases. The current sub font size was significantly larger than even PGS subtitles, which are quite large on their own. Now, they are comparable. The subtitle font size was chosen based on recommendations from the BBC Subtitle Guidelines. It is set to 8% of the video height with a recommended scaling factor of 0.67. Therefore, at 720p (the reference size for mpv font scaling), the calculation is 8% * 0.67 * 720 = 38.592, rounded down to 38. This value falls within the recommended scaling range of x0.5–x1 for desktop PCs/Laptops and TVs (32"–42"). For more information, see https://www.bbc.co.uk/accessibility/forproducts/guides/subtitles/#Presentation-font-size. OSD font size is smaller than font as those elements shouldn't be distractful and only noticable when the user wants to look at them. Outline size is set to 5.5% of font size. --- DOCS/man/console.rst | 2 +- DOCS/man/options.rst | 16 ++++++++-------- player/lua/console.lua | 2 +- sub/osd.c | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/DOCS/man/console.rst b/DOCS/man/console.rst index c2a95fd7c3..f37eddfaaa 100644 --- a/DOCS/man/console.rst +++ b/DOCS/man/console.rst @@ -164,7 +164,7 @@ Configurable Options the window. ``border_size`` - Default: 1.5 + Default: 1.32 Set the font border size used for the REPL and the console. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index d32bcac9d4..563d1d01c7 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2897,7 +2897,7 @@ Subtitles height: if the window height is larger or smaller than 720, the actual size of the text increases or decreases as well. - Default: 55. + Default: 38 ``--sub-blur=<0..20.0>`` Gaussian blur factor applied to the sub font border. @@ -2925,7 +2925,7 @@ Subtitles ``--sub-border-size`` is an alias for ``--sub-outline-size``. - Default: 3. + Default: 2.09 ``--sub-border-style=`` The style of the border. @@ -2986,7 +2986,7 @@ Subtitles This option specifies the distance of the sub to the left, as well as at which distance from the right border long sub text will be broken. - Default: 25. + Default: 19 ``--sub-margin-y=`` Top and bottom screen margin for the subs in scaled pixels (see @@ -2995,7 +2995,7 @@ Subtitles This option specifies the vertical margins of unstyled text subtitles. If you just want to raise the vertical subtitle position, use ``--sub-pos``. - Default: 22. + Default: 34 ``--sub-align-x=`` Control to which corner of the screen text subtitles should be @@ -4456,7 +4456,7 @@ OSD ``--osd-font-size=`` Specify the OSD font size. See ``--sub-font-size`` for details. - Default: 55. + Default: 30 ``--osd-msg1=`` Show this string as message on OSD with OSD level 1 (visible by default). @@ -4573,7 +4573,7 @@ OSD ``--osd-border-size`` is an alias for ``--osd-outline-size``. - Default: 3. + Default: 1.65 ``--osd-border-style=`` See ``--sub-border-style``. Style used for OSD text border. @@ -4601,7 +4601,7 @@ OSD This option specifies the distance of the OSD to the left, as well as at which distance from the right border long OSD text will be broken. - Default: 25. + Default: 15 ``--osd-margin-y=`` Top and bottom screen margin for the OSD in scaled pixels (see @@ -4609,7 +4609,7 @@ OSD This option specifies the vertical margins of the OSD. - Default: 22. + Default: 15 ``--osd-align-x=`` Control to which corner of the screen OSD should be diff --git a/player/lua/console.lua b/player/lua/console.lua index 701116649c..4e2ff3e71c 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -31,7 +31,7 @@ local platform = detect_platform() local opts = { font = "", font_size = 24, - border_size = 1.5, + border_size = 1.32, scale_with_window = "auto", case_sensitive = platform ~= 'windows' and true or false, history_dedup = true, diff --git a/sub/osd.c b/sub/osd.c index 6a57574a52..25a8981e16 100644 --- a/sub/osd.c +++ b/sub/osd.c @@ -81,15 +81,15 @@ const struct m_sub_options osd_style_conf = { .size = sizeof(struct osd_style_opts), .defaults = &(const struct osd_style_opts){ .font = "sans-serif", - .font_size = 55, + .font_size = 30, .color = {255, 255, 255, 255}, .outline_color = {0, 0, 0, 255}, .back_color = {240, 240, 240, 128}, .border_style = 1, - .outline_size = 3, + .outline_size = 1.65, .shadow_offset = 0, - .margin_x = 25, - .margin_y = 22, + .margin_x = 15, + .margin_y = 15, .align_x = -1, .align_y = -1, }, @@ -101,15 +101,15 @@ const struct m_sub_options sub_style_conf = { .size = sizeof(struct osd_style_opts), .defaults = &(const struct osd_style_opts){ .font = "sans-serif", - .font_size = 55, + .font_size = 38, .color = {255, 255, 255, 255}, .outline_color = {0, 0, 0, 255}, .back_color = {240, 240, 240, 128}, .border_style = 1, - .outline_size = 3, + .outline_size = 2.09, .shadow_offset = 0, - .margin_x = 25, - .margin_y = 22, + .margin_x = 19, + .margin_y = 34, .align_x = 0, .align_y = 1, },