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