harfbuzz/test/api
David Corbett 2f1f961cc0 Autogenerate the BCP 47 to OpenType mappings
The new script, gen-tag-table.py, generates `ot_languages` automatically
from the [OpenType language system tag registry][ot] and the [IANA
Language Subtag Registry][bcp47] with some manual modifications. If an
OpenType tag maps to a BCP 47 macrolanguage, all the macrolanguage's
individual languages are mapped to the same OpenType tag, except for
individual languages with their own OpenType mappings. Deprecated
BCP 47 tags are canonicalized.

[ot]: https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags
[bcp47]: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

Some OpenType tags correspond to multiple ISO 639 codes. The mapping
from ISO 639 codes lists OpenType tags in priority order, such that more
specific or more likely tags appear first.

Some OpenType tags have no corresponding ISO 639 code in the registry so
their mappings use BCP 47 subtags besides the language. For example, any
BCP 47 tag with a fonipa variant subtag is mapped to 'IPPH', and 'IPPH'
is mapped back to und-fonipa.

Other OpenType tags have no corresponding ISO 639 code because it is not
clear what they are for. HarfBuzz just ignores these tags.

One such ignored tag is 'ZHP ' (Chinese Phonetic). It probably means
zh-Latn. However, it is used in Microsoft JhengHei and Microsoft YaHei
with the script tag 'hani', implying that it is not a romanization
scheme after all. It would be simple enough to add this mapping to
gen-tag-table.py once a definitive mapping is determined.

The manual modifications are mainly either obvious mappings that the
OpenType registry omits or mappings for compatibility with previous
versions of HarfBuzz. Some of the old mappings were discarded, though,
for homophonous language names. For example, OpenType maps 'KUI ' to
kxu; previous versions of HarfBuzz also mapped it to kvd, because kvd
and kxu both happen to be called "Kui".

gen-tag-table.py also generates a function to convert multi-subtag tags
like el-polyton and zh-HK to OpenType tags, replacing `ot_languages_zh`
and the hard-coded list of special cases in `hb_ot_tags_from_language`.
It also generates a function to convert OpenType tags to BCP 47,
replacing the hard-coded list of special cases in
`hb_ot_tag_to_language`.
2018-10-11 13:54:28 -04:00
..
fonts [subset] Fix hdmx subsetted size calculation. 2018-09-05 19:31:55 -07:00
.valgrind-suppressions Move valgrind suppressions to the correct directory 2013-03-06 20:20:45 -05:00
CMakeLists.txt CMake: Fix running tests on Windows 2018-03-13 20:17:58 +08:00
Makefile.am Remove HAVE_OT 2018-10-10 16:32:35 -04:00
hb-subset-test.h [test] Use an in-repo font for test-multithread (#1218) 2018-10-03 21:26:58 +03:30
hb-test.h [test] Fix -Wunused-parameter warnings 2018-09-30 18:14:50 +02:00
test-blob.c [test] Fix -Wunused-parameter warnings 2018-09-30 18:14:50 +02:00
test-buffer.c Minor, fix -Weverthing bot warnings (#1210) 2018-10-02 11:07:06 +03:30
test-c.c Remove HAVE_OT 2018-10-10 16:32:35 -04:00
test-collect-unicodes.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-common.c Rename hb-*private.hh to hb-*.hh 2018-08-25 22:36:36 -07:00
test-cplusplus.cc Rename test/ to test/api/ 2012-01-19 14:52:02 -05:00
test-font.c [test] Fix -Wunused-parameter warnings 2018-09-30 18:14:50 +02:00
test-multithread.c [ft] Use mutex to lock access to FT_Face 2018-10-09 16:24:50 -04:00
test-object.c [test] Fix test-object 2015-08-30 17:33:04 +01:00
test-ot-color.c [test] Fix -Wunused-parameter warnings 2018-09-30 18:14:50 +02:00
test-ot-math.c Fix test-ot-math leak issue 2018-09-22 17:05:52 +03:30
test-ot-tag.c Autogenerate the BCP 47 to OpenType mappings 2018-10-11 13:54:28 -04:00
test-set.c Remove test for deprecated hb_set_invert() 2018-10-09 01:05:28 -04:00
test-shape.c Port test off deprecated API 2018-10-09 07:48:52 -04:00
test-subset-cmap.c [subset] Get cmap tests passing again. 2018-05-04 11:20:03 -07:00
test-subset-glyf.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-subset-hdmx.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-subset-hmtx.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-subset-os2.c test/api: Fix building subset tests 2018-03-13 20:17:58 +08:00
test-subset-post.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-subset-vmtx.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-subset.c test/api/test-subset-*.c: Fix build on pre-C99 2018-10-09 09:43:36 -04:00
test-unicode.c Remove deprecated decompose_compatibility stuff 2018-10-09 00:39:42 -04:00
test-version.c Rename HB_VERSION_CHECK and hb_version_check to "atleast" 2014-06-20 14:09:57 -04:00