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

Fueled typography #1

Open
wants to merge 3 commits into
base: fueled
Choose a base branch
from
Open

Fueled typography #1

wants to merge 3 commits into from

Conversation

Sissing
Copy link
Member

@Sissing Sissing commented Nov 17, 2023

First steps to support SwiftUI and UIKit for typography into one project

Comment on lines 95 to 104
struct Typography: Decodable {
let fontSystem: FontSystem?
let fontSwift: URL?
let labelStyleSwift: URL?
let textStyleSwift: URL?
let labelStyleSwift: URL?
let swiftUIFontSwift: URL?
let generateLabels: Bool
let labelsDirectory: URL?
let generateStyles: Bool
let stylesDirectory: URL?
let nameStyle: NameStyle
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is not consistent here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh good one, its difficult on the project since the default is spaces, so I need to change this for every file I'm working on.

Comment on lines +152 to +159
# [optional] Absolute or relative path to swift file where to generate TextStyle extensions for each style (TextStyle extension).
textStyleSwift: "./Source/UIComponents/TextStyle+extension.swift"
# [optional] Absolute or relative path to swift file where to export SwiftUI fonts (Font extension).
swiftUIFontSwift: "./Source/View/Common/Font+extension.swift"
# Should FigmaExport generate UILabel for each text style (font)? E.g. HeaderLabel, BodyLabel, CaptionLabel
generateLabels: true
# Relative or absolute path to directory where to place UILabel for each text style (font) (Requred if generateLabels = true)
labelsDirectory: "./Source/UIComponents/"
# Should FigmaExport generate TextStyles for each text style (font)? E.g. Header, Body, Caption
generateTextStyles: true
# Relative or absolute path to directory where to place TextStyles for each text style (font) (Required if generateTextStyles = true)
textStylesDirectory: "./Source/UIComponents/"
Copy link

@ada10086 ada10086 Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be in addition to the original labelStyleSwift, generateLabels, and labelsDirectory properties instead of replacing them? Since we are still supporting generating the Label, LabelStyle, LabelStyle+extension files for UIKit

Comment on lines +83 to +86
# Should FigmaExport generate TextStyles for each text style (font)? E.g. Header, Body, Caption
generateStyles: true
# Relative or absolute path to directory where to place TextStyles for each text style (font) (Required if generateTextStyles = true)
textStylesDirectory: "./Source/UIComponents/"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment on lines +64 to +66
# Choose what font system you want to use SwiftUI or UIKit
fontSystem: UIKit
# Path to directory where to place UIFont+extension.swift file required for both SwiftUI and UIKit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we include this in CONFIG.md as well?

Comment on lines +70 to +73
# Should FigmaExport generate TextStyles or Labels (based on fontSystem) for each text style (font)? E.g. Header, Body, Caption
generateStyles: true
# Relative or absolute path to directory where to place TextStyles or Labels (based on fontSystem) for each text style (font) (Required if generateStyles = true)
stylesDirectory: "./UIComponents/Source/Typography"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +68 to +69
# Should FigmaExport generate TextStyles for each text style (font)? E.g. Header, Body, Caption
generateTextStyles: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +435 to 438
- TextStyle.swift.stencil,
- TextStyle+extension.swift.stencil,
- Font+extension.swift.stencil
- UIFont+extension.swift.stencil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question - are we removing support for Label and LabelStyle?

return labelStylesSwiftExtension
}

private func makeLabel(textStyles: [TextStyle], labelsDirectory: URL, separateStyles: Bool) throws -> FileContents {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are generating files for style and style+extension files based on the fontSystem, but if it is UIKit, we are not generating Label.swift anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants