Subtitle placement in IMSC - Web-related technologies 编辑
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 towhenActive
. The other allowable value isalways
, which tells the IMSC decoder to display all region boxes with the value ofalways
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 toleft
,center
, orright
.center
is the most common text justification for subtitles.tts:displayAlign
— the vertical alignment of the text. This can be set tobefore
,center
, orafter
.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论