Skip to content

WebView-based subtitle styling doesn't render EDGE_TYPE_OUTLINE correctly #10137

@icbaker

Description

@icbaker

Copying from #2194 (comment):

If I use the webview by subView.setViewType(SubtitleView.VIEW_TYPE_WEB) , the Arabic comma appears at the correct place. But in this mode, the subtitle's style is unruly. For example, CaptionStyleCompat.EDGE_TYPE_OUTLINE the outline is oddly,

I can reproduce this in 2.17.1 (screenshots below), using the "TTML positioning" sample and the following patch to the demo app in PlayerActivity#onCreate:

    playerView.getSubtitleView().setViewType(SubtitleView.VIEW_TYPE_WEB);
    playerView.getSubtitleView().setStyle(new CaptionStyleCompat(
        /* foregroundColor= */ Color.RED,
        /* backgroundColor= */ Color.GREEN,
        /* windowColor= */ Color.CYAN,
        CaptionStyleCompat.EDGE_TYPE_OUTLINE,
        /* edgeColor= */ Color.BLACK,
        /* typeface= */ null
    ));
Outline screenshots

Canvas

Canvas with outline


WebView

WebView with outline

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions