#import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/template/font.typ": sil-pua

#import "/lib/glossary.typ": tr

#show: web-page-template

// ## Global Scripts in Unicode
== Unicode 中的#tr[global scripts]

// At the time of writing, the Unicode Standard is up to version 9.0, and new scripts and characters are being encoded all the time. The Unicode character set is divided into 17 planes, each covering 65536 code points, for a total of 1,114,112 possible code points. Currently, only 128,327 of those code points have been assigned characters; 137,468 code points (including the whole of the last two planes) are reserved for private use.
在写作时，Unicode 标准的最新版是9.0，不断有新的#tr[scripts]和#tr[character]被#tr[encoding]进去。Unicode#tr[character set]被分为17个平面，每个平面有65536个#tr[codepoint]，共有 1114112 个可用#tr[codepoint]。目前，只有其中128327个被分配了#tr[character]，还有（包括最后两个平面的）137468个#tr[codepoint]为自定义的私人用途而保留。

#note[
  // > Private use means that *within an organisation, community or system* you may use these code points to encode any characters you see fit. However, private use characters should not "escape" into the outside world. Some organisations maintain registries of characters they have assigned to private use code points; for example, the SIL linguistic community have encoded 248 characters for their own use. One of these is , LATIN LETTER SMALL CAPITAL L WITH BELT, which they have encoded at position U+F268. But there's nothing to stop another organisation assigning a *different* character to U+F268 within their systems. If allocations start clashing, you lose the whole point of using a common universal character set. So use private use characters... privately.
  私人使用意味着，在*一个组织、社群或系统中*，你可以按照符合你需求的方式随意使用这些#tr[codepoint]。但是，私用#tr[character]不能“逃逸”到外部世界中。一些组织会维护一个他们使用的私人#tr[codepoint]的目录以供查询：比如SIL语言学社区#tr[encoding]了他们自用的248个#tr[character]。其中一个是#sil-pua[/*\u{0F268}*/\u{1DF04}]#footnote[译注：大多数SIL PUA#tr[character]已经被Unicode正式编入，编入后这些PUA区的#tr[character]就会标注为已弃用。目前支持SIL PUA区的字体都使用了某种样式来提示U+F268已被弃用，为了显示这个#tr[character]的实际样子，此处使用的其实是其正式Unicode#tr[codepoint]U+1DF04。], LATIN LETTER SMALL CAPITAL L WITH BELT，他们将其#tr[encoding]在U+F268的位置。但这并不能阻止其他组织在其系统中把U+F268分配给*别的*#tr[character]。一旦分配发生冲突，使用公共的通用#tr[character set]就失去了意义。所以私用#tr[character]只能在内部使用。
]

// Most characters live in the first plane, Plane 0, otherwise known as the Basic Multilingual Plane. The BMP is pretty full now - there are only 128 code points left unallocated - but it covers almost all languages in current use. Plane 1 is called the Supplementary Multilingual Plane, and mainly contains historic scripts, symbols and emoji. Lots and lots of emoji. Plane 2 contains extended CJK (Chinese, Japanese and Korean) ideographs with mainly rare and historic characters, while planes 3 through 13 are currently completely unallocated. So Unicode still has a lot of room to grow.
大多数#tr[character]都在第一个平面上，也就是第0平面。它的另一个著名的名字是#tr[BMP]（Basic Multilingual Plane，BMP）。BMP现在基本满了，它只剩下最后 128 个#tr[codepoint]还没被分配。这一个平面已经足以满足当前绝大数语言的需求。第1平面被称为#tr[SMP]，主要包含古代#tr[scripts]、符号和emoji。很多很多的emoji。第2平面包含中日韩表意文字扩展区，基本上是不常见的或者古代#tr[character]。第3到13平面完全没有使用，Unicode里的可用空间还有很多。

