Skip to content

Conversation

@terrakok
Copy link
Member

@terrakok terrakok commented Dec 11, 2024

Sample:

Text(
    modifier = Modifier.padding(16.dp),
    fontFamily = FontFamily(
        Font(
            Res.font.RobotoFlex_VariableFont,
            variationSettings = FontVariation.Settings(FontVariation.weight(400))
        ),
    ),
    text = "The quick brown fox jumps over the lazy dog"
)

Fixes https://youtrack.jetbrains.com/issue/CMP-7088

Testing

Demo app:
./gradlew :resources:demo:desktopApp:run
image

Release Notes

Highlights - Resources

  • Add FontVariation.Settings support to the resources library

@terrakok
Copy link
Member Author

New API introduced

@terrakok terrakok force-pushed the k.tskh/resources-var-fonts branch from 2c630d7 to 38ada7a Compare December 13, 2024 10:17
@terrakok terrakok force-pushed the k.tskh/resources-var-fonts branch from 38ada7a to bdc717c Compare December 13, 2024 10:53
@terrakok terrakok merged commit 93b2f1d into master Dec 13, 2024
17 of 18 checks passed
@terrakok terrakok deleted the k.tskh/resources-var-fonts branch December 13, 2024 11:41
@annotation-engine
Copy link

Does it support mutable fonts like MiSans

@adamglin0
Copy link
Contributor

adamglin0 commented Feb 12, 2025

Does it support mutable fonts like MiSans

Do u mean variable fonts (可变字体)?

@terrakok
Copy link
Member Author

@JetBrains JetBrains locked and limited conversation to collaborators Feb 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants