src/gen-tag-table.py


Log

Author Commit Date CI Message
David Corbett b2e7bb2a 2020-10-27T19:50:33 Don’t map BCP 47 to coincidentally similar OT tag
David Corbett e1df2c52 2020-10-26T19:16:35 Map ISO 639 code qul to language system tag 'QUH '
David Corbett 17da41bd 2020-11-17T14:29:05 Update language system tag registry to OT 1.8.4
David Corbett 27170e05 2020-10-28T18:02:55 Fix names for language tag in gen-tag-table.py A BCP 47 language tag with both a script subtag and a region subtag would be printed as a human-readable name in hb-ot-tag-table.hh as if it only had its language subtag.
David Corbett dec52006 2020-10-10T14:49:55 Map BCP 47 tags to all macrolanguages The general rule is that if a BCP 47 macrolanguage maps to an OpenType language system tag, all its individual languages map to it too. Previously, a tag like "prs" (Dari) would not map to the language system tag ('FAR ') of its macrolanguage ("fa") because "prs" already has its own language system tag ('DRI '). That exception has been removed: now "prs" maps to 'DRI ' and falls back to 'FAR '.
David Corbett 1d53268d 2020-10-10T14:46:36 Fix two-way mapping of "man" and 'MNK '
David Corbett ab38cf67 2020-10-10T14:21:20 Map hy-arevmda to 'HYE ' instead of HYE0
David Corbett 916c5a90 2020-10-10T14:15:16 Consistently emit BCP 47 subtag scope suffixes
David Corbett ac3f859a 2020-09-09T11:49:56 Demote unregistered vendor-specific language tags
David Corbett 91fe20f0 2020-09-04T09:18:19 Disambiguate OT tags when primary tag is not first
Ebrahim Byagowi ad87155f 2020-05-29T00:11:19 minor, use py3's open(encoding=)
Ebrahim Byagowi 7554f618 2020-05-28T22:51:29 minor, use sys.exit print shorthand
Ebrahim Byagowi 08f1d95a 2020-05-28T15:01:15 minor, move scripts manuals to __doc__
David Corbett 7a961692 2020-04-01T17:26:07 Update IANA Language Subtag Registry to 2020-05-12
David Corbett fd748fac 2020-03-15T15:59:31 Update to Unicode 13.0.0
Ebrahim Byagowi e17fd0d9 2020-02-23T23:58:39 [tools] More on py3 compatibility
Ebrahim Byagowi 8c652f72 2020-02-19T16:32:44 Minor, switch to https links where possible
Ebrahim Byagowi bbcbcafc 2020-02-19T16:21:47 [tool] Minor, move input files link
Ebrahim Byagowi 8d199077 2020-02-19T14:56:55 Remove python2 support from tests/utils scripts
Evgeniy Reizner 4dc87365 2020-02-09T18:39:33 Add links to files used by python scripts. Closes #2150
David Corbett 6745a600 2019-04-16T17:29:34 Comment out ot_languages where fallback suffices
David Corbett 1ce11b44 2019-04-16T10:04:45 Reduce LangTag from 3 language system tags to 1
David Corbett bca7a169 2018-09-10T12:05:51 Update language system tag registry to OT 1.8.3
David Corbett 3f887747 2018-07-19T13:48:07 Switch on the first char of a complex language tag This results in a tenfold speed-up for the common case of tags that are not complex, in the sense of `hb_ot_tags_from_complex_language`.
David Corbett a754d441 2018-07-16T21:14:48 Map Quechua languages to closest ones with tags OpenType only officially maps four ISO 639 codes to Quechua languages, but prior versions of HarfBuzz also mapped qu to 'QUZ '. Because qu is a macrolanguage, the mapping now applies to all individual Quechua languages. OpenType calls 'QUZ ' "Quechua", but it really corresponds to Cusco Quechua, so the individual Quechua languages should not all necessarily be mapped to it.
David Corbett 7c7cb2a9 2018-01-20T15:53:09 Match extlang subtags If the second subtag of a BCP 47 tag is three letters long, it denotes an extended language. The tag converter ignores the language subtag and uses the extended language instead. There are some grandfathered exceptions, which are handled earlier.
David Corbett 2f1f961c 2017-12-08T22:45:52 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`.