Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
266630c9
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
266630c9
编写于
7月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9355 回退字体提交
Merge pull request !9355 from huangzejia/revert_0716
上级
e948daa8
f94d0e55
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
47 deletion
+46
-47
graphic/graphicnapidrawingtest/BUILD.gn
graphic/graphicnapidrawingtest/BUILD.gn
+0
-1
graphic/graphicnapidrawingtest/OH_Drawing_TypographyTest.cpp
graphic/graphicnapidrawingtest/OH_Drawing_TypographyTest.cpp
+46
-46
未找到文件。
graphic/graphicnapidrawingtest/BUILD.gn
浏览文件 @
266630c9
...
@@ -41,7 +41,6 @@ ohos_moduletest_suite("ActsGraphicNapiDrawingTest") {
...
@@ -41,7 +41,6 @@ ohos_moduletest_suite("ActsGraphicNapiDrawingTest") {
include_dirs = [
include_dirs = [
"$comPath/rosen/modules/2d_engine",
"$comPath/rosen/modules/2d_engine",
"$comPath/rosen/modules/2d_engine/rosen_text/export",
"//third_party/googletest/googletest/include",
"//third_party/googletest/googletest/include",
]
]
...
...
graphic/graphicnapidrawingtest/OH_Drawing_TypographyTest.cpp
浏览文件 @
266630c9
...
@@ -20,10 +20,10 @@
...
@@ -20,10 +20,10 @@
#include "c/drawing_font_collection.h"
#include "c/drawing_font_collection.h"
#include "c/drawing_text_declaration.h"
#include "c/drawing_text_declaration.h"
#include "c/drawing_text_typography.h"
#include "c/drawing_text_typography.h"
#include "rosen_text/typography.h"
#include "rosen_text/
ui/
typography.h"
#include "rosen_text/typography_create.h"
#include "rosen_text/
ui/
typography_create.h"
using
namespace
OHOS
::
R
osen
;
using
namespace
r
osen
;
using
namespace
testing
;
using
namespace
testing
;
using
namespace
testing
::
ext
;
using
namespace
testing
::
ext
;
...
@@ -62,11 +62,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest002, TestSize.Level
...
@@ -62,11 +62,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest002, TestSize.Level
{
{
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
TEXT_DIRECTION_LTR
);
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
TEXT_DIRECTION_LTR
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
,
TextDirection
::
LTR
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
_
,
TextDirection
::
LTR
);
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
TEXT_DIRECTION_RTL
);
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
TEXT_DIRECTION_RTL
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
,
TextDirection
::
RTL
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
_
,
TextDirection
::
RTL
);
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
-
1
);
OH_Drawing_SetTypographyTextDirection
(
typoStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
,
TextDirection
::
LTR
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textDirection
_
,
TextDirection
::
LTR
);
}
}
/*
/*
...
@@ -78,19 +78,19 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest003, TestSize.Level
...
@@ -78,19 +78,19 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest003, TestSize.Level
{
{
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_LEFT
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_LEFT
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
LEFT
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
LEFT
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_RIGHT
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_RIGHT
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
RIGHT
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
RIGHT
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_CENTER
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_CENTER
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
CENTER
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
CENTER
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_JUSTIFY
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_JUSTIFY
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
JUSTIFY
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
JUSTIFY
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_START
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_START
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
START
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
START
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_END
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
TEXT_ALIGN_END
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
END
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
END
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
-
1
);
OH_Drawing_SetTypographyTextAlign
(
typoStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
,
TextAlign
::
LEFT
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
textAlign
_
,
TextAlign
::
LEFT
);
}
}
/*
/*
...
@@ -102,9 +102,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest004, TestSize.Level
...
@@ -102,9 +102,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest004, TestSize.Level
{
{
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_TypographyStyle
*
typoStyle
=
OH_Drawing_CreateTypographyStyle
();
OH_Drawing_SetTypographyTextMaxLines
(
typoStyle
,
100
);
OH_Drawing_SetTypographyTextMaxLines
(
typoStyle
,
100
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
maxLines
,
100
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
maxLines
_
,
100
);
OH_Drawing_SetTypographyTextMaxLines
(
typoStyle
,
200
);
OH_Drawing_SetTypographyTextMaxLines
(
typoStyle
,
200
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
maxLines
,
200
);
EXPECT_EQ
(
ConvertToOriginalText
(
typoStyle
)
->
maxLines
_
,
200
);
}
}
/*
/*
...
@@ -129,13 +129,13 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest006, TestSize.Level
...
@@ -129,13 +129,13 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest006, TestSize.Level
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
// black
// black
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0x00
));
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0x00
));
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
,
0xFF000000
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
_
,
0xFF000000
);
// red
// red
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0xFF
,
0x00
,
0x00
));
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0xFF
,
0x00
,
0x00
));
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
,
0xFFFF0000
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
_
,
0xFFFF0000
);
// blue
// blue
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0xFF
));
OH_Drawing_SetTextStyleColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0xFF
));
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
,
0xFF0000FF
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
color
_
,
0xFF0000FF
);
}
}
/*
/*
...
@@ -147,9 +147,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest007, TestSize.Level
...
@@ -147,9 +147,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest007, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleFontSize
(
txtStyle
,
80
);
OH_Drawing_SetTextStyleFontSize
(
txtStyle
,
80
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontSize
,
80
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontSize
_
,
80
);
OH_Drawing_SetTextStyleFontSize
(
txtStyle
,
40
);
OH_Drawing_SetTextStyleFontSize
(
txtStyle
,
40
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontSize
,
40
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontSize
_
,
40
);
}
}
/*
/*
...
@@ -161,25 +161,25 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest008, TestSize.Level
...
@@ -161,25 +161,25 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest008, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_100
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_100
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W100
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W100
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_200
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_200
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W200
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W200
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_300
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_300
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W300
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W300
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_400
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_400
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W400
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W400
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_500
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_500
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W500
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W500
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_600
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_600
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W600
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W600
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_700
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_700
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W700
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W700
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_800
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_800
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W800
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W800
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_900
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
FONT_WEIGHT_900
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W900
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W900
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
-
1
);
OH_Drawing_SetTextStyleFontWeight
(
txtStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
,
FontWeight
::
W400
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontWeight
_
,
FontWeight
::
W400
);
}
}
/*
/*
...
@@ -191,11 +191,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest009, TestSize.Level
...
@@ -191,11 +191,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest009, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
TEXT_BASELINE_ALPHABETIC
);
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
TEXT_BASELINE_ALPHABETIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
baseline
,
TextBaseline
::
ALPHABETIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
textBaseline_
,
TextBaseline
::
ALPHABETIC
);
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
TEXT_BASELINE_IDEOGRAPHIC
);
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
TEXT_BASELINE_IDEOGRAPHIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
baseline
,
TextBaseline
::
IDEOGRAPHIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
textBaseline_
,
TextBaseline
::
IDEOGRAPHIC
);
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
-
1
);
OH_Drawing_SetTextStyleBaseLine
(
txtStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
baseline
,
TextBaseline
::
ALPHABETIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
textBaseline_
,
TextBaseline
::
ALPHABETIC
);
}
}
/*
/*
...
@@ -207,15 +207,15 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest010, TestSize.Level
...
@@ -207,15 +207,15 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest010, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_NONE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_NONE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
,
TextDecoration
::
NONE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
_
,
TextDecoration
::
NONE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_UNDERLINE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_UNDERLINE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
,
TextDecoration
::
UNDERLINE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
_
,
TextDecoration
::
UNDERLINE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_OVERLINE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_OVERLINE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
,
TextDecoration
::
OVERLINE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
_
,
TextDecoration
::
OVERLINE
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_LINE_THROUGH
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
TEXT_DECORATION_LINE_THROUGH
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
,
TextDecoration
::
LINE_
THROUGH
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
_
,
TextDecoration
::
LINE
THROUGH
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
-
1
);
OH_Drawing_SetTextStyleDecoration
(
txtStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
,
TextDecoration
::
NONE
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decoration
_
,
TextDecoration
::
NONE
);
}
}
/*
/*
...
@@ -227,9 +227,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest011, TestSize.Level
...
@@ -227,9 +227,9 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest011, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleDecorationColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0x00
));
OH_Drawing_SetTextStyleDecorationColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0x00
,
0x00
,
0x00
));
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decorationColor
,
0xFF000000
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decorationColor
_
,
0xFF000000
);
OH_Drawing_SetTextStyleDecorationColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0xFF
,
0x00
,
0x00
));
OH_Drawing_SetTextStyleDecorationColor
(
txtStyle
,
OH_Drawing_ColorSetArgb
(
0xFF
,
0xFF
,
0x00
,
0x00
));
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decorationColor
,
0xFFFF0000
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
decorationColor
_
,
0xFFFF0000
);
}
}
/*
/*
...
@@ -241,7 +241,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest012, TestSize.Level
...
@@ -241,7 +241,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest012, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleFontHeight
(
txtStyle
,
0.0
);
OH_Drawing_SetTextStyleFontHeight
(
txtStyle
,
0.0
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
height
Scale
,
0.0
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
height
_
,
0.0
);
}
}
/*
/*
...
@@ -255,7 +255,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest013, TestSize.Level
...
@@ -255,7 +255,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest013, TestSize.Level
const
char
*
fontFamilies
[]
=
{
"Roboto"
};
const
char
*
fontFamilies
[]
=
{
"Roboto"
};
OH_Drawing_SetTextStyleFontFamilies
(
txtStyle
,
1
,
fontFamilies
);
OH_Drawing_SetTextStyleFontFamilies
(
txtStyle
,
1
,
fontFamilies
);
std
::
vector
<
std
::
string
>
fontFamiliesResult
=
{
"Roboto"
};
std
::
vector
<
std
::
string
>
fontFamiliesResult
=
{
"Roboto"
};
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontFamilies
,
fontFamiliesResult
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontFamilies
_
,
fontFamiliesResult
);
}
}
/*
/*
...
@@ -267,11 +267,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest014, TestSize.Level
...
@@ -267,11 +267,11 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest014, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
FONT_STYLE_NORMAL
);
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
FONT_STYLE_NORMAL
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
,
FontStyle
::
NORMAL
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
_
,
FontStyle
::
NORMAL
);
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
FONT_STYLE_ITALIC
);
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
FONT_STYLE_ITALIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
,
FontStyle
::
ITALIC
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
_
,
FontStyle
::
ITALIC
);
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
-
1
);
OH_Drawing_SetTextStyleFontStyle
(
txtStyle
,
-
1
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
,
FontStyle
::
NORMAL
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
fontStyle
_
,
FontStyle
::
NORMAL
);
}
}
/*
/*
...
@@ -283,7 +283,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest015, TestSize.Level
...
@@ -283,7 +283,7 @@ HWTEST_F(OH_Drawing_TypographyTest, OH_Drawing_TypographyTest015, TestSize.Level
{
{
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_TextStyle
*
txtStyle
=
OH_Drawing_CreateTextStyle
();
OH_Drawing_SetTextStyleLocale
(
txtStyle
,
"en"
);
OH_Drawing_SetTextStyleLocale
(
txtStyle
,
"en"
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
locale
,
"en"
);
EXPECT_EQ
(
ConvertToOriginalText
(
txtStyle
)
->
locale
_
,
"en"
);
}
}
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录