-
Notifications
You must be signed in to change notification settings - Fork 74
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 font rasterization settings in paragraph style #1102
add font rasterization settings in paragraph style #1102
Conversation
@MatkovIvan please take a look |
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
...ose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/platform/SkiaParagraph.skiko.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Outdated
Show resolved
Hide resolved
@manu-unter I took this names from Skia, but indeed |
15b3055
to
3c84e3f
Compare
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/TextStyle.skiko.kt
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
val edging = when (rasterizationSettings.smoothing) { | ||
FontSmoothing.None-> org.jetbrains.skia.FontEdging.ALIAS | ||
FontSmoothing.AntiAlias -> org.jetbrains.skia.FontEdging.ANTI_ALIAS | ||
FontSmoothing.SubpixelAntiAlias -> org.jetbrains.skia.FontEdging.SUBPIXEL_ANTI_ALIAS | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Apply auto formatting
- it's a good candidate for extraction to internal extension function for this enum (I'd put it in
FontRasterizationSettings.skiko.kt
) file
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/FontRasterization.kt
Show resolved
Hide resolved
.../ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/FontRasterizationSettings.skiko.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Ivan Matkov <matkov.ivan@gmail.com>
40060f5
to
e9ae5d3
Compare
@@ -320,8 +356,10 @@ public final class androidx/compose/ui/text/PlaceholderVerticalAlign$Companion { | |||
public final class androidx/compose/ui/text/PlatformParagraphStyle { | |||
public static final field $stable I | |||
public static final field Companion Landroidx/compose/ui/text/PlatformParagraphStyle$Companion; | |||
public fun <init> ()V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed constructor without arguments. It breaks binary compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge, let me know and I'll merge it
@igordmn could you grant me write access to the repo? |
Done |
Proposed Changes
Allow to configure font rasterization settings
Testing
Check
FontRasterization
tab in demo applicationIssues Fixed
Fixes: [Optional] The bug on https://issuetracker.google.com being fixed
Google CLA
You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.