Skip to content

Conversation

timbaev
Copy link
Collaborator

@timbaev timbaev commented Nov 16, 2020

New template option for text style generation - usingSystemFont:

textStyles:
  file:
    key: ...
    includedNodes:
      - ...
  destination: ...
  templateOptions:
    usingSystemFonts: true

This option generate text style with fonts SFProText and SFProDisplay using systemFont(ofSize:weight:) function.

For example, generated text style with enabled option:

public static let caption = TextStyle(
    font: UIFont.systemFont(ofSize: 13.0, weight: .light),
    ...
)

With disabled option or if omitted:

public static let caption = TextStyle(
    font: UIFont(name: "SFProDisplay-Light", size: 13.0),
    ...
)

@timbaev timbaev requested a review from almazrafi November 16, 2020 06:13
@timbaev timbaev merged commit 386cc28 into master Oct 15, 2021
@timbaev timbaev deleted the feature/system-fonts branch October 15, 2021 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants