Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.jetbrains.skia.Data
import org.jetbrains.skia.FontMgr
import org.jetbrains.skia.FontSlant
import org.jetbrains.skia.FontStyle as SkFontStyle
import org.jetbrains.skia.FontWeight as SkFontWeight
import org.jetbrains.skia.FontWidth
import org.jetbrains.skia.Typeface as SkTypeface

Expand Down Expand Up @@ -226,7 +227,7 @@ private fun typefaceResource(resourceName: String): SkTypeface {

private val Font.skFontStyle: SkFontStyle
get() = SkFontStyle(
weight = weight.weight,
weight = SkFontWeight(weight.weight),
width = FontWidth.NORMAL,
slant = if (style == FontStyle.Italic) FontSlant.ITALIC else FontSlant.UPRIGHT
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal object JetBrainsRuntimeFontFamilies {
// We need to parse the typeface to extract its weight and style
val typeface = FontMgr.default.makeFromFile(absolutePath)
?: error("makeFromFile $absolutePath failed")
val weight = FontWeight(typeface.fontStyle.weight)
val weight = FontWeight(typeface.fontStyle.weight.value)
val style = when (typeface.fontStyle.slant) {
FontSlant.UPRIGHT -> FontStyle.Normal
FontSlant.ITALIC, FontSlant.OBLIQUE -> FontStyle.Italic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import kotlin.experimental.ExperimentalNativeApi
import org.jetbrains.skia.Data
import org.jetbrains.skia.FontMgr
import org.jetbrains.skia.FontSlant
import org.jetbrains.skia.FontWeight
import org.jetbrains.skia.FontWidth

@OptIn(ExperimentalTextApi::class)
Expand All @@ -45,7 +46,7 @@ internal actual fun loadTypeface(font: Font): SkTypeface {

private val Font.skFontStyle: SkFontStyle
get() = SkFontStyle(
weight = weight.weight,
weight = FontWeight(weight.weight),
width = FontWidth.NORMAL,
slant = if (style == FontStyle.Italic) FontSlant.ITALIC else FontSlant.UPRIGHT
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.ui.text.font.FontStyle
import org.jetbrains.skia.Data
import org.jetbrains.skia.FontMgr
import org.jetbrains.skia.FontSlant
import org.jetbrains.skia.FontWeight
import org.jetbrains.skia.FontWidth
import org.jetbrains.skiko.OS
import org.jetbrains.skiko.hostOs
Expand All @@ -41,7 +42,7 @@ internal actual fun loadTypeface(font: Font): SkTypeface {

private val Font.skFontStyle: SkFontStyle
get() = SkFontStyle(
weight = weight.weight,
weight = FontWeight(weight.weight),
width = FontWidth.NORMAL,
slant = if (style == FontStyle.Italic) FontSlant.ITALIC else FontSlant.UPRIGHT
)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protobuf = "4.28.2"
paparazzi = "1.0.0"
paparazziNative = "2022.1.1-canary-f5f9f71"
shadow = "8.1.1"
skiko = "0.150.0"
skiko = "0.151.0"
spdxGradlePlugin = "0.6.0"
sqldelight = "1.3.0"
retrofit = "2.12.0"
Expand Down