icon: vereinfachte Anführungszeichen-Glyphe als Platzhalter
Z + zwei Akzent-Quotes lieferten ein unsauber gerendertes PNG (Z fehlte aufgrund Font-Bounds-Mathematik bei großem Pointsize). Reduziert auf eine zentrierte Öffnungs-Anführung („) — ikonisch auch bei 40×40, klar erkennbar als Quotes-App. Platzhalter — vor Launch durch Designer-Icon ersetzen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7b4cb13afe
commit
10644ff4ef
2 changed files with 27 additions and 40 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
|
|
@ -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)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue