diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -3,8 +3,11 @@ local utils = require('mp.utils') local script_dir = mp.get_script_directory() local stream_prefix = mp.get_opt('iptv_menu.stream_prefix') +-- font size is in units of osd height, which is scaled to 720 +local font_size = 20 local osd = mp.create_osd_overlay('ass-events') -local osd_lines = 23 +local osd_lines = math.floor((720 / font_size) + 0.5) - 1 +local osd_padding = math.floor((720 - (osd_lines * font_size)) / 2) local key_bindings = {} local categories = {} @@ -74,7 +77,9 @@ local function update_osd() out[#out+1] = str end - osd.data = '{\\q2}' .. table.concat(out, '\\N') + -- \q2 disables line wrapping + osd.data = '{\\q2}{\\fs' .. font_size .. '}{\\pos(' .. osd_padding .. + ',' .. osd_padding .. '}' .. table.concat(out, '\\N') osd:update() end |