Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
caa2df44
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看板
未验证
提交
caa2df44
编写于
6月 12, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 12, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8963 text-span font xts测试
Merge pull request !8963 from huangdong/master
上级
24d40e0c
66f30009
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
1784 addition
and
2 deletion
+1784
-2
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/textSpanFont.ets
...ompletion/src/main/ets/TestAbility/pages/textSpanFont.ets
+183
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
...component_wholeCompletion/src/main/ets/test/List.test.ets
+3
-1
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/textSpanFont.test.ets
...t_wholeCompletion/src/main/ets/test/textSpanFont.test.ets
+1596
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
...ompletion/src/main/resources/base/profile/test_pages.json
+2
-1
未找到文件。
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/textSpanFont.ets
0 → 100644
浏览文件 @
caa2df44
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import font from '@ohos.font';
@Entry
@Component
struct textSpanFont {
aboutToAppear(){
font.registerFont({
familyName: 'zidingyi',
familySrc: "./bohehaiyan.ttf"
})
}
build() {
Scroll(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text('修改字重为0').font({weight: 0, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0100")
Text('修改字重为默认值').font({weight: FontWeight.Normal, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0200")
Text('修改字重为100').font({weight: 100, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0300")
Text('修改字重为900').font({weight: 900, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0400")
Text('修改字重为700').font({weight: "700", size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0500")
Text('修改字重为FontWeight.Bolder').font({weight: FontWeight.Bolder, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0600")
Text('修改字重为1000').font({weight: 1000, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0700")
Text('修改字重为undefined').font({weight: undefined, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0800")
Text('修改字重为-1').font({weight: -1, size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_0900")
Text('修改字重为""').font({weight: "", size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_1000")
Text('修改字重为乱码').font({weight: " % ", size: 16}).key("ArkUX_Stage_Text_Font_FontWeight_1100")
Text('修改字重为FontWeight.Normal').font({weight: FontWeight.Normal,size: 16,style:undefined}).key("ArkUX_Stage_Text_Font_FontWeight_1200")
Text() {
Span('修改字重为0').font({weight: 0, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0100")
}
Text() {
Span('修改字重为默认值').font({weight: FontWeight.Normal, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0200")
}
Text() {
Span('修改字重为100').font({weight: 100, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0300")
}
Text() {
Span('修改字重为900').font({weight: 900, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0400")
}
Text() {
Span('修改字重为700').font({weight: "700", size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0500")
}
Text() {
Span('修改字重为FontWeight.Bolder').font({weight: FontWeight.Bolder, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0600")
}
Text() {
Span('修改字重为1000').font({weight: 1000, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0700")
}
Text() {
Span('修改字重为undefined').font({weight: undefined, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0800")
}
Text() {
Span('修改字重为-1').font({weight: -1, size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_0900")
}
Text() {
Span('修改字重为""').font({weight: "", size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_1000")
}
Text() {
Span('修改字重为乱码').font({weight: " % ", size: 16}).key("ArkUX_Stage_Span_Font_FontWeight_1100")
}
Text() {
Span('修改字重为FontWeight.Normal').font({weight: FontWeight.Normal,size: 16,style:undefined}).key("ArkUX_Stage_Span_Font_FontWeight_1200")
}
Text('修改字号为0').font({size: 0}).key("ArkUX_Stage_Text_Font_FontSize_0100")
Text('修改字号为默认值').font({size: 16}).key("ArkUX_Stage_Text_Font_FontSize_0200")
Text('修改字号为30px').font({size: "30px"}).key("ArkUX_Stage_Text_Font_FontSize_0300")
Text('修改字号为30fp').font({size: "30vp"}).key("ArkUX_Stage_Text_Font_FontSize_0400")
Text('修改字号为30lpx').font({size: "30lpx"}).key("ArkUX_Stage_Text_Font_FontSize_0500")
Text('修改字号为30%').font({size: "30%"}).key("ArkUX_Stage_Text_Font_FontSize_0600")
Text('修改字号为-1').font({size: -1}).key("ArkUX_Stage_Text_Font_FontSize_0700")
Text('修改字号为""').font({size: ""}).key("ArkUX_Stage_Text_Font_FontSize_0800")
Text('修改字号为乱码').font({size: " % "}).key("ArkUX_Stage_Text_Font_FontSize_0900")
Text('修改字号为20').font({size: 20,weight: undefined}).key("ArkUX_Stage_Text_Font_FontSize_1000")
Text() {
Span('修改字号为0').font({size: 0}).key("ArkUX_Stage_Span_Font_FontSize_0100")
}
Text() {
Span('修改字号为默认值').font({size: 16}).key("ArkUX_Stage_Span_Font_FontSize_0200")
}
Text() {
Span('修改字号为30px').font({size: "30px"}).key("ArkUX_Stage_Span_Font_FontSize_0300")
}
Text() {
Span('修改字号为30fp').font({size: "30vp"}).key("ArkUX_Stage_Span_Font_FontSize_0400")
}
Text() {
Span('修改字号为30lpx').font({size: "30lpx"}).key("ArkUX_Stage_Span_Font_FontSize_0500")
}
Text() {
Span('修改字号为30%').font({size: "30%"}).key("ArkUX_Stage_Span_Font_FontSize_0600")
}
Text() {
Span('修改字号为-1').font({size: -1}).key("ArkUX_Stage_Span_Font_FontSize_0700")
}
Text() {
Span('修改字号为""').font({size: ""}).key("ArkUX_Stage_Span_Font_FontSize_0800")
}
Text() {
Span('修改字号为乱码').font({size: " % "}).key("ArkUX_Stage_Span_Font_FontSize_0900")
}
Text() {
Span('修改字号为20').font({size: 20,weight: undefined}).key("ArkUX_Stage_Span_Font_FontSize_1000")
}
Text('修改字体样式为FontStyle.Italic').font({style: FontStyle.Italic,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0100")
Text('修改字体样式为默认值').font({style: FontStyle.Normal,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0200")
Text('修改字体样式为1').font({style: 1,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0300")
Text('修改字体样式为undefined').font({style: undefined,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0400")
Text('修改字体样式为-1').font({style: -1,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0500")
Text('修改字体样式为FontStyle.Italic').font({style: FontStyle.Italic,weight: undefined,size: 16}).key("ArkUX_Stage_Text_Font_FontStyle_0600")
Text() {
Span('修改字体样式为FontStyle.Italic').font({style: FontStyle.Italic,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0100")
}
Text() {
Span('修改字体样式为默认值').font({style: FontStyle.Normal,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0200")
}
Text() {
Span('修改字体样式为1').font({style: 1,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0300")
}
Text() {
Span('修改字体样式为undefined').font({style: undefined,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0400")
}
Text() {
Span('修改字体样式为-1').font({style: -1,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0500")
}
Text() {
Span('修改字体样式为FontStyle.Italic').font({style: FontStyle.Italic,weight: undefined,size: 16}).key("ArkUX_Stage_Span_Font_FontStyle_0600")
}
Text('修改字体列表为自定义的字体').font({family: 'zidingyi',size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0100")
Text('修改字体列表为默认值').font({family: 'HarmonyOS Sans',size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0200")
Text('修改字体列表为null').font({family: null,size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0300")
Text('修改字体列表为undefined').font({family: undefined,size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0400")
Text('修改字体列表为""').font({family: "",size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0500")
Text('修改字体列表为HarmonyOS Sans').font({family: 'HarmonyOS Sans',weight: undefined,size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0600")
Text('修改字体列表为“Arial, sans-serif”').font({family: 'Arial, sans-serif',size: 16}).key("ArkUX_Stage_Text_Font_FontFamily_0700")
Text() {
Span('修改字体列表为自定义的字体').font({family: 'zidingyi',size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0100")
}
Text() {
Span('修改字体列表为默认值').font({family: 'HarmonyOS Sans',size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0200")
}
Text() {
Span('修改字体列表为null').font({family: null,size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0300")
}
Text() {
Span('修改字体列表为undefined').font({family: undefined,size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0400")
}
Text() {
Span('修改字体列表为""').font({family: "",size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0500")
}
Text() {
Span('修改字体列表为HarmonyOS Sans').font({family: 'HarmonyOS Sans',weight: undefined,size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0600")
}
Text() {
Span('修改字体列表为“Arial, sans-serif”').font({family: 'Arial, sans-serif',size: 16}).key("ArkUX_Stage_Span_Font_FontFamily_0700")
}
}.width("100%")
}.width("100%").height("80%")
}
}
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
浏览文件 @
caa2df44
...
...
@@ -29,7 +29,8 @@ import hoverTest from './hover.test';
import textObscuredTest from './textObscuredTest.test';
import imageObscuredTest from './imageObscuredTest.test';
import stageAnimatorTest from './stageAnimator.test';
import navigationTypeTest from './navigationType.test'
import navigationTypeTest from './navigationType.test';
import textSpanFontTest from './textSpanFont.test';
export default function testsuite() {
stageFontTest()
...
...
@@ -49,4 +50,5 @@ export default function testsuite() {
imageObscuredTest()
stageAnimatorTest()
navigationTypeTest()
textSpanFontTest()
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/textSpanFont.test.ets
0 → 100644
浏览文件 @
caa2df44
此差异已折叠。
点击以展开。
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
浏览文件 @
caa2df44
...
...
@@ -18,6 +18,7 @@
"TestAbility/pages/textObscured"
,
"TestAbility/pages/imageObscuredTest"
,
"TestAbility/pages/stageAnimator"
,
"TestAbility/pages/navigationType"
"TestAbility/pages/navigationType"
,
"TestAbility/pages/textSpanFont"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录