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

Support Variable Fonts in Desktop, Native, Web #1623

Merged
merged 36 commits into from
Nov 5, 2024

Conversation

adamglin0
Copy link

@adamglin0 adamglin0 commented Oct 8, 2024

Support for Variable Font in platforms other than Android.

Fix Issue Youtrack

Testing

Write Sample In Compose MPP Demo

  • Desktop run ./gradlew :compose:mpp:demo:runDesktop
  • JS run ./gradlew :compose:mpp:demo:jsRun
  • IOS run ./compose/mpp/demo/regenerate_xcode_project.sh

For more details on how to run the mpp demo, please refer to MULTIPLATFORM.md
Should tested by QA.

How to use

Font(
      identity = "FontName",
      data = fontData,
      variationSettings = FontVariation.Settings()
)

Record

desktop.mov
js.mov
iOS.mp4

Release Notes

Features - Multiple Platforms

  • Support Variable Fonts In All Platforms

@adamglin0 adamglin0 marked this pull request as ready for review October 9, 2024 14:03
@adamglin0
Copy link
Author

@MatkovIvan Hello, how do I add a reviewer to this PR?

@MatkovIvan MatkovIvan requested review from terrakok and kropp October 9, 2024 14:28
@adamglin0 adamglin0 requested a review from terrakok October 11, 2024 12:50
@adamglin0 adamglin0 requested a review from kropp October 15, 2024 12:29
@adamglin0 adamglin0 requested a review from kropp October 16, 2024 07:10
@kropp kropp merged commit 3fa227e into JetBrains:jb-main Nov 5, 2024
2 checks passed
@ASalavei ASalavei mentioned this pull request Nov 6, 2024
ASalavei added a commit that referenced this pull request Nov 6, 2024
API dump update after the
[MR](#1623)
@Skaldebane
Copy link

Hi there! Been trying to use this in 1.8.0-alpha01, but it seems that there's no easy API to do so.

Do I have to take the binary font data, then pass it to the Font function that takes an identity and data? That's pretty cumbersome compared to the Android approach.

Would love to have this as an extra variationSettings parameter on the Composable Font function. That way it'll be much closer to the Android approach and much more ergonomic to use.

@adamglin0
Copy link
Author

adamglin0 commented Dec 11, 2024

Hi there! Been trying to use this in 1.8.0-alpha01, but it seems that there's no easy API to do so.

Do I have to take the binary font data, then pass it to the Font function that takes an identity and data? That's pretty cumbersome compared to the Android approach.

Would love to have this as an extra variationSettings parameter on the Composable Font function. That way it'll be much closer to the Android approach and much more ergonomic to use.

Do you mean org.jetbrains.compose.resources.Font()?
https://youtrack.jetbrains.com/issue/CMP-7088/Support-FontVariation.Settings-in-compose.component.resource
JetBrains/compose-multiplatform#5182

@terrakok
Copy link
Member

@JetBrains JetBrains locked and limited conversation to collaborators Dec 12, 2024
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.

5 participants