Package limn.graphics

Class TextRulers

java.lang.Object
limn.graphics.TextRulers

public final class TextRulers extends Object
Process-wide TextRuler registry, installed by the running backend (mirrors the Ui facade lifecycle). Scenes pick it up by default; anything can override locally for tests.

The backend's ruler measures through unsynchronized font caches and is therefore UI thread only (enforced). Precompute text metrics off thread via Ui.async handing the result back, not by measuring there.

  • Method Details

    • install

      public static void install(TextRuler ruler)
      Installs the backend's ruler (called once at backend startup).
    • uninstall

      public static void uninstall(TextRuler ruler)
      Resets to TextRuler.NONE (backend shutdown).
    • get

      public static TextRuler get()
      Returns:
      the installed ruler (never null; TextRuler.NONE without a backend)