1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package androidx.compose.ui.text.font
17 
18 /**
19  * Defines whether the font is [Italic] or [Normal].
20  *
21  * @see Font
22  * @see FontFamily
23  */
24 @kotlin.jvm.JvmInline
25 value class FontStyle
26 @Deprecated(
27     "Please use FontStyle.Normal or FontStyle.Italic",
28     replaceWith = ReplaceWith("FontStyle.")
29 )
30 constructor(val value: Int) {
31 
toStringnull32     override fun toString(): String {
33         return when (this) {
34             Normal -> "Normal"
35             Italic -> "Italic"
36             else -> "Invalid"
37         }
38     }
39 
40     companion object {
41         /** Use the upright glyphs */
42         @Suppress("DEPRECATION") val Normal = FontStyle(0)
43 
44         /** Use glyphs designed for slanting */
45         @Suppress("DEPRECATION") val Italic = FontStyle(1)
46 
47         /** Returns a list of possible values of [FontStyle]. */
valuesnull48         fun values(): List<FontStyle> = listOf(Normal, Italic)
49     }
50 }
51