Subtitle placement in IMSC - Web-related technologies 编辑

IMSC allows for very explicit positioning of the text over the video content you are displaying it against. There are a few tricks and best practices that can be used in order to simplify the placement of the on-screen text.

Considering correct text placement

Creating an IMSC document that has the proper text placement and flow is one of the most crucial things to get correct. Unlike some other subtitle formats, IMSC allows for very explicit placement of the text anywhere on the screen. With that said, the most common subtitle styles used today are bottom centered and top centered on the screen.

The <region> element

The <region> element essentially creates a box on the screen for the text to appear inside. The on-screen text will never be displayed outside of this box. In addition to describing the size and position of the box in which the text can appear, the <region> element also defines the horizontal and vertical alignment of the text.

In the example below, we have defined two regions. Both region boxes are the same size, which is 80% of the image width and 80% of the image height. This box is centered on the screen.

The important items to consider here are:

  • tts:origin — the upper left corner of the region box, specified as X Y coordinate values. This should be described in percentage values.
  • tts:extent — describes how far to the right of the video the region box goes, then how far down.
  • tts:backgroundColor — describes the color of the region box. This will most commonly be transparent, however you are welcome to fill it in with a color if that works for your design.
  • tts:showBackground — should be set to whenActive. The other allowable value is always, which tells the IMSC decoder to display all region boxes with the value of always at the same time. This is very unlikely to be something you want to do.
  • tts:textAlign — the horizontal text justification. Like a word processor, this can be set to left, center, or right. center is the most common text justification for subtitles.
  • tts:displayAlign — the vertical alignment of the text. This can be set to before, center, or after. before means that the text will start from the very top of the region box, and flow downwards. center means the text will be vertically centered within the region box. After means that the text will start from the very bottom of the region box, and flow upwards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:56 次

字数:3220

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文