Home | History | Annotate | only in /external/harfbuzz_ng/test/shaping
Up to higher level directory
NameDateSize
fonts/06-Dec-2016
hb-diff06-Dec-2016227
hb-diff-colorize06-Dec-2016253
hb-diff-filter-failures06-Dec-2016166
hb-diff-ngrams06-Dec-2016110
hb-diff-stat06-Dec-2016108
hb-manifest-read06-Dec-2016156
hb-manifest-update06-Dec-2016128
hb-unicode-decode06-Dec-2016130
hb-unicode-encode06-Dec-2016134
hb-unicode-prettyname06-Dec-2016175
hb_test_tools.py06-Dec-201612.8K
Makefile.am06-Dec-20161.8K
README.md06-Dec-20161.8K
record-test.sh06-Dec-20162.4K
run-tests.sh06-Dec-20161.1K
tests/06-Dec-2016
texts/06-Dec-2016

README.md

      1 Adding tests
      2 ============
      3 
      4 You can test shaping of a unicode sequence against a font like this:
      5 ```sh
      6 $ ./hb-unicode-encode 41 42 43 627 | ../../util/hb-shape font.ttf
      7 ```
      8 assuming an in-tree build.  The 41 42 43 627 here is a sequence of
      9 Unicode codepoints: U+0041,0042,0043,0627.  When you are happy with
     10 the shape results, you can use the `record-test.sh` script to add
     11 this to the test suite.  `record-test.sh` requires `pyftsubset` to
     12 be installed.  You can get `pyftsubset` by installing
     13 FontTools from <https://github.com/behdad/fonttools>.
     14 
     15 To use `record-test.sh`, just put it right before the `hb-shape` invocation:
     16 ```sh
     17 $ ./hb-unicode-encode 41 42 43 627 | ./record-it.sh ../../util/hb-shape font.ttf
     18 ```
     19 what this does is:
     20   * Subset the font for the sequence of Unicode characters requested,
     21   * Compare the `hb-shape` output of the original font versus the subset
     22     font for the input sequence,
     23   * If the outputs differ, perhaps it is because the font does not have
     24     glyph names; it then compares the output of `hb-view` for both fonts.
     25   * If the outputs differ, recording fails.  Otherwise, it will move the
     26     subset font file into `fonts/sha1sum` and name it after its hash,
     27     and prints out the test case input, which you can then redirect to
     28     an existing or new test file in `tests`, eg.:
     29 ```sh
     30 $ ./hb-unicode-encode 41 42 43 627 | ./record-it.sh ../../util/hb-shape font.ttf >> tests/test-name.test
     31 ```
     32 
     33 If you created a new test file, add it to `Makefile.am` so it is run.
     34 Check that `make test` does indeed run it, and that the test passes.
     35 When everything looks good, `git add` the new font as well as new
     36 test file if you created any.  You can see what new files are there
     37 by running `git status tests fonts/sha1sum`.  And commit!
     38 
     39 *Note!*  Please only add tests using Open Source fonts, preferably under
     40 OFL or similar license.
     41