summaryrefslogtreecommitdiff
path: root/rules/rules.go
blob: c71df9d57a6db45f495d9e94718800966312e7be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package rules

type Format struct{
	Width float64
	Left float64
	Font string
	Style string
	Size float64
	Hide bool
	Align string
}

type Set map[string]Format

func (s Set) Get(action string) (f Format) {
	f, ok := s[action]
	if !ok {
		f = s["action"]
		f.Hide = true
	}
	if f.Font == "" {
		f.Font = "courier"
	}
	if f.Size == 0 {
		f.Size = 12
	}
	if f.Align == "" {
		f.Align = "L"
	}
	return f
}

var Default = Set{
	"action":  {
		Left: 1.5,
		Width: 6,
	},
	"speaker": {
		Left: 4.2,
		Width: 3.3,
	},
	"dialog":  {
		Left: 2.9,
		Width: 3.3,
	},
	"scene":   {
		Left: 1.5,
		Width: 6,
		Style: "b",
	},
	"paren":   {
		Left: 3.6,
		Width: 4,
	},
	"trans":   {
		Left: 6,
		Width: 1.5,
	},
	"note":    {
		Left: 1.5,
		Width: 6,
	},
	"allcaps": {
		Left: 1.5,
		Width: 6,
	},
	"empty": {
		Left: 1.5,
		Width: 6,
	},
	"title": {
		Left: 1.5,
		Width: 6,
		Align: "C",
	},
	"meta": {
		Left: 1.5,
		Width: 3,
	},
}