// Within each plane, Unicode allocates each writing system a range of codepoints called a *block*. Blocks are not of fixed size, and are not exhaustive - once codepoints are allocated, they can't be moved around, so if new characters from a writing system get added and their block fills up, a separate block somewhere else in the character set will be created. For instance, groups of Latin-like characters have been added on multiple occasions. This means that there are now 17 blocks allocated for different Latin characters; one of them, Latin Extended-B, consists of 208 code points, and contains Latin characters such as Ƕ (Latin Capital Letter Hwair), letters used in the transcription of Pinyin, and African clicks like U+013C, ǃ - which may look a lot like an exclamation mark but is actually the ǃKung letter Latin Letter Retroflex Click.
在每一个平面内，Unicode 会给某个#tr[writing system]分配一系列连续的#tr[codepoint]，这称为*#tr[block]*。#tr[block]不是固定大小的，也不保证全面。也就是它不一定含有这个#tr[writing system]的所有#tr[character]，因为在#tr[codepoint]分配给了#tr[character]了后，它们就不能移动了。所以如果这个#tr[block]的所有空位都用完了，而#tr[writing system]又需要增加别的#tr[character]的话，我们就会为它在#tr[character set]的其他位置再开一个#tr[block]。比如，拉丁系#tr[character]就新多次新增过#tr[block]，至今已有17个。其中一个#tr[block]叫做拉丁扩展B区，其中包含Ƕ（拉丁大写字母 Hwair），在转写汉语拼音时使用的字母，U+013C \u{01C3} 之类表示非洲搭嘴音的符号等。最后这个符号看上去像一个感叹号，但它其实是 \u{01C3}Kung 语言中的一个发卷舌搭嘴音的字母，我们在文本转写中用`Latin Letter Retroflex Click`这个符号来表示它。

// > The distinction between ǃ (Retroflex Click) and ! (exclamation mark) illustrates a fundamental principle of Unicode: encode what you *mean*, not what you *see*. If we were to use the exclamation mark character for both uses just because they were visually identical, we would sow semantic confusion. Keeping the code points separate keeps your data unambiguous.
#note[
  \u{01C3}（卷舌搭嘴音） 和 !（感叹号）之间的区别揭示了Unicode中的一个原则：按*语义*而不是*外形*来决定是否#tr[encoding]。如果我们仅仅因为它俩看上去相似，就在这两个地方都用感叹号，这样会产生让人迷惑的语义。从#tr[codepoint]上将它们分离可以让数据不产生歧义。
]

// Here is the complete list of scripts already encoded in Unicode as of version 9.0: Adlam, Ahom, Anatolian Hieroglyphs, Arabic, Armenian, Avestan, Balinese, Bamum, Bassa Vah, Batak, Bengali, Bhaiksuki, Bopomofo, Brahmi, Braille, Buginese, Buhid, Canadian Aboriginal, Carian, Caucasian Albanian, Chakma, Cham, Cherokee, Common (that is, characters used in multiple scripts), Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, Devanagari, Duployan, Egyptian Hieroglyphs, Elbasan, Ethiopic, Georgian, Glagolitic, Gothic, Grantha, Greek, Gujarati, Gurmukhi, Han (that is, Chinese, Japanese and Korean ideographs), Hangul, Hanunoo, Hatran, Hebrew, Hiragana, Imperial Aramaic, Inscriptional Pahlavi, Inscriptional Parthian, Javanese, Kaithi, Kannada, Katakana, Kayah Li, Kharoshthi, Khmer, Khojki, Khudawadi, Lao, Latin, Lepcha, Limbu, Linear A, Linear B, Lisu, Lycian, Lydian, Mahajani, Malayalam, Mandaic, Manichaean, Marchen, Meetei Mayek, Mende Kikakui, Meroitic Cursive, Meroitic Hieroglyphs, Miao, Modi, Mongolian, Mro, Multani, Myanmar, Nabataean, New Tai Lue, Newa, Nko, Ogham, Ol Chiki, Old Hungarian, Old Italic, Old North Arabian, Old Permic, Old Persian, Old South Arabian, Old Turkic, Oriya, Osage, Osmanya, Pahawh Hmong, Palmyrene, Pau Cin Hau, Phags Pa, Phoenician, Psalter Pahlavi, Rejang, Runic, Samaritan, Saurashtra, Sharada, Shavian, Siddham, SignWriting, Sinhala, Sora Sompeng, Sundanese, Syloti Nagri, Syriac, Tagalog, Tagbanwa, Tai Le, Tai Tham, Tai Viet, Takri, Tamil, Tangut, Telugu, Thaana, Thai, Tibetan, Tifinagh, Tirhuta, Ugaritic, Vai, Warang Citi, Yi.
以下是 Unicode 9.0 中#tr[encoding]了的所有#tr[scripts]：Adlam, Ahom, Anatolian Hieroglyphs, Arabic, Armenian, Avestan, Balinese, Bamum, Bassa Vah, Batak, Bengali, Bhaiksuki, Bopomofo, Brahmi, Braille, Buginese, Buhid, Canadian Aboriginal, Carian, Caucasian Albanian, Chakma, Cham, Cherokee, Common (that is, characters used in multiple scripts), Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, Devanagari, Duployan, Egyptian Hieroglyphs, Elbasan, Ethiopic, Georgian, Glagolitic, Gothic, Grantha, Greek, Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hatran, Hebrew, Hiragana, Imperial Aramaic, Inscriptional Pahlavi, Inscriptional Parthian, Javanese, Kaithi, Kannada, Katakana, Kayah Li, Kharoshthi, Khmer, Khojki, Khudawadi, Lao, Latin, Lepcha, Limbu, Linear A, Linear B, Lisu, Lycian, Lydian, Mahajani, Malayalam, Mandaic, Manichaean, Marchen, Meetei Mayek, Mende Kikakui, Meroitic Cursive, Meroitic Hieroglyphs, Miao, Modi, Mongolian, Mro, Multani, Myanmar, Nabataean, New Tai Lue, Newa, Nko, Ogham, Ol Chiki, Old Hungarian, Old Italic, Old North Arabian, Old Permic, Old Persian, Old South Arabian, Old Turkic, Oriya, Osage, Osmanya, Pahawh Hmong, Palmyrene, Pau C<NAME>, <NAME>, Phoenician, <NAME>, Rejang, Runic, Samaritan, Saurashtra, Sharada, Shavian, Siddham, SignWriting, Sinhala, Sora Sompeng, Sundanese, Syloti Nagri, Syriac, Tagalog, Tagbanwa, Tai Le, Tai Tham, Tai Viet, Takri, Tamil, Tangut, Telugu, Thaana, Thai, Tibetan, Tifinagh, Tirhuta, Ugaritic, Vai, Warang Citi, Yi。#footnote[译注：翻译本段意义不大，其中的 Han 即为汉字。希望了解其他#tr[scripts]的读者可自行查询ISO 15924代码列表@Unicode.ISO15924。]

