Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d2123d

Browse files
wezmbrawer
authored andcommitted
Add Allsorts engine
1 parentfb3764c commit9d2123d

File tree

3 files changed

+7551
-4
lines changed

3 files changed

+7551
-4
lines changed

‎README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ display text, so we founded this project to help implementations to
77
get this right.
88

99
```bash
10-
$ brew install cmake ninja npm
10+
$ brew install cmake ninja npm rust
1111
$ git clone --recursive https://github.com/unicode-org/text-rendering-tests.git
1212
$cd text-rendering-tests
13-
$forenginein CoreText FreeStack TehreerStack fontkit OpenType.js;do python check.py --engine=$engine --output=reports/$engine.html;done
13+
$forenginein CoreText FreeStack TehreerStack fontkit OpenType.jsAllsorts;do python check.py --engine=$engine --output=reports/$engine.html;done
1414
```
1515

1616

@@ -43,6 +43,10 @@ text rendering stack consisting of [FreeType](https://www.freetype.org/),
4343
* With`--engine=OpenType.js`, the tests are run using[OpenType.js](https://github.com/nodebox/opentype.js), another JavaScript font engine.
4444
[Test report for OpenType.js](https://rawgit.com/unicode-org/text-rendering-tests/master/reports/OpenType.js.html).
4545

46+
* With`--engine=Allsorts`, the tests are run using[Allsorts](https://github.com/yeslogic/allsorts),
47+
a parsing and shaping engine implemented in[Rust](https://www.rust-lang.org/).
48+
[Test report for Allsorts](https://rawgit.com/unicode-org/text-rendering-tests/master/reports/Allsorts.html).
49+
4650
It’s trivial to test other implementations; simply write a small
4751
wrapper tool. For the[Go font
4852
library](https://godoc.org/golang.org/x/image/font/sfnt), see

‎check.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def __init__(self, engine):
3636
self.command='node_modules/opentype.js/bin/test-render'
3737
elifself.engine=='fontkit':
3838
self.command='src/third_party/fontkit/render'
39+
elifself.engine=='Allsorts':
40+
self.command='src/third_party/allsorts/allsorts-tools/target/release/allsorts'
3941
else:
4042
self.command='build/fonttest/fonttest'
4143
self.datestr=self.make_datestr()
@@ -44,7 +46,7 @@ def __init__(self, engine):
4446
self.observed= {}# testcase --> SVG ElementTree
4547

4648
defget_version(self):
47-
ifself.enginein {'CoreText','FreeStack','TehreerStack'}:
49+
ifself.enginein {'CoreText','FreeStack','TehreerStack','Allsorts'}:
4850
returnsubprocess.check_output([self.command,'--version',
4951
'--engine='+self.engine])
5052
ifself.enginein ('OpenType.js','fontkit'):
@@ -206,6 +208,8 @@ def run_command(cmd, timeout_sec):
206208
defbuild(engine):
207209
ifengine=='OpenType.js'orengine=='fontkit':
208210
subprocess.check_call(['npm','install'])
211+
elifengine=='Allsorts':
212+
subprocess.check_call(['cargo','build','--release','--manifest-path','src/third_party/allsorts/allsorts-tools/Cargo.toml'])
209213
else:
210214
ifnotos.path.exists('build'):os.mkdir('build')
211215
subprocess.check_call(['cmake','-GNinja','../src'],cwd='build')
@@ -217,7 +221,7 @@ def main():
217221
etree.register_namespace('xlink','http://www.w3.org/1999/xlink')
218222
parser=argparse.ArgumentParser()
219223
parser.add_argument('--engine',
220-
choices=['FreeStack','TehreerStack','CoreText','DirectWrite','OpenType.js','fontkit'],
224+
choices=['FreeStack','TehreerStack','CoreText','DirectWrite','OpenType.js','fontkit','Allsorts'],
221225
default='FreeStack')
222226
parser.add_argument('--output',help='path to report file being written')
223227
args=parser.parse_args()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp