SkillAgentSearch skills...

FontPicker

FontPicker on macOS

Install / Use

/learn @tyagishi/FontPicker
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

FontPicker

Wrapped NSFontPanel for SwiftUI.

UI

FontPickerExample

for working example, please refer to https://github.com/tyagishi/FontPickerExample

example code

FontPicker can be used like ColorPicker.

struct ContentView: View {
    @State private var font: NSFont = NSFont.systemFont(ofSize: 24)
    var body: some View {
        VStack {
            FontPicker("Font", selection: $font)
            Text("selected font name \(font.displayName ?? "no font" )")
            Text("font size: \(font.pointSize, specifier: "%.0f")")
        }
    }
}

small improvement

As usual user can close FontPanel with close button of FontPanel. Additionally: user can close FontPanel with second clicking FontPicker button. (i.e. Clicking FontPicker button while FontPanel is still open FontPanel will be closed.)

comments are welcome

Comments, advice for improvements are highly appreciated. please contact to https://twitter.com/tyagishi .

Related Skills

View on GitHub
GitHub Stars18
CategoryDevelopment
Updated11mo ago
Forks4

Languages

Swift

Security Score

77/100

Audited on Apr 7, 2025

No findings