Merge pull request #1957 from mayokunyusuf/rtl-text-fix

Fix punctuation and alignment for English text in RTL locales
main
Don Turner 2 days ago committed by GitHub
commit f93da9c7a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,6 +22,8 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.text.style.LineHeightStyle.Alignment
import androidx.compose.ui.text.style.LineHeightStyle.Trim
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDirection
import androidx.compose.ui.unit.sp
/**
@ -33,30 +35,40 @@ internal val NiaTypography = Typography(
fontSize = 57.sp,
lineHeight = 64.sp,
letterSpacing = (-0.25).sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
displayMedium = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 45.sp,
lineHeight = 52.sp,
letterSpacing = 0.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
displaySmall = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 36.sp,
lineHeight = 44.sp,
letterSpacing = 0.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
headlineLarge = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 32.sp,
lineHeight = 40.sp,
letterSpacing = 0.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
headlineMedium = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 28.sp,
lineHeight = 36.sp,
letterSpacing = 0.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
headlineSmall = TextStyle(
fontWeight = FontWeight.Normal,
@ -67,6 +79,8 @@ internal val NiaTypography = Typography(
alignment = Alignment.Bottom,
trim = Trim.None,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
titleLarge = TextStyle(
fontWeight = FontWeight.Bold,
@ -77,18 +91,24 @@ internal val NiaTypography = Typography(
alignment = Alignment.Bottom,
trim = Trim.LastLineBottom,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
titleMedium = TextStyle(
fontWeight = FontWeight.Bold,
fontSize = 18.sp,
lineHeight = 24.sp,
letterSpacing = 0.1.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
titleSmall = TextStyle(
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
// Default text style
bodyLarge = TextStyle(
@ -100,18 +120,24 @@ internal val NiaTypography = Typography(
alignment = Alignment.Center,
trim = Trim.None,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
bodyMedium = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.25.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
bodySmall = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.4.sp,
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
// Used for Button
labelLarge = TextStyle(
@ -123,6 +149,8 @@ internal val NiaTypography = Typography(
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
// Used for Navigation items
labelMedium = TextStyle(
@ -134,6 +162,8 @@ internal val NiaTypography = Typography(
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
// Used for Tag
labelSmall = TextStyle(
@ -145,5 +175,7 @@ internal val NiaTypography = Typography(
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
textDirection = TextDirection.Ltr,
textAlign = TextAlign.Left,
),
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Loading…
Cancel
Save