From 20be238175eecc5e68b74d0e98e5ec428610a904 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Mon, 31 Dec 2018 17:53:02 +0100 Subject: Beginning of the new structure under the Lexington name --- rules/rules.go | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 rules/rules.go (limited to 'rules') 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, + }, +} -- cgit v1.2.3-70-g09d2