iina / iina

The modern video player for macOS.
https://iina.io
GNU General Public License v3.0
38.43k stars 2.58k forks source link

Move subtitle upward when bottom OSC appears. #855

Open oscar-c opened 7 years ago

oscar-c commented 7 years ago

System and IINA version:

Context: Context Screen Shot

Expected behavior: Subtitles are moved upward when "Bottom" style OSC is displayed. Moved up Note that this should only affect the subtitle that will be affected by OSC.

Actual behavior: When OSC appears, it would potentially block the subtitle. Blocked

oscar-c commented 7 years ago

Similarly, move subtitle downward when top OSC appears.

lhc70000 commented 7 years ago

You can set the vertical position manually in Preference.

oscar-c commented 7 years ago

Thanks for the reply. That's exactly how I made the screen shot. I think it would be nice if IINA can automatically move it up a little bit for me, whenever bottom OSC appears. Besides, some bottom subtitles are already high up in terms of its position to the video. Given that vertical position is global, these "high up" subtitles would be moved further upward (I haven't tested this yet). Therefore this workaround seems a bit sub-optimal.

lhc70000 commented 7 years ago

If the subtitle is pure text like SRT, it's not possible to get the baseline of the current font; if the subtitle file is a styled one like ASS, it generally a bad idea to adjust sutitle's position since its position is designated in the file (i.e., those already "high up" subtitles).

I think it's an interesting idea, but we may need more discussion.

ghost commented 7 years ago

If the subtitle is pure text like SRT, it's not possible to get the baseline of the current font

Movist does what @oscar-c is proposing, just for reference.

Can't the Position > Margin > Y be relative to the window bottom, if the OSD is hidden, and relative to the OSD top, if the OSD is showing?

Can't we just calculate OSD height + Y Margin and re-render the subtitle when the OSD shows up (although this might be easier said than done)?