Skip to content

Commit

Permalink
avgCharWidth is 0f on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeevPavel committed Oct 4, 2023
1 parent 7652b31 commit e870fcc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion skiko/src/commonTest/kotlin/org/jetbrains/skia/FontTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import kotlin.test.assertEquals
private fun isMac() = (hostOs == OS.MacOS)
private fun isIos() = (hostOs == OS.Ios)
private fun isLinux() = (hostOs == OS.Linux)
private fun isWindows() = (hostOs == OS.Windows)
private fun isJs() = (kotlinBackend == KotlinBackend.JS)
private val COARSE_EPSILON = 2.4f

Expand Down Expand Up @@ -97,7 +98,12 @@ class FontTests {
descent = 3.2400002f,
bottom = 3.2400002f,
leading = 0f,
avgCharWidth = if ((isIos() || isMac()) && !isJs()) 29.460001f else 7.2000003f,
avgCharWidth = when {
isJs() -> 7.2f
isIos() || isMac() -> 29.460001f
isWindows() -> 0f
else -> 7.2f
},
maxCharWidth = 29.460001f,
xMin = -20.880001f,
xMax = 8.58f,
Expand Down

0 comments on commit e870fcc

Please sign in to comment.