diff --git a/Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png b/Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png index ca1f689..10557e8 100644 Binary files a/Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png and b/Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png differ diff --git a/scripts/make-appicon.swift b/scripts/make-appicon.swift index 64002c3..7d4ed84 100644 --- a/scripts/make-appicon.swift +++ b/scripts/make-appicon.swift @@ -3,17 +3,15 @@ // // Design (paper-Variant aus @mana/themes): // - Background: warm Sienna (paper-primary, HSL 18 50% 38%) -// - Zwei stilisierte typografische Anführungszeichen oben in -// gebrochenem Weiß (paper-background) -// - Großes serifenbetontes „Z" zentriert in dunklem Sepia +// - Ein großes typografisches Anführungszeichen mittig in +// gebrochenem Weiß. Reduziert, klar lesbar bei jeder Größe. // // Aufruf: // swift scripts/make-appicon.swift // // Schreibt nach: Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png // -// Dies ist ein Platzhalter — vor App-Store-Submission durch ein -// designter Icon ersetzen. +// Platzhalter — vor App-Store-Launch durch designtes Icon ersetzen. import AppKit import CoreGraphics @@ -36,44 +34,31 @@ let background = CGColor(red: 0.57, green: 0.30, blue: 0.19, alpha: 1) ctx.setFillColor(background) ctx.fill(CGRect(x: 0, y: 0, width: size, height: size)) -// Zwei „Anführungs"-Akzente oben — gebrochenes Weiß (paper-bg-light) -let accent = CGColor(red: 0.95, green: 0.93, blue: 0.88, alpha: 0.92) -let quoteFont = NSFont(name: "Georgia-Bold", size: 360) - ?? NSFont.boldSystemFont(ofSize: 360) -let quoteAttrs: [NSAttributedString.Key: Any] = [ - .font: quoteFont, - .foregroundColor: NSColor(cgColor: accent) ?? .white, +// Großes typografisches Öffnungs-Quote („) in gebrochenem Weiß. +// Georgia-Bold rendert es als zwei "Tropfen" — ikonisch genug, um +// auch im 60×60 oder 40×40 erkennbar zu bleiben. +let glyph = "\u{201C}" // “ +let glyphFont = NSFont(name: "Georgia-Bold", size: 900) + ?? NSFont.boldSystemFont(ofSize: 900) +let accent = NSColor( + srgbRed: 0.95, green: 0.93, blue: 0.88, alpha: 1.0 +) +let attrs: [NSAttributedString.Key: Any] = [ + .font: glyphFont, + .foregroundColor: accent, ] +let attrStr = NSAttributedString(string: glyph, attributes: attrs) +let line = CTLineCreateWithAttributedString(attrStr) +let bounds = CTLineGetImageBounds(line, ctx) -// Anführungszeichen links („) -let leftQuote = NSAttributedString(string: "\u{201E}", attributes: quoteAttrs) -let leftLine = CTLineCreateWithAttributedString(leftQuote) -ctx.textPosition = CGPoint(x: 160, y: 520) -CTLineDraw(leftLine, ctx) - -// Anführungszeichen rechts (") -let rightQuote = NSAttributedString(string: "\u{201C}", attributes: quoteAttrs) -let rightLine = CTLineCreateWithAttributedString(rightQuote) -ctx.textPosition = CGPoint(x: 620, y: 520) -CTLineDraw(rightLine, ctx) - -// Großes „Z" mittig — dunkles Sepia, serif -let zFont = NSFont(name: "Georgia-Bold", size: 640) - ?? NSFont.boldSystemFont(ofSize: 640) -let darkSepia = CGColor(red: 0.22, green: 0.16, blue: 0.12, alpha: 1) -let zAttrs: [NSAttributedString.Key: Any] = [ - .font: zFont, - .foregroundColor: NSColor(cgColor: darkSepia) ?? .black, -] -let zStr = NSAttributedString(string: "Z", attributes: zAttrs) -let zLine = CTLineCreateWithAttributedString(zStr) -let zBounds = CTLineGetImageBounds(zLine, ctx) -let tx = (CGFloat(size) - zBounds.width) / 2 - zBounds.origin.x -let ty = (CGFloat(size) - zBounds.height) / 2 - zBounds.origin.y - 40 +// Zentrieren auf der Canvas. CTLineGetImageBounds gibt das +// bounding-box im aktuellen Coordinate-System zurück (bottom-up +// in CG); origin.y kann negativ sein bei Glyphs mit Descender. +let tx = (CGFloat(size) - bounds.width) / 2.0 - bounds.origin.x +let ty = (CGFloat(size) - bounds.height) / 2.0 - bounds.origin.y ctx.textPosition = CGPoint(x: tx, y: ty) -CTLineDraw(zLine, ctx) +CTLineDraw(line, ctx) -// PNG schreiben guard let cgImage = ctx.makeImage() else { print("makeImage failed") exit(1) @@ -84,6 +69,8 @@ guard let data = bitmap.representation(using: .png, properties: [:]) else { exit(1) } -let target = URL(fileURLWithPath: "Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png") +let target = URL( + fileURLWithPath: "Sources/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png" +) try data.write(to: target) print("Wrote \(target.path) (\(data.count) bytes)")