dfxp

package
v0.0.0-...-0c9f346 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader() caps.CaptionReader

func NewWriter

func NewWriter() caps.CaptionWriter

Types

type BaseMarkup

type BaseMarkup struct {
	XMLName    xml.Name `xml:"tt"`
	TtXMLLang  string   `xml:"xml:lang,attr" default:"en"`
	TtXMLns    string   `xml:"xmlns,attr" default:"http://www.w3.org/ns/ttml"`
	TtXMLnsTTS string   `xml:"xmlns:tts,attr" default:"http://www.w3.org/ns/ttml#styling"`
	Head       Head     `xml:"head"`
	Body       Body     `xml:"body"`
}

type Body

type Body struct {
	XMLName xml.Name `xml:"body"`
	Langs   []Lang
}
type Head struct {
	Style  Style  `xml:"styling>style"`
	Layout Region `xml:"layout>region"`
}

type Lang

type Lang struct {
	XMLName xml.Name `xml:"div"`
	Lang    string   `xml:"xml:lang,attr"`
	Ps      []Paragraph
}

type Paragraph

type Paragraph struct {
	XMLName xml.Name `xml:"p"`
	Begin   string   `xml:"begin,attr"`
	End     string   `xml:"end,attr"`
	StyleID string   `xml:"style,attr"`
	Content string   `xml:",innerxml"`
	Span    *Span    `xml:",omitempty"`
}

type Region

type Region struct {
	XMLName         xml.Name `xml:"region"`
	ID              string   `xml:"xml:id,attr"`
	TTSTextAlign    string   `xml:"tts:textAlign,attr,omitempty"`
	TTSDisplayAlign string   `xml:"tts:displayAlign,attr,omitempty"`
}

type Span

type Span struct {
	XMLName xml.Name `xml:"span"`
	Text    string   `xml:",chardata"`
	Style
}

type Style

type Style struct {
	XMLName       xml.Name `xml:"style"`
	ID            string   `xml:"xml:id,attr,omitempty"`
	TTSTextAlign  string   `xml:"tts:textAlign,attr,omitempty"`
	TTSFontStyle  string   `xml:"tts:fontStyle,attr,omitempty"`
	TTSFontFamily string   `xml:"tts:fontFamily,attr,omitempty"`
	TTSFontSize   string   `xml:"tts:fontSize,attr,omitempty"`
	TTSFontWeight string   `xml:"tts:fontweight,attr,omitempty"`
	TTSColor      string   `xml:"tts:color,attr,omitempty"`
	// FIXME this is never parsed to Style
	TTSDisplayAlign string `xml:"tts:displayAlign,attr,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL