🚀 Add more font weights & improve Highlight Words thickness levels

* Added more font weights (semibold+bold)
* Improved "Highlight Words Thickness" levels
This commit is contained in:
Acclorite 2025-01-04 19:29:45 +02:00
parent 170f4a8de9
commit d22dc17c64
34 changed files with 56 additions and 22 deletions

View file

@ -21,7 +21,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.raleway_regular),
Font(R.font.raleway_regular_italic, style = FontStyle.Italic),
Font(R.font.raleway_medium, weight = FontWeight.Medium)
Font(R.font.raleway_medium, weight = FontWeight.Medium),
Font(R.font.raleway_semibold, weight = FontWeight.SemiBold),
Font(R.font.raleway_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -30,7 +32,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.opensans_regular),
Font(R.font.opensans_regular_italic, style = FontStyle.Italic),
Font(R.font.opensans_medium, weight = FontWeight.Medium)
Font(R.font.opensans_medium, weight = FontWeight.Medium),
Font(R.font.opensans_semibold, weight = FontWeight.SemiBold),
Font(R.font.opensans_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -39,7 +43,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.mulish_regular),
Font(R.font.mulish_regular_italic, style = FontStyle.Italic),
Font(R.font.mulish_medium, weight = FontWeight.Medium)
Font(R.font.mulish_medium, weight = FontWeight.Medium),
Font(R.font.mulish_semibold, weight = FontWeight.SemiBold),
Font(R.font.mulish_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -48,7 +54,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.arimo_regular),
Font(R.font.arimo_regular_italic, style = FontStyle.Italic),
Font(R.font.arimo_medium, weight = FontWeight.Medium)
Font(R.font.arimo_medium, weight = FontWeight.Medium),
Font(R.font.arimo_semibold, weight = FontWeight.SemiBold),
Font(R.font.arimo_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -57,7 +65,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.garamond_regular),
Font(R.font.garamond_regular_italic, style = FontStyle.Italic),
Font(R.font.garamond_medium, weight = FontWeight.Medium)
Font(R.font.garamond_medium, weight = FontWeight.Medium),
Font(R.font.garamond_semibold, weight = FontWeight.SemiBold),
Font(R.font.garamond_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -66,7 +76,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.robotoserif_regular),
Font(R.font.robotoserif_regular_italic, style = FontStyle.Italic),
Font(R.font.robotoserif_medium, weight = FontWeight.Medium)
Font(R.font.robotoserif_medium, weight = FontWeight.Medium),
Font(R.font.robotoserif_semibold, weight = FontWeight.SemiBold),
Font(R.font.robotoserif_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -75,7 +87,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.notoserif_regular),
Font(R.font.notoserif_regular_italic, style = FontStyle.Italic),
Font(R.font.notoserif_medium, weight = FontWeight.Medium)
Font(R.font.notoserif_medium, weight = FontWeight.Medium),
Font(R.font.notoserif_semibold, weight = FontWeight.SemiBold),
Font(R.font.notoserif_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -84,7 +98,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.notosans_regular),
Font(R.font.notosans_regular_italic, style = FontStyle.Italic),
Font(R.font.notosans_medium, weight = FontWeight.Medium)
Font(R.font.notosans_medium, weight = FontWeight.Medium),
Font(R.font.notosans_semibold, weight = FontWeight.SemiBold),
Font(R.font.notosans_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -93,7 +109,8 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.roboto_regular),
Font(R.font.roboto_regular_italic, style = FontStyle.Italic),
Font(R.font.roboto_medium, weight = FontWeight.Medium)
Font(R.font.roboto_medium, weight = FontWeight.Medium),
Font(R.font.roboto_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -102,7 +119,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.jost_regular),
Font(R.font.jost_regular_italic, style = FontStyle.Italic),
Font(R.font.jost_medium, weight = FontWeight.Medium)
Font(R.font.jost_medium, weight = FontWeight.Medium),
Font(R.font.jost_semibold, weight = FontWeight.SemiBold),
Font(R.font.jost_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -111,7 +130,8 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.merriweather_regular),
Font(R.font.merriweather_regular_italic, style = FontStyle.Italic),
Font(R.font.merriweather_medium, weight = FontWeight.Medium)
Font(R.font.merriweather_medium, weight = FontWeight.Medium),
Font(R.font.merriweather_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -120,7 +140,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.montserrat_regular),
Font(R.font.montserrat_regular_italic, style = FontStyle.Italic),
Font(R.font.montserrat_medium, weight = FontWeight.Medium)
Font(R.font.montserrat_medium, weight = FontWeight.Medium),
Font(R.font.montserrat_semibold, weight = FontWeight.SemiBold),
Font(R.font.montserrat_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -129,7 +151,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.nunito_regular),
Font(R.font.nunito_regular_italic, style = FontStyle.Italic),
Font(R.font.nunito_medium, weight = FontWeight.Medium)
Font(R.font.nunito_medium, weight = FontWeight.Medium),
Font(R.font.nunito_semibold, weight = FontWeight.SemiBold),
Font(R.font.nunito_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -138,6 +162,8 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.robotoslab_regular),
Font(R.font.robotoslab_medium, weight = FontWeight.Medium),
Font(R.font.robotoslab_semibold, weight = FontWeight.SemiBold),
Font(R.font.robotoslab_bold, weight = FontWeight.Bold),
)
),
FontWithName(
@ -146,7 +172,9 @@ fun Constants.provideFonts(withRandom: Boolean): List<FontWithName> {
FontFamily(
Font(R.font.lora_regular),
Font(R.font.lora_regular_italic, style = FontStyle.Italic),
Font(R.font.lora_medium, weight = FontWeight.Medium)
Font(R.font.lora_medium, weight = FontWeight.Medium),
Font(R.font.lora_semibold, weight = FontWeight.SemiBold),
Font(R.font.lora_bold, weight = FontWeight.Bold),
)
)
).apply {

View file

@ -17,9 +17,11 @@ fun HighlightedReadingThicknessOption() {
ExpandingTransition(visible = state.value.highlightedReading) {
SliderWithTitle(
value = state.value.highlightedReadingThickness to "pt",
value = state.value.highlightedReadingThickness.to(
" ${stringResource(R.string.highlighted_reading_level)}"
),
fromValue = 1,
toValue = 5,
toValue = 3,
title = stringResource(id = R.string.highlighted_reading_thickness_option),
onValueChange = {
mainModel.onEvent(

View file

@ -91,7 +91,7 @@ data class MainState(
val horizontalGestureSensitivity: Float = provideDefaultValue { 0.6f },
val bottomBarPadding: Int = provideDefaultValue { 0 },
val highlightedReading: Boolean = provideDefaultValue { false },
val highlightedReadingThickness: Int = provideDefaultValue { 3 },
val highlightedReadingThickness: Int = provideDefaultValue { 2 },
// Browse Settings
val browseFilesStructure: BrowseFilesStructure = provideDefaultValue {

View file

@ -172,11 +172,9 @@ data class ReaderScreen(val bookId: Int) : Screen, Parcelable {
}
val highlightedReadingThickness = remember(mainState.value.highlightedReadingThickness) {
when (mainState.value.highlightedReadingThickness) {
2 -> FontWeight.W600
3 -> FontWeight.W700
4 -> FontWeight.W800
5 -> FontWeight.W900
else -> FontWeight.W500
2 -> FontWeight.SemiBold
3 -> FontWeight.Bold
else -> FontWeight.Medium
}
}
val horizontalAlignment = remember(mainState.value.textAlignment) {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -264,6 +264,9 @@
<string name="horizontal_gesture_on">Ввімкнений</string>
<string name="horizontal_gesture_inverse">Ввімкнений (Інвертований)</string>
<!-- Highlighted Reading properties -->
<string name="highlighted_reading_level">рівень</string>
<!-- Themes -->
<string name="dynamic_theme">Меркурій</string>
<string name="blue_theme">Нептун</string>

View file

@ -321,6 +321,9 @@
<string name="horizontal_gesture_on">On</string>
<string name="horizontal_gesture_inverse">On (Inverse)</string>
<!-- Highlighted Reading properties -->
<string name="highlighted_reading_level">level</string>
<!-- Themes -->
<string name="dynamic_theme">Mercury</string>
<string name="blue_theme">Neptune</string>