#note[
  // > When you're developing fonts, you will very often need to know how a particular character is encoded and whereabouts it lives in the Unicode standard - that is, its *codepoint*. For example, the Sinhala letter ayanna is at codepoint 3461 (we usually write these in hexadecimal, as 0D85). How did I know that? I could look it up in the [code charts](https://www.unicode.org/charts/), but actually I have a handy application on my computer called [UnicodeChecker](https://earthlingsoft.net/UnicodeChecker/) which not only helps me find characters and their codepoints, but tells me what the Unicode Standard says about those characters, and also what fonts on my system support them. If you're on a Mac, I recommend that; if not, I recommend finding something similar.
  当你开发字体时，你经常需要知道一个特定#tr[character]是如何#tr[encoding]的，也就是它处于Unicode标准的什么位置，这种位置就是#tr[codepoint]。比如，僧伽罗语字母ayanna在#tr[codepoint]3461（我们一般写成十六进制，0D85）处。从哪能获取这种信息呢？你可以查看Unicode#tr[character]代码表@Unicode.UnicodeCharacter，但我一般会在电脑上安装一个叫做UnicodeChecker的应用程序@Earthlingsoft.UnicodeChecker.2022。它不仅能很方便地告诉我Unicode中每个#tr[character]的各种信息，还能列出我电脑中支持这个#tr[character]的所有字体。如果你也在使用Mac系统的话，我非常推荐它。如果不是，我也推荐你找找对应平台上的类似应用#footnote[译注：UnicodeChecker只支持macOS，如果你在其他系统上有查询支持某字符的所有字体的需求，译者为此编写过跨平台的命令行工具fontfor @7sDream.Fontfor，可供一试。]。
]

// What should you do if you are developing resources for a script which is not encoded in Unicode? Well, first you should check whether or not it has already been proposed for inclusion by looking at the [Proposed New Scripts](http://www.unicode.org/pending/pending.html) web site; if not, then you should contact the Unicode mailing list to see if anyone is working on a proposal; then you should contact the [Script Encoding Initiative](http://linguistics.berkeley.edu/sei/), who will help to guide you through the process of preparing a proposal to the Unicode Technical Committee. This is not a quick process; some scripts have been in the "preliminary stage" for the past ten years, while waiting to gather expert opinions on their encoding.
如果你想为一个还没#tr[encoding]进Unicode中的#tr[scripts]开发字体的话，首先应该检查已提案#tr[scripts]#[@Unicode.ProposedNew]页面中是否已经有关于此#tr[scripts]的提案。如果没有，那么你应该通过Unicode邮件列表联系他们，看看是否有人正在编写这个提案。要是也没有人正在编写提案，你可以尝试联系一下Script Encoding Initiative#[@ScriptEncodingInitiative.ScriptEncoding]组织。在从前期准备到向Unicode技术委员会提出提案的整个流程中，他们都可以为你提供帮助。这个流程不会很快，有些#tr[scripts]在等待收集专家对其#tr[encoding]意见的“前期阶段”停留了十多年。
