     1 (vec (repeat 2 (first cue-vars)))
     (vec (take 2 (drop var-offset (apply concat (repeat cue-vars)))))))
 
-(defn- fit-cue-variable-name
-  "Picks the best version of a cue variable name to fit in the specified
-  number of characters, then truncates it if necessary."
-  [v len]
-  (let [longer (or (:name v) (name (:key v)))
-        shorter (or (:short-name v) longer)
-        padding (clojure.string/join (repeat len " "))]
-    (if (<= (count longer) len)
-      (clojure.string/join (take len (str longer padding)))
-      (clojure.string/join (take len (str shorter padding))))))
-
-(defn- cue-variable-names
-  "Determines the names of adjustable variables to display under an
-  active cue."
-  [controller cue effect-id]
+(defn- best-cue-variable-name
+  "Picks the best version of a cue variable name to fit under the
+  specified number of encoders."
+  [controller v encoder-count]
+  (let [graphics (create-graphics controller)
+        space (space-for-encoder-button-label encoder-count)
+        font font-for-encoder-button-label
+        metrics (.getFontMetrics graphics font)
+        longer (or (:name v) (name (:key v)))
+        shorter (or (:short-name v) longer)]
+    (if (<= (.stringWidth metrics longer) space) longer shorter)))
+
+(defn draw-cue-variable-names
+  "Draw the names of adjustable variables under the appropriate
+  encoders for a cue."
+  [controller x cue effect-id]
   (let [cue-vars (cue-vars-for-encoders (:variables cue) (get @(:cue-var-offsets controller) effect-id 0))]
-    (if (seq cue-vars)
+    (when (seq cue-vars)
       (if (= (count (:variables cue)) 1)
-        (fit-cue-variable-name (first cue-vars) 17)
-        (str (fit-cue-variable-name (first cue-vars) 8) " "
-             (fit-cue-variable-name (second cue-vars) 8)))
-      "")))
+        (draw-encoder-button-label controller (* x 2) 2
+                                   (best-cue-variable-name controller (first cue-vars) 1) white-color)
+        (do
+          (draw-encoder-button-label controller (* x 2) 1
+                                     (best-cue-variable-name controller (first cue-vars) 1) white-color)
+          (draw-encoder-button-label controller (inc (* x 2)) 1
+                                     (best-cue-variable-name controller (second cue-vars) 1) white-color))))))
 
 (defn- fit-cue-variable-value
   "Truncates the current value of a cue variable to fit available

    (.drawString graphics label (int (math/round (- (* (+ index 0.5) button-cell-width) (/ width 2))))
                 (- Wayang/DISPLAY_HEIGHT 4))))

(defn ^:deprecated make-gauge
  "Create a graphical gauge with an indicator that fills a line.
  The default range is from zero to a hundred, and the default size is

                         arrow-pos (if (in-mode? controller :shift)
                                     (dec (.indexOf marker "." (inc (.indexOf marker "."))))
                                     (dec (count marker)))]
    #_(aset (get (:next-display controller) 2) arrow-pos 0))
  true)

(defn- adjust-beat-from-encoder
  "Adjust the current beat based on how the encoder was twisted."
