History

command: extend osd-overlay command with bounds reporting

This is more or less a minimal hack to make _some_ text measurement functionality available to scripts. Since libass does not support such a thing, this simply uses the bounding box of the rendered text. This is far from ideal. Problems include: - using a bitmap bounding box - additional memory waste and/or flushing caches - dependency on window size - odd small deviations with different window sizes (run osd-test.lua and resize the window after each timer update; the bounding boxes aren't adjusted in an overly useful way) - inability to query the size _after_ actual rendering But I guess it's a start. Since I'm aware that it's crap, add a threat to the manpage that this may be changed/removed again. For now, I'm interested whether anyone will have use for it in its current form, as it's an often requested feature.

wm4 committed 6 years ago

Commit 7a76b571 parent c6822b810 files · +161 −8Browse files

Showing the changes to player/lua/defaults.lua (1 of 10 files). Show all

Unified · Split

player/lua/defaults.lua+1−1
@@ -614,7 +614,7 @@ function overlay_mt.update(ov) · 613 unmodified lines
614614 cmd.name = "osd-overlay"
615615 cmd.res_x = math.floor(cmd.res_x)
616616 cmd.res_y = math.floor(cmd.res_y)
617− mp.command_native(cmd)
617+ return mp.command_native(cmd)
618618 end
619619
620620 function overlay_mt.remove(ov)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t