From 21d765f348c4ad3ae9bf5dcf435282ba6d48a06a Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Thu, 22 Oct 2026 13:15:04 -0700 Subject: [PATCH] Menu Band: the full-screen face hides the pointer; caption glyphs get round joins and oversampled bitmaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TIAT Oct 22: blueberry's arrow sat on its cheek during the trio (CGDisplayHideCursor on show, balanced on hide, works for a menu-bar app that is not frontmost); the word captions' outlines spiked at letter corners (miter joins) and softened under the pop animation's lasting 1.08× scale (bitmaps now at twice the backing scale, trilinear). --- slab/menuband/Sources/MenuBand/LyricCaption.swift | 11 ++++++++++- slab/menuband/Sources/MenuBand/SingerFace.swift | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/slab/menuband/Sources/MenuBand/LyricCaption.swift b/slab/menuband/Sources/MenuBand/LyricCaption.swift index fa75a1d4f6..a48d23b60d 100644 --- a/slab/menuband/Sources/MenuBand/LyricCaption.swift +++ b/slab/menuband/Sources/MenuBand/LyricCaption.swift @@ -244,7 +244,13 @@ final class CaptionGlyphLayer: CALayer { // its image. Explicit contents avoid replaying CoreGraphics text/shadow // display lists as each letter scales and sways over the Metal face. override func display() { - let scale = max(1, contentsScale) + // Oversample: the pop animation leaves a glyph at 1.08× (and peaks at + // 1.22×), so a bitmap at exact size is always magnified. Twice the + // backing scale keeps edges crisp under that; trilinear filtering + // handles the rest (jeffrey, Oct 22: rough letter edges). + let scale = max(1, contentsScale) * 2 + minificationFilter = .trilinear + magnificationFilter = .linear let width = max(1, Int(ceil(bounds.width * scale))) let height = max(1, Int(ceil(bounds.height * scale))) let key = "\(text)|\(font.fontName)|\(font.pointSize)|\(bounds)|\(scale)|\(ink)|\(strokeColor)|\(shadowInk)|\(glowColor)" as NSString @@ -263,6 +269,9 @@ final class CaptionGlyphLayer: CALayer { override func draw(in ctx: CGContext) { NSGraphicsContext.saveGraphicsState() NSGraphicsContext.current = NSGraphicsContext(cgContext: ctx, flipped: false) + // Outlines are stroked with the context's joins: miters spike at every + // letter corner at caption size, so round them. + ctx.setLineJoin(.round); ctx.setLineCap(.round) let probe = NSAttributedString(string: text, attributes: [.font: font]) let size = probe.size() let at = NSPoint(x: (bounds.width - size.width) / 2, y: (bounds.height - size.height) / 2) diff --git a/slab/menuband/Sources/MenuBand/SingerFace.swift b/slab/menuband/Sources/MenuBand/SingerFace.swift index 17aa63c512..7a8c8ddc86 100644 --- a/slab/menuband/Sources/MenuBand/SingerFace.swift +++ b/slab/menuband/Sources/MenuBand/SingerFace.swift @@ -159,7 +159,12 @@ final class SingerFace { panel.animator().alphaValue = 1 } panel.orderFrontRegardless() + // A full-screen face shows no pointer (blueberry's arrow sat on its cheek, + // TIAT Oct 22). CGDisplayHideCursor works for a menu-bar app that is not + // frontmost; it is balanced in hide(). + if slot == nil, !cursorHidden { CGDisplayHideCursor(CGMainDisplayID()); cursorHidden = true } } + private var cursorHidden = false func onset(_ syllable: String, hold: Double) { precondition(Thread.isMainThread) @@ -180,6 +185,7 @@ final class SingerFace { func hide() { precondition(Thread.isMainThread) if slot == nil { SingerGaze.shared.stop() } + if cursorHidden { CGDisplayShowCursor(CGMainDisplayID()); cursorHidden = false } guard let panel, let view else { return } NSAnimationContext.runAnimationGroup({ ctx in ctx.duration = 0.5 -- knotmirror 0.0.1