commonMain.Font.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kanvas-jvm Show documentation
Show all versions of kanvas-jvm Show documentation
A collection of drawing/charting utilities
The newest version!
package com.juul.krayon.kanvas
public const val serif: String = "serif"
public const val sansSerif: String = "sans-serif"
public const val monospace: String = "monospace"
/**
* Fonts are provided as a list of family names, in descending priority.
*
* Generally, this list should end in one of the universal family names [serif], [sansSerif], or [monospace].
*/
public data class Font(
public val names: List,
) {
public constructor(preferred: String, vararg fallback: String) : this(listOf(preferred, *fallback))
init {
require(names.isNotEmpty())
}
}