-
Notifications
You must be signed in to change notification settings - Fork 4
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
Should we allow character values of font-weight
?
#13
Comments
|
In 1a94b55 we also use the same mapping as Quarto BrandTypographyFontWeightMap: dict[
str, BrandTypographyFontWeightRoundIntType
] = {
"thin": 100,
"extra-light": 200,
"ultra-light": 200,
"light": 300,
"normal": 400,
"regular": 400,
"medium": 500,
"semi-bold": 600,
"demi-bold": 600,
"bold": 700,
"extra-bold": 800,
"ultra-bold": 800,
"black": 900,
} |
We also need to take into account variable fonts which can provide a range. In our case, we'd want typography:
fonts:
# Local files
- family: Open Sans
source: file
files:
- path: fonts/open-sans/OpenSans-Variable.ttf
weight: [1, 999]
- path: fonts/open-sans/OpenSans-Variable-Italic.ttf
style: italic
weight: [1, 999] Here's the related CSS spec. We should probably also default |
Actually, we could either have font ranges specified in two different ways for file and GF-alike fonts or we could support a single syntax. Google Fonts already allow a list of font weights, e.g. Instead, I think we should support
|
Question: What other formats can use variable fonts via TTF or OTF? Or graphics devices, e.g. via
|
The spec currently restricts font weight to
1:9 * 100
but CSS also allows
normal
(400),bold
(700),lighter
, andbolder
. In CSS, the last two are relative font weights and are relative to the element's inherited value. In our case, however, I'd recommend we simply assign these values 100 (lighter
) and 900 (bolder
).I suppose we should also reconsider the
enum
here to allow any value between 1 and 1000 following the CSS spec (from MDN):The text was updated successfully, but these errors were encountered: