fbpx

InDesign的Unicode字元類別列表補充

by 小雲
121 瀏覽

前一陣子,在常去的社團裡有大大分享了一張Unicode字元類別的說明表格,總計有37種屬性內容,內容很讚就想把它翻譯後拿來分享給大家學習,也剛好可以補充先前因為篇幅問題,而在書中只講述了12種屬性用法的遺憾,不過呢,其實這些額外的屬性內容有很多都是不常用,或者根本不會遇到的情形,但是全部補上也算是完滿了。

中間的「英文描述與全寫」是原來表格的英文說明,我怕我翻譯後可能有誤,就把原文留著,右邊的「中文解釋」是我翻譯&努力理解後,有的有加註了一些說明,希望沒有說明錯誤啊~XD

怎麼明明就是一個排版軟體,我卻覺得好像在學程式語言那樣困難呢⋯⋯Orz

Unicode字元類別基本屬性和子屬性

淡粉紅色儲存格標示Unicode字元類別\p{}基本屬性,其下為子屬性,文字描述中的4位英數字為Unicode編碼,例如2028+U2028

簡寫 英文描述與全寫 中文解釋
\p{L*} \p{letter} Any letter. 任何字元。
\p{Ll} \p{lowercase_letter} 小寫字元。
\p{Lu} \p{uppercase_letter} 大寫字元。
\p{Lt} \p{titlecase_letter} In some languages, digraphs have a special title-case form. InDesign matches Dz (01F2), Dž(01C5), Lj (01C8), Nj (01CB). Thus, “nj” has the forms nj, NJ, and Nj. InDesign also matches the Ancient Greek letters with “subscript iota”, as they can be written as a separate letter: ᾼ, ῌ, ῼ, and their variants with diacritics.
匹配在某些語言中,特殊的二合字母大小寫形式。例如Dz (01F2)、Dž(01C5)、Lj (01C8)、Nj (01CB),還有像是「nj」具有的 nj、NJ 和 Nj 的形式。此外還將古希臘字母與「下標 iota」匹配,像是:ᾼ、ῌ、ῼ,以及它們的變體與變音符號。
\p{L&} Doesn’t work in InDesign. Covers \p{Ll}, \p{Lu}, and \p{Lt}. 這個沒辦法在InDesign使用,等於\p{Ll}、\p{Lu} 和 \p{Lt}的集合。
\p{Lm} \p{modifier_letter} Various characters from Spacing modifier letters (02B0–02FF).
間距修飾元(02B0–02FF) 中的各種字元。詳見:https://en.wikipedia.org/wiki/Spacing_Modifier_Letters
\p{Lo} \p{letter_other} Whatever letters not captured by the four \p{L . } classes, i.e. letters without case and that aren’t modifiers: characters from Hebrew, Arabic, the SE-Asian languages, etc.
不在前述4種匹配的字元範圍的任何字元,亦即不是大小寫且不是修飾元的字元,如:希伯來語、阿拉伯語、東南亞語言等的字元。
\p{M*} \p{mark} Any of the following three types of mark. 以下三種標記中的任何一種。
\p{Mn} \p{non_spacing_mark} Including combining diacritical marks and tone marks. Matches characters in a wide variety of ranges. 組合變音標記和聲調標記。匹配各種範圍內的字符。
\p{Mc} \p{spacing_combining_mark} Vowels in SE-Asian languages.
東南亞語言中的元音。元音字母參考:https://zh.wikipedia.org/wiki/馬拉雅拉姆文#元音字母及附标
\p{Me} \p{enclosing_mark} Circles, squares, keycaps, etc. Found in a variety of Unicode ranges.
封閉標記字元,可以參考:https://www.compart.com/en/unicode/category/Me
\p{Z*} \p{separator} Spaces, returns, 2028, 2029 (but not hyphens and dashes). 空格、return、2028、2029(但不是連字號和破折號)。
\p{Zs} \p{space_separator} All spaces except tab and return. 除tab和return之外的所有空格。
\p{Zl} \p{line_separator} 2028 is the line-separator character. 行分隔字元2028。
\p{Zp} \p{paragraph_separator} 2029 分段字元2029。
\p{S*} \p{symbol} (Math, wingdings) 數學符號與wingdings字型下的字元。
\p{Sm} \p{math_symbol} Math symbols. 數學符號。
\p{Sc} \p{currency_symbol} All currency symbols. 所有貨幣符號。
\p{Sk} \p{modifier_symbol} Combining characters with their own width, such as the acute 00B4 (not acute 0301).
將字元與自己寬度組合起來的字元,例如00B4(´)而不是0301(沒有寬度的´符號)。
\p{So} \p{other_symbol} Wingdings, dingbats, etc. from various ranges.
來自不同範圍的 Wingdings、dingbats 字型的字元等,dingbats 字型請參考:https://www.dafont.com/mtheme.php?id=7
\p{N*} \p{number} Any kind of number. 任何數字。
\p{Nd} \p{decimal_digit_number} The digits 0 to 9. 數字0到9。
\p{Nl} \p{letter_number} The Roman upper- and lower-case numerals in Number forms (2150–218F). 羅馬數字大寫與小寫(2150–218F)。
\p{No} \p{other_number} Super- and subscripts, fractions, enclosed numbers in Latin 1, Number forms, and enclosed alphanumerics.
上標、下標、分數、Latin-1字元中的封閉數字、數字形式和封閉數字字元(2460-24FF)。
封閉數字字元列表:https://unicode-table.com/en/blocks/enclosed-alphanumerics/
\p{P*} \p{punctuation} Any punctuation. 所有標點符號。
\p{Pd} \p{dash_punctuation} All hyphens and dashes. 所有破折號和連字號。
\p{Ps} \p{open_punctuation} Opening brackets, braces, parentheses, and similar, e.g. 2045, FE17, and FF62. 所有左括弧。
\p{Pe} \p{close_punctuation} Closing brackets, braces, parentheses, and similar, e.g. 2046, FE18, and FF63. 所有右括弧。
\p{Pi} \p{initial_punctuation} All opening quotes. (西式)開始引號。
\p{Pf} \p{final_punctuation} All closing quotes. (西式)結束引號。
\p{Pc} \p{connector_punctuation} underscore, 203F, 2040, 2054. 所有下底線,以及203F、2040、2054(‿⁀⁔)。
\p{Po} \p{other_punctuation} All other punctuation: ! ” % &, etc. 所有其他標點符號,像是! “ % &, 等等。
\p{C*} \p{other} What it says: ‘other’. 其他字元(包括不可見控制字元與未用碼位)。
\p{Cc} \p{control} Control characters in C0 Controls and Basic Latin (0000–0020), such as Tab, Esc, etc.
Unicode控制碼C0裡的字元(0000-001F),以及基本拉丁字元(0000-0020),例如Tab、Esc等。
\p{Cf} \p{format} Various (non-visible) formatting characters in General Punctuation (2000–206F), such as left-to-right and right-to-left markers, embedding, etc.
通用標點符號(2000-206F)中的各種無寬度格式化字元,例如從左到右和從右到左的標記、嵌入等。
\p{Co} \p{private_use} (E000–F8FF) 私用碼位(E000–F8FF)
\p{Cn} \p{unassigned} Some of the unassigned unicode ranges (e.g. D7A4–D7FF). 一些未分配的 unicode 範圍,例如 D7A4–D7FF。

