1 /*
2  * Copyright (c) 2020-2022 Huawei Device Co., Ltd.
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 UI_TEST_FONT_H
17 #define UI_TEST_FONT_H
18 
19 #include "components/ui_scroll_view.h"
20 #include "font/ui_font.h"
21 #include "ui_test.h"
22 
23 namespace OHOS {
24 class UITestFont : public UITest {
25 public:
UITestFont()26     UITestFont() {}
~UITestFont()27     ~UITestFont() {}
28     void SetUp() override;
29     void TearDown() override;
30     const UIView* GetTestView() override;
31 
32     /**
33      * @brief Test single line Chinese display
34      */
35     void UIKitFontTestDisplay001();
36 
37     /**
38      * @brief Test multiline Chinese display
39      */
40     void UIKitFontTestDisplay002();
41 
42     /**
43      * @brief Test single line English display
44      */
45     void UIKitFontTestDisplay003();
46 
47     /**
48      * @brief Test multiline English display
49      */
50     void UIKitFontTestDisplay004();
51 
52     /**
53      * @brief Test single line Chinese and English display
54      */
55     void UIKitFontTestDisplay005();
56 
57     /**
58      * @brief Test multiline Chinese and English display
59      */
60     void UIKitFontTestDisplay006();
61 
62     /**
63      * @brief Test single line text color display
64      */
65     void UIKitFontTestDisplay007();
66 
67     /**
68      * @brief Test multiline line text color display
69      */
70     void UIKitFontTestDisplay008();
71 
72     /**
73      * @brief Test text rotate
74      */
75     void UIKitFontTestDisplay009();
76 
77     /**
78      * @brief Test text rotate
79      */
80     void UIKitFontTestDisplay010();
81 
82     /**
83      * @brief Test font baseline alignment
84      */
85     void UIKitFontTestBaseline001();
86 
87     /**
88      * @brief Test font baseline alignment
89      */
90     void UIKitFontTestBaseline002();
91 
92     /**
93      * @brief Test font lineheight alignment
94      */
95     void UIKitFontTestLineHeight001();
96 
97     /**
98      * @brief Test font lineheight alignment
99      */
100     void UIKitFontTestLineHeight002();
101 
102 #if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
103     /**
104      * @brief Test multilingual display
105      */
106     void UIKitFontMultiLanguage001();
107 
108     /**
109      * @brief Test multilingual display
110      */
111     void UIKitFontMultiLanguage002();
112 #endif // ENABLE_MULTI_FONT
113 
114     /**
115      * @brief Test font background color display
116      */
117     void UIKitFontTestBackgroundColor();
118 
119     /**
120      * @brief Test font foreground color display
121      */
122     void UIKitFontTestForegroundColor();
123 
124     /**
125      * @brief Test font line background color display
126      */
127     void UIKitFontTestLineBackgroundSpan();
128 
129     /**
130      * @brief Test font absolute size display
131      */
132     void UIKitFontTestAbsoluteSizeSpan();
133 
134     /**
135      * @brief Test font relative size display
136      */
137     void UIKitFontTestRelativeSizeSpan();
138 
139     /**
140      * @brief Test line Emoji display
141      */
142     void UIKitFontTestDisplayEmoji001();
143 
144     /**
145      * @brief Test Emoji and Text display
146      */
147     void UIKitFontTestDisplayEmoji002();
148 
149     /**
150      * @brief Test Emoji and Text line break display
151      */
152     void UIKitFontTestDisplayEmoji003();
153 
154      /**
155      * @brief Test single line with negative lineSpace display
156      */
157     void UIKitFontTestDisplayNegativeLineSpace001();
158 
159     /**
160      * @brief Test multi line with negative lineSpace display
161      */
162     void UIKitFontTestDisplayNegativeLineSpace002();
163 private:
164     UIScrollView* container_ = nullptr;
165     void InnerTestTitle(const char* title);
166 };
167 } // namespace OHOS
168 #endif // UI_TEST_FONT_H
169