jellyfin / jellyfin-web

Web Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.41k stars 1.28k forks source link

Inconsistent size of subtitles #558

Open purcell opened 5 years ago

purcell commented 5 years ago

Describe the bug

When choosing "extra large" subtitles, the subtitles are not actually large when viewed in full screen, and do not scale with the overall viewport.

To Reproduce

Expected behavior

I would expect the large subtitles to be relatively large, so that when a player window is made bigger for convenient viewing at a distance, the subtitles are correspondingly larger.

Context/notes

The corresponding HTML is the following:

<div class="videoSubtitles">
  <div class="videoSubtitlesInner" style="font-size: 2.2em; text-shadow: rgb(0, 0, 0) 0px 0px 7px; background-color: transparent; color: rgb(255, 255, 255); font-family: inherit; font-variant: none;">
    <font size="36">A VERY SECRET SERVICE</font>
  </div>
</div>

There are 2 impediments here to correct scaling. Firstly, the <font> element wrapper appears to defeat the font style of the wrapper element, which is clearly designed to cascade onto the sub text itself.

Secondly, the videoSubtitlesInner element specifies a font size that is effectively fixed in height, since the default font size for the page is fixed, and not relative to the viewport height.

The suggested fix would be as follows:

I did the above in the browser dev tools and got a good result by effectively adding the style rule

.videoSubtitles { font-size: 4vh; }

(As a more general suggestion, since Jellyfin offers an "in-browser player app" experience it might make sense to set the font size for the entire UI in vh units. That's beyond the scope of this bug report, though!)

System:

Hope that helps, and many thanks for Jellyfin!

stale[bot] commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

JustAMan commented 4 years ago

shoo bot also cc @redSpoutnik as one of subs contributors

redSpoutnik commented 4 years ago

The font-sizes of subtitles are defined here:

https://github.com/jellyfin/jellyfin-web/blob/9dbf4b63d6760551c51426dd632a3ada6fdedaab/src/components/subtitlesettings/subtitleappearancehelper.js#L8-L53

We could use a font-size relative to the window but how to choose the values for textSizes? This might look very different depending on the screen you use (in my understanding, the em unit avoid the problem).

Besides, I am not sure vh is the best unit to use: for very large screens it will result in smaller subtitles, I think vw could be better.

purcell commented 4 years ago

Besides, I am not sure vh is the best unit to use: for very large screens it will result in smaller subtitles, I think vw could be better.

Isn't vh the ideal unit for subtitles? Screens of the same height often vary in width due to different aspect ratios, but the relative height of the text compared to the height of the image is presumably what determines legibility. Maybe I'm missing something though!

stale[bot] commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

purcell commented 4 years ago

Mark the issue as fresh by adding a comment or commit.

Still fresh IMO.

ghost commented 4 years ago

Considering the fact that the subtitles size is not saved after being updated in the user preferences and the default subtitles size is so small, this issue is really boring. A font size relative to the screen size is a good solution.

dmitrylyzo commented 4 years ago

Considering the fact that the subtitles size is not saved after being updated in the user preferences

Looks like now you have to explicitly save settings after #1541 At current moment, there is an issue with warning about unsaved changes - it pops up only on view destroying, but should pop up on Back.

ghost commented 4 years ago

Thx, I looked for opened issue and didn't find this one.

Anyway, I made a quick TamperMonkey script here to set the subtitles size to 6vh (overrides the size set in the user preferences, you just need to update the @Include). It seems to be sufficient for me but I haven't spend much time testing. I will try to get the necessary time for a pull request with proper values and testing...

purcell commented 4 years ago

I made a quick TamperMonkey script here

Similarly, I have UserStyles rules that override the size to what I consider a comfortably large size:

.videoSubtitles {
    font-size: 4vh !important;
}
.videoSubtitles font {
    font-size: inherit !important;
}

I'd have submitted a PR myself if I could see where the <font> elements are getting produced. IIRC I had the impression that the HTML looked different for different sub formats, but I might have been mistaken.

Obviously in any decent PR there should be no need for !important. 😄

stale[bot] commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

purcell commented 4 years ago

This is still broken despite the bot closing it.

helamonster commented 3 years ago

Maybe I'm missing something.... my subtitles are being displayed too small and I don't see anywhere to "choose 'extra large' subtitles." Is there a way to select the size, if so, where? I'm running the docker version linuxserver/jellyfin:version-10.6.4-1

dmitrylyzo commented 3 years ago

Is there a way to select the size, if so, where?

It depends on type of subtitles. For SRT, it is here: s1 s2

stale[bot] commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

purcell commented 3 years ago

Mark the issue as fresh by adding a comment or commit.

This issue is still fresh afaik.

vhladiienko commented 3 years ago

Indeed, this is the only reason I prefer mounting a network drive and opening the media files locally instead of using Jellyfin - the subtitles are simply too small to read from 2m away. Having full control over how subtitles look is crucial for me as English is not my native language and I have them enabled 100% of the time.

stale[bot] commented 3 years ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

cospin commented 1 year ago

Hey @thornbill could you please review #4767 ? Right now, it's almost impossible to see subtitles on 2K or 4K monitors, so having this merged would be fantastic.

thornbill commented 1 year ago

I'll review it when I get a chance. At first glance I don't love using JS for the scaling, but don't know a better solution offhand.

MrPenguin07 commented 7 months ago

I can hardly believe this is still an issue.

"Extra large" subtitles are actually rather small even on my 2k monitor.

Despite an overwhelming agreeance this is an issue, coming up on 5 years since this issue created. Please merge #4767