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

Non-linear font scaling #1867

Open
wants to merge 6 commits into
base: jb-main
Choose a base branch
from

Conversation

alexzhirkevich
Copy link

Adapt Android non-linear font scaling and map Dynamic Type HIG to font scaling tables on IOS

Fixes https://youtrack.jetbrains.com/issue/CMP-738/Support-non-linear-text-scale-for-other-platforms

Testing

FontScalingTest.uikit.kt

This should be tested by QA

Release Notes

Features - iOS

  • Default Density now performs non-linear font scaling and conforms to HIG

@igordmn igordmn requested a review from mazunin-v-jb February 21, 2025 21:12
Copy link
Collaborator

@ASalavei ASalavei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LDTM with 2 minor comments.
Thank you for the contribution!

import androidx.compose.ui.unit.fontscaling.FontScaleConverterTable

internal actual fun isNonLinearFontScalingActive(fontScale: Float): Boolean {
return fontScale >= UIKitContentSize.ExtraSmall.fontScale && fontScale !in 0.97f..1.03f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please leave a comment in the code about these constants: 0.97f..1.03f ?

*/
@Immutable
@JvmDefaultWithCompatibility
actual interface FontScaling {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will change Desktop API. Please run ./gradlew desktopApiDump.

@ASalavei ASalavei requested a review from igordmn March 7, 2025 20:42
@ASalavei
Copy link
Collaborator

ASalavei commented Mar 7, 2025

@igordmn , since there are changes in Desktop API, we need your approval.

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

Successfully merging this pull request may close these issues.

3 participants