-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Track buttons/numbers don't have enough padding with double digit track numbers #9
Comments
Ah thanks. I kinda knew the fit might be tight, but I never really tested a video with that many subs. Ended up downloading DBZA Ep 1 which has 25 different languages ( Current State:
Issue: The OSC is drawn with LibASS, which has no TextMetrics so we can't calculate the width of the rendered text. We have to guess it. Solutions:
|
With: local trackButtonSize = tethys.trackButtonSize
local trackIconWidth = trackButtonSize * (32/23.273)
local trackDigitWidth = trackButtonSize * 0.4
-- "ICON -/0"
-- "ICON 1/1"
-- "ICON 1/10"
local numTrackDigits = 1
if tracks_osc.audio ~= nil then
numTrackDigits = math.floor(math.log(#tracks_osc.sub, 10)) + 1
end
local trackButtonWidth = trackIconWidth + trackDigitWidth * (1 + numTrackDigits + 1 + numTrackDigits) With OSC scaled to 1080p, the buttons are:
The internal mpv osc units are:
Ah, I need to add a few |
Hmm, it's already using local osc_styles = {
smallButtonsLlabel = "{\\fscx105\\fscy105\\fn" .. mp.get_property("options/osd-font") .. "}",
}
--cy_sub
ne = new_element("cy_sub", "button")
ne.enabled = (#tracks_osc.sub > 0)
ne.content = function ()
local sid = "–"
if not (get_track("sub") == 0) then
sid = get_track("sub")
end
return ("\238\132\135" .. osc_styles.smallButtonsLlabel
.. " " .. sid .. "/" .. #tracks_osc.sub)
end Seems that |
The track numbers padding is insufficient when you have a double digit amount of subtitle tracks or audio tracks
The text was updated successfully, but these errors were encountered: