Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9b693212
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9b693212
编写于
1月 18, 2018
作者:
D
David Corbett
提交者:
Ebrahim Byagowi
1月 19, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update record-test.sh to the new directory layout (#716)
上级
461a605f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
9 deletion
+19
-9
test/shaping/README.md
test/shaping/README.md
+6
-5
test/shaping/record-test.sh
test/shaping/record-test.sh
+13
-4
未找到文件。
test/shaping/README.md
浏览文件 @
9b693212
...
...
@@ -23,18 +23,19 @@ what this does is:
*
If the outputs differ, perhaps it is because the font does not have
glyph names; it then compares the output of
`hb-view`
for both fonts.
*
If the outputs differ, recording fails. Otherwise, it will move the
subset font file into
`fonts/sha1sum`
and name it after its hash,
and prints out the test case input, which you can then redirect to
an existing or new test file in
`tests`
, eg.:
subset font file into
`data/in-house/fonts`
and name it after its
hash, and print out the test case input, which you can then redirect
to an existing or new test file in
`data/in-house/tests`
using
`-o=`
,
e.g.:
```
sh
$
./hb-unicode-encode 41 42 43 627 | ./record-test.sh
../../util/hb-shape font.ttf
>>
tests/test-name.test
$
./hb-unicode-encode 41 42 43 627 | ./record-test.sh
-o
=
data/in-house/tests/test-name.test ../../util/hb-shape font.ttf
```
If you created a new test file, add it to
`Makefile.am`
so it is run.
Check that
`make check`
does indeed run it, and that the test passes.
When everything looks good,
`git add`
the new font as well as new
test file if you created any. You can see what new files are there
by running
`git status
tests fonts/sha1sum
`
. And commit!
by running
`git status
data/in-house
`
. And commit!
*Note!*
Please only add tests using Open Source fonts, preferably under
OFL or similar license.
test/shaping/record-test.sh
浏览文件 @
9b693212
...
...
@@ -2,6 +2,11 @@
dir
=
`
mktemp
-d
`
out
=
/dev/stdout
if
test
"x
${
1
:0:3
}
"
==
'x-o='
;
then
out
=
${
1
:3
}
shift
fi
hb_shape
=
$1
shift
fontfile
=
$1
...
...
@@ -67,8 +72,8 @@ if ! test "x$glyphs" = "x$glyphs_subset"; then
echo
"
$text
"
|
$hb_view
$options
"
$dir
/font.subset.ttf"
--output-format
=
png
--output-file
=
"
$dir
/subset.png"
if
!
cmp
"
$dir
/orig.png"
"
$dir
/subset.png"
;
then
echo
"Images differ. Please inspect
$dir
/*.png."
>
&2
echo
"
$glyphs
"
echo
"
$glyphs_subset
"
echo
"
$glyphs
"
>>
"
$out
"
echo
"
$glyphs_subset
"
>>
"
$out
"
exit
2
fi
echo
"Yep; all good."
>
&2
...
...
@@ -78,7 +83,7 @@ if ! test "x$glyphs" = "x$glyphs_subset"; then
fi
sha1sum
=
`
sha1sum
"
$dir
/font.subset.ttf"
|
cut
-d
' '
-f1
`
subset
=
"
fonts/sha1sum
/
$sha1sum
.ttf"
subset
=
"
data/in-house/fonts
/
$sha1sum
.ttf"
mv
"
$dir
/font.subset.ttf"
"
$subset
"
# There ought to be an easier way to do this, but it escapes me...
...
...
@@ -89,8 +94,12 @@ echo "$glyphs" > "$glyphs_file"
# Open the "file"s
exec
3<
"
$unicodes_file
"
exec
4<
"
$glyphs_file
"
relative_subset
=
"
$subset
"
if
test
"
$out
"
!=
"/dev/stdout"
;
then
relative_subset
=
"
$(
/usr/bin/python
-c
'import os, sys; print (os.path.relpath (sys.argv[1], sys.argv[2]))'
"
$subset
"
"
$(
dirname
"
$out
"
)
"
)
"
fi
while
read
uline <&3
&&
read
gline <&4
;
do
echo
"
$
subset
:
$options
:
$uline
:
$gline
"
echo
"
$
relative_subset
:
$options
:
$uline
:
$gline
"
>>
"
$out
"
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录