mpv/player/lua
Avi Halachmi (:avih) 416668d3c8 stats.lua: page 4 (keys): better alignment of non-ascii keys
Previously we assumed the key-name string occupies strlen(name) cells,
now we count codepoints instead.

This improves alignment of non-english key names. Still not perfect
because we don't know if the key name is single or double width, but
wcwidth not available to scripts, notoriously unreliable (depends on
locale, correct and updated tables, etc), and also not always
available (Windows).

Still, better than nothing, and we err by at most one cell - vs up to
three before this commit (4 bytes keyname codepoint).

In the future we could do the alignment using libass tags, however,
this both complicates the ass-output generation, and also not available
when we output for the terminal, so for now only count codepoints.

Also, if the key name was in a right-to-left language, then previously
the name/command were swapped visually. Now we inject a left-to-right
marker before the name to ensure direction. This works also when
harfbuzz is disabled for libass (--sub-ass-shaper=simple).
2021-07-31 11:00:07 +03:00
..
assdraw.lua osc: improve look of seekranges 2019-09-02 01:11:04 +03:00
auto_profiles.lua auto_profiles: fix compile_cond on lua 5.1 2020-12-08 17:29:19 +00:00
console.lua console: use wl-paste on Wayland 2020-12-14 22:43:34 +00:00
defaults.lua lua: fix timers comment (no-op) 2021-07-13 13:11:34 +03:00
options.lua lua: windows got what users crave 2020-05-27 15:01:39 +02:00
osc.lua osc: expose osc-visibility via shared-script-properties 2021-07-06 16:12:36 +03:00
stats.lua stats.lua: page 4 (keys): better alignment of non-ascii keys 2021-07-31 11:00:07 +03:00
ytdl_hook.lua ytdl_hook: improve handling of json parsing errors 2021-05-29 19:54:03 +03:00