Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.46 KB

font-custom.md

File metadata and controls

51 lines (42 loc) · 1.46 KB

Adding a custom font

Design inspired by my son who attended his first App design workshop today 09/23/23. He specifically called out needing a pixelated font 😊.

Screenshot 2023-09-23 at 7 30 19 PM

try? it out

//
//  ContentView.swift
//  SwiftUIPlayground
//
//  Created by Alex Paul
//

import SwiftUI

struct ContentView: View {
    let customFont = "Typeface-Mario-World-Pixel-Filled"

    var body: some View {
        VStack {
            Text("Mayhem")
                .font(Font.custom(customFont, size: 64))
            Text("Sandbox")
                .font(Font.custom(customFont, size: 24))
            Button(action: {}) {
                Text("Play")
                    .font(Font.custom(customFont, size: 18))
                    .padding()
                    .foregroundColor(.white)
            }
            .background(
                RoundedRectangle(cornerRadius: 20)
            )
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Resources