90 lines
1.9 KiB
Swift
90 lines
1.9 KiB
Swift
//
|
|
// TextModifier.swift
|
|
// AlloVictor
|
|
//
|
|
// Created by Bodinaud Victor on 14/04/2024.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct AlloTextExtraLight: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-ExtraLight", size: size))
|
|
}
|
|
}
|
|
|
|
struct AlloTextLight: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-Light", size: size))
|
|
}
|
|
}
|
|
|
|
struct AlloTextRegular: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-Regular", size: size))
|
|
}
|
|
}
|
|
|
|
struct AlloTextMedium: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-Medium", size: size))
|
|
}
|
|
}
|
|
|
|
struct AlloTextDemiBold: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-DemiBold", size: size))
|
|
}
|
|
}
|
|
|
|
struct AlloTextBold: ViewModifier {
|
|
let size: CGFloat
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.font(.custom("TTChocolates-Bold", size: size))
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func extraLight(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextExtraLight(size: size))
|
|
}
|
|
|
|
func light(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextLight(size: size))
|
|
}
|
|
|
|
func regular(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextRegular(size: size))
|
|
}
|
|
|
|
func medium(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextMedium(size: size))
|
|
}
|
|
|
|
func demiBold(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextDemiBold(size: size))
|
|
}
|
|
|
|
func bold(_ size: CGFloat) -> some View {
|
|
modifier(AlloTextBold(size: size))
|
|
}
|
|
}
|