     (.drawString graphics label
                  (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 40)))
 
+(defn draw-attributed-variable-value
+  "Draw a label under an encoder at the top of the graphical display,
+  with an attributed string so the label can have mixed fonts, colors,
+  etc. Assumes the value will fit in the allocated space."
+  [controller index encoder-count attributed-string color]
+  (let [graphics (create-graphics controller)
+        space (space-for-encoder-button-label encoder-count)
+        context (.getFontRenderContext graphics)
+        iterator (.getIterator attributed-string)
+        measurer (java.awt.font.LineBreakMeasurer. iterator context)
+        layout (.nextLayout measurer Integer/MAX_VALUE)
+        width (.getWidth (.getBounds layout))]
+    ;; Establish a default color for characters that don't change it
+    (set-graphics-color graphics color)
+    (.drawString graphics iterator
+                 (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 40)))
+
 (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

  "The font used when drawing cue variable values."
  (get-display-font :condensed-light Font/PLAIN 22))

(defn draw-cue-variable-value
  "Draw a label under an encoder at the top of the graphical display."
  [controller index encoder-count text color]

        marker 0
        leader (take (int (/ scaled 2)) (repeat 0))]
    (take width (concat leader [marker] (repeat 0)))))

(defn draw-gauge
  "Draw a graphical gauge with an indicator that fills an arc under a
  variable value. The default range is from zero to a hundred, and the
  default color for both the track and active area is dim white."
  [controller index encoder-count value & {:keys [lowest highest track-color active-color]
                                           :or {lowest 0 highest 100
                                                track-color dim-white-color active-color track-color}}]
  (let [graphics (create-graphics controller)
        range (- highest lowest)
        fraction (/ (- value lowest)  range)
        x-center (+ (* index button-cell-width) (* encoder-count 0.5 button-cell-width))
        arc (java.awt.geom.Arc2D$Double. (- x-center 25.0) 50.0 50.0 50.0 240.0 -300.0 java.awt.geom.Arc2D/OPEN)]
    (set-graphics-color graphics track-color)
    (.draw graphics arc)
    (.setStroke graphics (java.awt.BasicStroke. 5.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
    (set-graphics-color graphics active-color)
    (.setAngleExtent arc (* -300.0 fraction))
    (.draw graphics arc)))

(defn ^:deprecated make-pan-gauge
  "Create a graphical gauge with an indicator that moves along a line.
