Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a SharedFont type to ElementFonts. #5646

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions DesignKit/Source/FontsSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import SwiftUI
@available(iOS 14.0, *)
public struct FontSwiftUI: Fonts {

public let uiFonts: ElementFonts
public let uiFonts: FontsUIKit

public var largeTitle: Font

Expand Down Expand Up @@ -66,27 +66,27 @@ public struct FontSwiftUI: Fonts {
public var caption2SB: Font

public init(values: ElementFonts) {
self.uiFonts = values
self.uiFonts = FontsUIKit(values: values)

self.largeTitle = Font(values.largeTitle)
self.largeTitleB = Font(values.largeTitleB)
self.title1 = Font(values.title1)
self.title1B = Font(values.title1B)
self.title2 = Font(values.title2)
self.title2B = Font(values.title2B)
self.title3 = Font(values.title3)
self.title3SB = Font(values.title3SB)
self.headline = Font(values.headline)
self.subheadline = Font(values.subheadline)
self.body = Font(values.body)
self.bodySB = Font(values.bodySB)
self.callout = Font(values.callout)
self.calloutSB = Font(values.calloutSB)
self.footnote = Font(values.footnote)
self.footnoteSB = Font(values.footnoteSB)
self.caption1 = Font(values.caption1)
self.caption1SB = Font(values.caption1SB)
self.caption2 = Font(values.caption2)
self.caption2SB = Font(values.caption2SB)
self.largeTitle = values.largeTitle.font
self.largeTitleB = values.largeTitleB.font
self.title1 = values.title1.font
self.title1B = values.title1B.font
self.title2 = values.title2.font
self.title2B = values.title2B.font
self.title3 = values.title3.font
self.title3SB = values.title3SB.font
self.headline = values.headline.font
self.subheadline = values.subheadline.font
self.body = values.body.font
self.bodySB = values.bodySB.font
self.callout = values.callout.font
self.calloutSB = values.calloutSB.font
self.footnote = values.footnote.font
self.footnoteSB = values.footnoteSB.font
self.caption1 = values.caption1.font
self.caption1SB = values.caption1SB.font
self.caption2 = values.caption2.font
self.caption2SB = values.caption2SB.font
}
}
40 changes: 20 additions & 20 deletions DesignKit/Source/FontsUIkit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ import UIKit
public var caption2SB: UIFont

public init(values: ElementFonts) {
self.largeTitle = values.largeTitle
self.largeTitleB = values.largeTitleB
self.title1 = values.title1
self.title1B = values.title1B
self.title2 = values.title2
self.title2B = values.title2B
self.title3 = values.title3
self.title3SB = values.title3SB
self.headline = values.headline
self.subheadline = values.subheadline
self.body = values.body
self.bodySB = values.bodySB
self.callout = values.callout
self.calloutSB = values.calloutSB
self.footnote = values.footnote
self.footnoteSB = values.footnoteSB
self.caption1 = values.caption1
self.caption1SB = values.caption1SB
self.caption2 = values.caption2
self.caption2SB = values.caption2SB
self.largeTitle = values.largeTitle.uiFont
self.largeTitleB = values.largeTitleB.uiFont
self.title1 = values.title1.uiFont
self.title1B = values.title1B.uiFont
self.title2 = values.title2.uiFont
self.title2B = values.title2B.uiFont
self.title3 = values.title3.uiFont
self.title3SB = values.title3SB.uiFont
self.headline = values.headline.uiFont
self.subheadline = values.subheadline.uiFont
self.body = values.body.uiFont
self.bodySB = values.bodySB.uiFont
self.callout = values.callout.uiFont
self.calloutSB = values.calloutSB.uiFont
self.footnote = values.footnote.uiFont
self.footnoteSB = values.footnoteSB.uiFont
self.caption1 = values.caption1.uiFont
self.caption1SB = values.caption1SB.uiFont
self.caption2 = values.caption2.uiFont
self.caption2SB = values.caption2SB.uiFont
}
}
Loading