commonMain.jetbrains.datalore.base.values.Font.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lets-plot-common Show documentation
Show all versions of lets-plot-common Show documentation
Lets-Plot JVM package without rendering part
/*
* Copyright (c) 2019. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package jetbrains.datalore.base.values
import kotlin.jvm.JvmOverloads
class Font @JvmOverloads constructor(val family: FontFamily, val size: Int, val isBold: Boolean = false, val isItalic: Boolean = false) {
override fun toString(): String {
return "$family $size ${if (isBold) "bold" else ""} ${if (isItalic) "italic" else ""}"
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Font) return false
return family === other.family &&
size == other.size &&
isBold == other.isBold &&
isItalic == other.isItalic
}
override fun hashCode(): Int {
var result = family.hashCode()
result = 31 * result + size
result = 31 * result + if (isBold) 1 else 0
result = 31 * result + if (isItalic) 1 else 0
return result
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy