Open LagradOst opened 1 month ago
Thanks - I think my comment here about the 'right' way to implement a fully custom outline (by adding it to Cue
) probably still stands (i.e. your 3) suggestion): https://github.com/google/ExoPlayer/issues/10507#issuecomment-1215155994
We don't have plans to do this soon, but would consider a high quality PR implementing this (including rendering support in both CanvasSubtitleOutput
and WebViewSubtitleOutput
).
2. Change this to Sp. Why is it even in Dp to begin with? The android docs specifically calls Sp when text is involved. https://developer.android.com/training/multiscreen/screendensities
This is interesting - looking at the blame layer, it's been this way for a long time. Since this code was first published to GitHub in 2017, but internally I can see this line was added in the very first version of the SubtitleView
file in 2014. So it's not something we've deliberately decided to do recently.
However, the link you posted doesn't seem to explicitly say that "text related styling" should use sp, just text size itself (which isn't quite what we're discussing here):
When defining text sizes, you can instead use scalable pixels (sp) as your units. The sp unit is the same size as a dp, by default, but it resizes based on the user's preferred text size. Never use sp for layout sizes.
Use case description
Subtitle edge (text outline) is an important part of accessibility to make text readable. However the current implementation hardcodes this to twoDpInPx and on some devices like some TV screens, this might be very small and make text unreadable. There is currently no API surface nor internal method accessible via reflection to change the subtitle outline width.
Proposed solutions/Alternatives considered
Note, this is a resubmission of https://github.com/google/ExoPlayer/issues/10507 but exoplayer has been marked as deprecated.