Browse Source

Negative indentation for opening quotes.

parisminton 7 years ago
parent
commit
03d3760319
3 changed files with 12 additions and 3 deletions
  1. 1 1
      client/index.js
  2. 10 1
      renderer/text-wrapper.js
  3. 1 1
      settings/themes.json

+ 1 - 1
client/index.js View File

241
 
241
 
242
 }
242
 }
243
 
243
 
244
-function updateCaption(label) {
244
+function updateCaption() {
245
   preview.caption(this.value);
245
   preview.caption(this.value);
246
 }
246
 }
247
 
247
 

+ 10 - 1
renderer/text-wrapper.js View File

84
       // draw caption
84
       // draw caption
85
       context.fillStyle = theme.captionColor;
85
       context.fillStyle = theme.captionColor;
86
       lines.forEach(function(line, i){
86
       lines.forEach(function(line, i){
87
-        context.fillText(line.join(" "), x, y + i * (theme.captionLineHeight + theme.captionLineSpacing));
87
+
88
+        // negative indentation for opening quotes
89
+        var indented_x = (x + 28);
90
+
91
+        if (i === 0 && /^“/.test(line[0])) {
92
+          context.fillText(line.join(" "), x, y + i * (theme.captionLineHeight + theme.captionLineSpacing));
93
+        }
94
+        else {
95
+          context.fillText(line.join(" "), indented_x, y + i * (theme.captionLineHeight + theme.captionLineSpacing));
96
+        }
88
       });
97
       });
89
     } // end if caption
98
     } // end if caption
90
 
99
 

+ 1 - 1
settings/themes.json View File

18
     "labelFont": "44px 'NYT Karnak'",
18
     "labelFont": "44px 'NYT Karnak'",
19
     "labelAlign": "left",
19
     "labelAlign": "left",
20
     "labelTop": 470,
20
     "labelTop": 470,
21
-    "labelLeft": 60,
21
+    "labelLeft": 70,
22
     "labelLineHeight": 20,
22
     "labelLineHeight": 20,
23
     "labelLineSpacing": 4
23
     "labelLineSpacing": 4
24
   },
24
   },