diff options
author | Joop Kiefte <ikojba@gmail.com> | 2018-12-31 17:53:02 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2018-12-31 17:53:02 +0100 |
commit | 20be238175eecc5e68b74d0e98e5ec428610a904 (patch) | |
tree | 6332fbaa903275990a87aacd57dd31161e3b00e6 /rules | |
parent | 22fab0a8bc6ae7f468c91ed2835a55226270afad (diff) |
Beginning of the new structure under the Lexington name
Diffstat (limited to 'rules')
-rw-r--r-- | rules/rules.go | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/rules/rules.go b/rules/rules.go new file mode 100644 index 0000000..07fe588 --- /dev/null +++ b/rules/rules.go @@ -0,0 +1,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, + }, +} |