forked from androidx/androidx
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
Add a way to use fonts installed on the system #898
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
igordmn
reviewed
Nov 9, 2023
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/PlatformFont.skiko.kt
Outdated
Show resolved
Hide resolved
igordmn
approved these changes
Nov 10, 2023
dima-avdeev-jb
approved these changes
Nov 10, 2023
MatkovIvan
added a commit
that referenced
this pull request
Nov 13, 2023
## Proposed Changes - Fixes JS build after #898 - Does **NOT** fix fonts in JS (JetBrains/compose-multiplatform#3915), so it's compilation only fix.
mazunin-v-jb
pushed a commit
that referenced
this pull request
Dec 7, 2023
## Proposed Changes - Add `SystemFont` class to be able to use fonts installed on the system. ## API Change ```diff +androidx.compose.ui.text.platform.SystemFont ``` ## Testing Usage looks like this: ```kt FontFamily(SystemFont("Menlo")), FontFamily(SystemFont("Times New Roman", FontWeight.Bold)), FontFamily(SystemFont("Webdings")), ``` <img width="1003" alt="Screenshot 2023-11-09 at 12 18 02" src="https://github.com/JetBrains/compose-multiplatform-core/assets/1836384/0c36d4aa-6bc9-47e2-94dd-edb09fd242ac">
mazunin-v-jb
pushed a commit
that referenced
this pull request
Dec 7, 2023
## Proposed Changes - Fixes JS build after #898 - Does **NOT** fix fonts in JS (JetBrains/compose-multiplatform#3915), so it's compilation only fix.
MatkovIvan
added a commit
that referenced
this pull request
Jan 23, 2024
## Proposed Changes - Missing piece of #898 - It's a copy-paste of already existing code. ## Testing Test: try to use `SystemFont` on iOS ```kt FontFamily(SystemFont("Helvetica")), FontFamily(SystemFont("Times New Roman")), FontFamily(SystemFont("Courier")), ``` ![Simulator Screenshot - iPhone 15 Pro - 2024-01-23 at 14 02 50](https://github.com/JetBrains/compose-multiplatform-core/assets/1836384/56738d38-41fd-40c1-9408-0f3cacb38a2d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
SystemFont
class to be able to use fonts installed on the system.API Change
+androidx.compose.ui.text.platform.SystemFont
Testing
Usage looks like this: