Explorar el Código

Negative indentation for opening quotes.

parisminton hace 7 años
padre
commit
03d3760319
Se han modificado 3 ficheros con 12 adiciones y 3 borrados
  1. 1 1
      client/index.js
  2. 10 1
      renderer/text-wrapper.js
  3. 1 1
      settings/themes.json

+ 1 - 1
client/index.js Ver fichero

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

+ 10 - 1
renderer/text-wrapper.js Ver fichero

@@ -84,7 +84,16 @@ module.exports = function(theme) {
84 84
       // draw caption
85 85
       context.fillStyle = theme.captionColor;
86 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 98
     } // end if caption
90 99
 

+ 1 - 1
settings/themes.json Ver fichero

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