summaryrefslogtreecommitdiff
path: root/rules/rules.go
blob: 07fe58853a73762a9c2a3d7661b2d9f8f2a26297 (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
package rules

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

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
	}
	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: 2,
	},
	"trans":   {
		Left: 6,
		Width: 1.5,
	},
	"note":    {
		Left: 1.5,
		Width: 6,
	},
	"allcaps": {
		Left: 1.5,
		Width: 6,
	},
}