1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd.. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ROSEN_MODULES_SPTEXT_TEXT_TYPES_H 17 #define ROSEN_MODULES_SPTEXT_TEXT_TYPES_H 18 19 namespace OHOS { 20 namespace Rosen { 21 namespace SPText { 22 // FontStyle is font italic style. 23 enum class FontStyle { 24 NORMAL, 25 ITALIC, 26 OBLIQUE, 27 }; 28 29 // FontWeight is font weight style. 30 enum class FontWeight { 31 W100 = 0, // weight value 100 thin. 32 W200 = 1, // weight value 200. 33 W300 = 2, // weight value 300. 34 W400 = 3, // weight value 400 normal. 35 W500 = 4, // weight value 500. 36 W600 = 5, // weight value 600. 37 W700 = 6, // weight value 700 bold. 38 W800 = 7, // weight value 800. 39 W900 = 8, // weight value 900. 40 }; 41 42 // FontWidth is font width style. 43 enum class FontWidth { 44 ULTRA_CONDENSED = 1, 45 EXTRA_CONDENSED = 2, 46 CONDENSED = 3, 47 SEMI_CONDENSED = 4, 48 NORMAL = 5, 49 SEMI_EXPANDED = 6, 50 EXPANDED = 7, 51 EXTRA_EXPANDED = 8, 52 ULTRA_EXPANDED = 9, 53 }; 54 55 // TextAlign is text alignment style. 56 enum class TextAlign { 57 LEFT, 58 RIGHT, 59 CENTER, 60 JUSTIFY, 61 START, 62 END, 63 }; 64 65 // TextBaseline is text baseline style. 66 enum class TextBaseline { 67 ALPHABETIC, 68 IDEOGRAPHIC, 69 }; 70 71 // TextDecoration is text decoration style. 72 // Use bit fields for storage. 73 enum class TextDecoration { 74 NONE = 0X0, 75 UNDERLINE = 0X1, 76 OVERLINE = 0X2, 77 LINETHROUGH = 0X4, 78 }; 79 80 // TextDecorationStyle is decoration line style. 81 enum class TextDecorationStyle { 82 SOLID, 83 DOUBLE, 84 DOTTED, 85 DASHED, 86 WAVY, 87 }; 88 89 // TextDirection is text direction style. 90 enum class TextDirection { 91 RTL, 92 LTR, 93 }; 94 95 // Adjusts the leading over and under text. 96 enum TextHeightBehavior { 97 ALL = 0X0, 98 DISABLE_FIRST_ASCENT = 0X1, 99 DISABLE_LAST_DESCENT = 0X2, 100 DISABLE_ALL = 0X1 | 0X2, 101 }; 102 103 //Add different mode ellipses in the appropriate position of the text 104 enum class EllipsisModal { 105 HEAD = 0, 106 MIDDLE = 1, 107 TAIL = 2, 108 }; 109 } // namespace SPText 110 } // namespace Rosen 111 } // namespace OHOS 112 113 #endif // ROSEN_MODULES_SPTEXT_TEXT_TYPES_H 114