Skip to content

Commit 12eaa14

Browse files
authored
Merge pull request #136 from code-payments/fix/avenir-demi-font-metrics
fix(typography): update demi OTF to fix corrupt font metrics
2 parents 27511ec + 6749681 commit 12eaa14

8 files changed

Lines changed: 15361 additions & 23 deletions

File tree

app/src/main/java/com/getcode/theme/Theme.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,4 @@ fun inputColors() = TextFieldDefaults.textFieldColors(
180180
focusedIndicatorColor = Color.Transparent,
181181
unfocusedIndicatorColor = Color.Transparent,
182182
cursorColor = Color.White,
183-
184183
)

app/src/main/java/com/getcode/theme/Type.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@ package com.getcode.theme
22

33
import androidx.compose.material.Typography
44
import androidx.compose.runtime.Composable
5+
import androidx.compose.ui.text.ExperimentalTextApi
6+
import androidx.compose.ui.text.PlatformTextStyle
57
import androidx.compose.ui.text.TextStyle
68
import androidx.compose.ui.text.font.Font
79
import androidx.compose.ui.text.font.FontFamily
10+
import androidx.compose.ui.text.font.FontVariation
811
import androidx.compose.ui.text.font.FontWeight
912
import androidx.compose.ui.text.style.TextAlign
1013
import androidx.compose.ui.unit.sp
1114
import com.getcode.R
1215

1316
private val Avenir = FontFamily(
17+
Font(R.font.avenir_next_regular, FontWeight.Thin),
18+
Font(R.font.avenir_next_regular, FontWeight.ExtraLight),
1419
Font(R.font.avenir_next_regular, FontWeight.Light),
1520
Font(R.font.avenir_next_regular, FontWeight.Normal),
16-
Font(R.font.avenir_next_demi, FontWeight.Medium),
17-
Font(R.font.avenir_next_demi, FontWeight.SemiBold)
21+
Font(R.font.avenir_next_medium, FontWeight.Medium),
22+
Font(R.font.avenir_next_demi, FontWeight.SemiBold),
23+
Font(R.font.avenir_next_demi, FontWeight.Bold),
24+
Font(R.font.avenir_next_demi, FontWeight.ExtraBold),
25+
Font(R.font.avenir_next_demi, FontWeight.Black)
1826
)
1927

2028
private val RobotoMono = FontFamily(
@@ -65,7 +73,7 @@ internal val typography = Typography(
6573
fontFamily = Avenir,
6674
fontSize = 20.sp,
6775
fontWeight = FontWeight.SemiBold,
68-
lineHeight = 26.sp
76+
lineHeight = 26.sp,
6977
),
7078
subtitle2 = TextStyle( //Screen Title
7179
fontFamily = Avenir,

app/src/main/java/com/getcode/view/login/BaseAccessKeyViewModel.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
213213
return imageOut
214214
}
215215

216-
internal fun getQrCode(entropyB64: String): Bitmap? {
216+
private fun getQrCode(entropyB64: String): Bitmap? {
217217
val base58 = Base58.encode(entropyB64.decodeBase64())
218218
val url = "${resources.getString(R.string.root_url_app)}/login?data=$base58"
219219

@@ -235,7 +235,7 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
235235
textPaint.color = color
236236
textPaint.textSize = sizePx.toFloat()
237237
textPaint.typeface = Typeface.create(
238-
resources.getFont(R.font.avenir),
238+
resources.getFont(R.font.avenir_next_demi),
239239
Typeface.BOLD
240240
)
241241

@@ -245,17 +245,17 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
245245
canvas.drawText(text, xV.toFloat(), y.toFloat(), textPaint)
246246
}
247247

248-
internal fun getAccessKeySaveError() = TopBarManager.TopBarMessage(
248+
private fun getAccessKeySaveError() = TopBarManager.TopBarMessage(
249249
resources.getString(R.string.error_title_failedToSave),
250250
resources.getString(R.string.error_description_failedToSave),
251251
)
252252

253-
internal fun getDeniedError() = TopBarManager.TopBarMessage(
253+
private fun getDeniedError() = TopBarManager.TopBarMessage(
254254
resources.getString(R.string.error_title_tooManyAccounts),
255255
resources.getString(R.string.error_description_tooManyAccounts)
256256
)
257257

258-
internal fun getGenericError() = TopBarManager.TopBarMessage(
258+
private fun getGenericError() = TopBarManager.TopBarMessage(
259259
resources.getString(R.string.error_title_failedToVerifyPhone),
260260
resources.getString(R.string.error_description_failedToVerifyPhone),
261261
)

app/src/main/res/font/avenir.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.
153 KB
Binary file not shown.
63.9 KB
Binary file not shown.

app/src/main/res/font/roboto_mono.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

log.txt

Lines changed: 15345 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)