參考資料與說明

  • 詳細資訊可參閱 Boost 網站 http://tinyurl.com/ck9xe5http://tinyurl.com/amenz5。另見 J. Friedl《Mastering Regular Expressions》O’Reilly, 2006, pp. 122, 123.。
  • 描述式中的大小寫都可通用,間距也可省略,例如\p{UL}、\p{Ul}和 \p{ul}與\p{uppercase_letter}、\p{uppercase letter}和\p{uppercaseletter}都是一樣的。
  • InDesign不允許您在字元集中使用unicode 屬性。例如[\p{Ps}\p{Pi}]這樣的結構不起作用。解決方法是使用替代方法:\p{Ps}|\p{Pi}。
  • Poisx類別中的字元類經常使用一些英文字詞,這些字詞也可拿Unicode字元類別中的描述文字來替代,例如\p{Lo}也可以寫成[[:Lo:]]來使用。

以上就是這次的內容分享,按照慣例要再打個小廣告,目前已出版了兩本InDesign圖書,歡迎大家多支持!

《InDesign Tricks:專家愛用的速效技法》,提供許多InDesign進階編排技術的教學,讓讀者了解專家們都是怎麼快速編排的,本書的電子書互動介紹頁面:這裏。目前有在Readmoo電子書平台Google play圖書Kobo均有上架喔~❤

《GREP Tricks:InDesign自動化的極致,快速搞定瑣碎煩冗的編排流程》,提供了比快速更厲害的神速技巧——GREP應用,目前已在挖貝選物蝦皮賣場Readmoo電子書平台Google play圖書上架了~❤

如果你覺得本篇文章對你很有幫助,也歡迎你使用我的永豐個人商店支付打賞贊助,下方是我的支付條碼(或是最上方特色圖片右邊的QR碼),支援Apple Pay、Google Pay、以及個人信用卡刷卡支付(免手續費),贊助一杯咖啡的金額,是支持我繼續寫作分享的動力喔~謝謝~

相關文章

留下建議

我的作品

Cropped Cropped P1060991.jpg

@2022 – All Right Reserved. Designed and Developed by PenciDesign