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

Allow font style and weight without explicit font family variations #2894

Open
Fidesnoella opened this issue Oct 1, 2024 · 1 comment
Open

Comments

@Fidesnoella
Copy link

Currently, when using predefined fonts such as Courier, Helvetica and Times-Roman, I need to explicitly specify the font family again to apply styles like bold or italic. This issue does not occur with registered fonts, where we can use fontWeight and fontStyle without specifying variations (e.g., Inter works as expected without needing Inter-Bold).

For example, instead of this:

page: {
  fontFamily: "Courier",
},
textBold: {
  fontFamily: "Courier-Bold",
  fontWeight: "bold",
},
textItalic: {
  fontFamily: "Courier-Oblique",
  fontStyle: "italic",
}

It would be more convenient to allow:

page: {
  fontFamily: "Courier",
},
textBold: {
  fontWeight: "bold",
},
textItalic: {
  fontStyle: "italic",
}

This issue specifically affects predefined fonts. It would be great if these fonts worked similarly to registered fonts, where fontWeight and fontStyle can be applied directly without needing to specify the font family variation.

This change would simplify font management, making it consistent with how CSS handles fonts and improving the developer experience by not requiring explicit font family variations for weight and style.

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

No branches or pull requests

2 participants
@Fidesnoella and others