e39e740c35b6 — Joe Ulfers 1.0.1 8 years ago
Use non-monospace font. Fixes bug #1
2 files changed, 2 insertions(+), 14 deletions(-)

M static/css/layout.css
M static/js/qwertywar.js
M static/css/layout.css +0 -9
@@ 7,15 7,6 @@ 
     src: url("../font/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf");
     font-weight: bold;
 }
-@font-face {
-    font-family: "DejaVu Sans Mono";
-    src: url("../font/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf");
-}
-@font-face {
-    font-family: "DejaVu Sans Mono";
-    src: url("../font/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf");
-    font-weight: bold;
-}
 
 * {
     font-family: "DejaVu Sans";

          
M static/js/qwertywar.js +2 -5
@@ 27,7 27,7 @@ var game = {
         return 1 - (range / (lay.movement.longSize() * 0.8))
     },
     font: {
-        size: 20 // px
+        size: 20
     },
     difficulty: {
         // Lower values make the game harder. See calculations in companion .ods file.

          
@@ 405,7 405,7 @@ var AudioContext = window.window.AudioCo
 
 var draw = (function () {
     var drawLabel = function (_, item, sprite, label) {
-        var font = game.font.size + 'px "DejaVu Sans Mono"'
+        var font = game.font.size + 'px "DejaVu Sans"' // must also use elsewhere, see bug 1
         if (!item.textRenderCache) {
             // Caching rendered text gives a small performance improvement in Firefox
             item.textRenderCache = document.createElement('canvas')

          
@@ 415,9 415,6 @@ var draw = (function () {
 
             var textContext = item.textRenderCache.getContext('2d')
             textContext.font = font
-            // black should be default, but sometimes maybe not? in ff, at least, there's a bug
-            // where every so often the first enemy text isn't visible, so set fill style to be sure
-            textContext.fillStyle = 'black'
             textContext.fillText(label, 0, game.font.size)
         }
         if (!sprite.counterRotate) {