diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-25 23:04:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-25 23:04:51 +0000 |
commit | eb411ed661c178e451eb3dd55d6ee8bc154c1265 (patch) | |
tree | 4658020be8d565c5639dd20164c5d9e83ac454da /Master | |
parent | bfe53688ab950cd41271c259a29df8dd5eff29cd (diff) |
new-to-TL xelatex package ucharclasses (25sep12)
git-svn-id: svn://tug.org/texlive/trunk@27811 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/xelatex/ucharclasses/README | 64 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.pdf | bin | 0 -> 161345 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.tex | 490 | ||||
-rw-r--r-- | Master/texmf-dist/tex/xelatex/ucharclasses/ucharclasses.sty | 719 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 2 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-xetex.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/ucharclasses.tlpsrc | 0 |
8 files changed, 1275 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/xelatex/ucharclasses/README b/Master/texmf-dist/doc/xelatex/ucharclasses/README new file mode 100644 index 00000000000..3ff53493141 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/ucharclasses/README @@ -0,0 +1,64 @@ + ucharclasses package for XeLaTex + -------------------------------- + Michiel Kamermans, October 2011 + +The brief +--------- + + Sometimes you don't want to have to bother with font + switching just because you're using languages that are + distinct enough to use different unicode blocks, but + aren't covered by the polyglossia package. Where normal + word processing packages such as Microsoft Word or + OpenOffice Writer handle this for you, LATEX (because it + needs you to tell it what to do) has no default behaviour + for this, and so we arrive at a need for a package that + does this for us. You probably already discovered that + regular LATEX has no understanding of unicode, and ended + up going for Xe(La)TeX as your TeX compiler of choice, + which means you now have two excellent resources available: + fontspec, and ucharclasses. + + The first of these lets you pick fonts based on what your + system calls them, without needing to do anything special + such as turning them into metafonts. This is convenient, + user friendly, and the way of the future (at least, it + should be). + + The second lets you define what should happen when your + text changes from a character in one unicode block, to a + character in another. This is also convenient, and paired + with fontspec it offers automatic font switching in the + same way that normal Office applications perform, with + one big difference: you stay in control. If at some point + you need the switch rule to do something different, + you will be out of luck using an Office application. + In Xe(La)TeX, you stay on top of things and still get to + say exactly what happens, and when. + +So what is it? +-------------- + + This package sets up XeTeX character classes based on + which unicode block a character is found in. It then + allows transition rules to be defined when entering or + leaving particular unicode blocks, the code of which + gets inserted automatically when a transition from a + character from one unicode block to a character from + another unicode block is encountered by XeTeX + + Current compatibility should be Unicode 6.0, although + I may have missed one or more blocks that were added + between 5 and 6. + +license? +-------- + + Public Domain + http://www.tex.ac.uk/CTAN/help/Catalogue/licenses.pd.html + + +Repository? +----------- + + https://github.com/Pomax/ucharclasses
\ No newline at end of file diff --git a/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.pdf b/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.pdf Binary files differnew file mode 100644 index 00000000000..b58263c0c6e --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.pdf diff --git a/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.tex b/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.tex new file mode 100644 index 00000000000..d6593e2cd73 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/ucharclasses/ucharclasses.tex @@ -0,0 +1,490 @@ +\documentclass{article} +\usepackage{tocloft} +\usepackage[pdfborder=0]{hyperref} +\usepackage{multicol} + +\renewcommand{\labelitemi}{・} + +% some custom environments, to force on-same-page-ness + +\newenvironment{itemlist}{% + \begin{itemize} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} + \setlength{\parskip}{0pt} + \setlength{\labelsep}{5pt}}% +{ + \end{itemize}} + +\newenvironment{numberlist}{% + \begin{enumerate} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} + \setlength{\parskip}{0pt} + \setlength{\labelsep}{5pt}}% +{ + \end{enumerate}} + +% and the font switching magic +\usepackage[CJK, Latin, Thai, Sinhala, Malayalam, DominoTiles, MahjongTiles]{ucharclasses} +\usepackage{fontspec} + +% default transition uses the widest coverage font I know of +\setDefaultTransitions{\fontspec{Code2000}}{} + +% overrides on the default rules for specific informal groups +\setTransitionsForLatin{\fontspec{Palatino Linotype}}{} +\setTransitionsForCJK{\fontspec{HAN NOM A}}{} +\setTransitionsForJapanese{\fontspec{Ume Mincho}}{} + +% overrides on the default rules for specific unicode blocks +\setTransitionTo{CJKUnifiedIdeographsExtensionB}{\fontspec{SimSun-ExtB}} +\setTransitionTo{Thai}{\fontspec{IrisUPC}} +\setTransitionTo{Sinhala}{\fontspec{Iskoola Pota}} +\setTransitionTo{Malayalam}{\fontspec{Arial Unicode MS}} +\setTransitionTo{DominoTiles}{\fontspec{FreeSerif}} +\setTransitionTo{MahjongTiles}{\fontspec{FreeSerif}} + +\begin{document} + + \title{ucharclasses} + \author{Mike “Pomax” Kamermans} + \date{\today} + \maketitle + + \tableofcontents + + \pagebreak + + \section{Introduction} + + Sometimes you don't want to have to bother with font switching just because you're languages that are distinct enough to use different Unicode blocks, but aren't covered by the polyglossia package. Where normal word processing packages such as MS, Star- or OpenOffice pretty much handle this for you, \LaTeX\ (because it needs you to tell it what to do) has no default behaviour for this, and so we arrive at a need for a package that does this for us. You already discovered that regular \LaTeX\ has no understanding of Unicode (in fact, it has no understanding of 8-bit characters at all, it likes them in seven bits instead), and ended up going for Xe(La)TeX as your TeX compiler of choice, which means you now have two excellent resources available: fontspec, and ucharclasses. + + The first of these lets you pick fonts based on what your system calls them, without needing to rewrite them as metafont files. This is convenient. This is good. The second lets you define what should happen when we change from a character in one Unicode block, to a character in another. This is also convenient, and paired with fontspec it offers automatic fontswitching in the same way that normal Office applications take care of this with you. With one big difference: you stay in control. If at some point you need the switch rule to use a completely different rule, in an Office application that's just too bad for you. In Xe(La)TeX, you stay on top of things and still get to say exactly what happens, and when. + + For instance, this document has no explicit font codes in the text itself, anywhere. Instead there are a few Unicode block transition rules defined, which all say “when entering block ..., use fontspec to change the font to ...”. As such, typesetting the following list in the appropriate fonts just works: + + \begin{itemlist} + \item English: This is an English phrase (using Palatino Linotype) + \item Japanese: 日本語が分かりますか (using Ume Mincho) + \item Thai: คุณพูดภาษาอังกฤษได้ไหม (using IrisUPC) + \item Sinhala: කරැණාකරල ඒක නැවත කියන්න පුළුවන්ද (using Iskoola Pota) + \item Malayalam: നിങ്ങളുടെ പേരെന്താണ്? (using Arial Unicode MS) + \item and even domino tiles, 🁇 🀼 🁐 🁋 🁚 🁝, and mahjong tiles: 🀑 🀑 🀑 🀒 🀒 🀒 🀕 🀕 🀕 🀗 🀗 🀗 🀅 🀅 (using FreeFont) + \end{itemlist} + + However, be aware that this only “just works” for Unicode blocks. If you are working with typographically overlapping languages, such as combining English and Vietnamese in one document, things get a lot more complex if you want one font for English and another for Vietnamese. Both of these languagese use Latin blocks, so it is inherently impossible to tell which language is intended based on which Unicode block a character in a word belongs to. + + As an example, this document uses one rule for applying a font for general CJK, and an override with a different font for all Japanese-specific CJK characters. This causes a problem for Chinese, because most Japanese fonts contain fewer characters than are necessary to typeset Chinese: + + \begin{itemlist} + \item Chinese, using the Japanese CJK font, which may have gaps: 我的母语是汉语 (uses Ume Mincho, which does not contain the three Chinese-specific characters used in that phrase) + \end{itemlist} + + We can get around this by turning off automatic font switching, and using an explicit command to temporarily set the font to one that has full Chinese support, using \{\textbackslash uccoff + a fontspec rule + the text we wanted to typeset + \textbackslash uccon\}. This gives us: {\uccoff \fontspec{HAN NOM A} 我的母语是汉语 \uccon} (This now explicitly uses Han Nom A) + + \section{Use} + + In order to get this all to work, the only thing that had to be incidated was a set of transition rules in the preamble: + + \disableTransitionRules + \begin{verbatim} + \usepackage[CJK, Latin, Thai, Sinhala, Malayalam, + DominoTiles, MahjongTiles]{ucharclasses} + \usepackage{fontspec} + \usepackage{bidi} + + \setDefaultTransitions{\fontspec{Code2000}}{} + \setTransitionsForLatin{\fontspec{Palatino Linotype}}{} + \setTransitionsForCJK{\fontspec{SimSun}{} + \setTransitionsForJapanese{\fontspec{Ume Mincho}}{} + + \setTransitionTo{Thai}{\fontspec{IrisUPC}} + \setTransitionTo{Sinhala}{\fontspec{Iskoola Pota}} + \setTransitionTo{Malayalam}{\fontspec{Arial Unicode MS}} + \setTransitionTo{DominoTiles}{\fontspec{FreeSerif}} + \setTransitionTo{MahjongTiles}{\fontspec{FreeSerif}} + \end{verbatim} + \enableTransitionRules + + By default, ucharclasses is agnostic with regards to what you want to at the start or end of Unicode blocks, so while using it for fontswitching is the most obvious application, you could also use it for far more creative purposes. + + \subsection{Overriding ucharclass transitions} + + If you need to “override” ucharclass transition rules (for instance, you want a custom font for a bit of cross-Unicode-block text), you will want to temporarily disable and reenabled XeTeX's interchartoks state. You can do this in three ways: + + \begin{numberlist} + \item call [\textbackslash XeTeXinterchartokstate = 0] before, and [\textbackslash XeTeXinterchartokstate = 1] after you're done, + \item call the macros \textbackslash disableTransitionRules before, and \textbackslash enableTransitionRules after you're done, or + \item call \textbackslash uccoff before, and \textbackslash uccon after you're done. + \end{numberlist} + + This last option is mainly there because it's nice and short, and is more convenient in a scoped environment \{\textbackslash uccoff such as this\textbackslash uccon\} where you only want to override the transition behaviour within a paragraph. If you need it disabled for a few blocks of text instead, the full name commands are probably a better choice, because it makes your .tex more readable. As the base XeTeX command uses the un\LaTeX y “... = ...” construction, it's best to avoid it outside of the preamble (and when using ucharclasses, should not be in the preamble at all). + + \section{Problems with RTL languages} + + The overlapping block problem is especially notable when using RTL/LTR rules for languages such as Arabic or Hebrew. While you would want to be able to specify something along the lines of: + + \begin{verbatim} + \setTransitionsForArabic{\fontspec{Tahoma}\setRTL}{\setLTR} + \end{verbatim} + + this will not work, because Arabic (and Hebrew, and other RTL languages) has things like spaces in it, and so rather than ending with a full sentence that starts with \textbackslash setRTL, then the Arabic text, and then finally \textbackslash setLTR, every word in the Arabic sentence will be wrapped by \textbackslash setRTL and \textbackslash setLTR, effectively getting the typesetting all wrong, because going from Arabic to a space character “leaves” the Arabic block, so the transition rule for leaving the Arabic block is applied. + + If you need script support, rather than Unicode blocks, you may want to have a look at the polyglossia package instead. You can try to combine the two packages by relying on \textbackslash uccoff and textbackslash uccon to turn off Unicode block transitions inside regions of text, but this may not always work, or may have interesting interaction side-effects. + + \section{Commands} + + \subsection{\textbackslash setTransitionTo[2]} + + This command has two arguments: + + \begin{numberlist} + \item The name of the Unicode class to which the transition should apply (see 'Unicode blocks' list) + \item The code you want used when entering this Unicode block + \end{numberlist} + + \subsection{\textbackslash setTransitionFrom[2]} + + This command has two arguments: + + \begin{numberlist} + \item The name of the Unicode class to which the transition should apply (see 'Unicode blocks' list) + \item The code you want used when exiting this Unicode block + \end{numberlist} + + \subsection{\textbackslash setTransitions[3]} + + This command has three arguments: + + \begin{numberlist} + \item The name of the Unicode class to which the transition should apply (see 'Unicode blocks' list) + \item The code you want used when entering this Unicode block + \item The code you want used when exiting this Unicode block + \end{numberlist} + + \subsection{\textbackslash setTransitionsForXXXX[2]} + + There are a number of these commands, pertaining to particular “informal groups”: collections of Unicode blocks which can be considered part of a single meta-block. Available informal groups (the names of which replace the XXXX in the section-stated command) are: + + \begin{itemlist} + \item FullArabic + \item Chinese + \item CJK + \item FullCyrillic + \item Diacritics + \item Greek + \item Korean + \item Japanese + \item Latin + \item Mathematics + \item Phonetics + \item Punctuation + \item Symbols + \item Yi + \end{itemlist} + + Furthermore, these commands have two arguments: + + \begin{numberlist} + \item The code you want used when entering blocks from the command's informal group + \item The code you want used when exiting blocks from the command's informal group + \end{numberlist} + + \subsection{\textbackslash setDefaultTransitions[2]} + + This is a blanket command that lets you set up the same to and from transition rules for all blocks in one go. It has (fairly obviously) two arguments: + + \begin{numberlist} + \item The code you want used when entering any Unicode block + \item The code you want used when exiting any Unicode block + \end{numberlist} + + \section{Code} + + The code relies on running through individual definition blcosk for each Unicode blocks, conditioned to whether ucharclasses is loaded with package options or not: + + \pagebreak + + \disableTransitionRules + \begin{verbatim} + ... + \ifboolexpr{ + togl {@loadAll} or togl {@loadBasicLatin} + }{\@defineUnicodeClass{\BasicLatinClass}{32}{127}} + ... + \end{verbatim} + \enableTransitionRules + + The classes are automatically numbered by using the \textbackslash newXeTeXintercharclass command, and every time a new class is defined, the class counter goes up. After all desired classes have been defined, the code iterates over the class numbers from lower bound to upper bound. + + The block loading code is defined as follows: + + \disableTransitionRules + \begin{verbatim} + \newcounter{glyphcounter} + \newcommand{\@defineUnicodeClass}[3]{ + \newXeTeXintercharclass#1 + \forloop{glyphcounter}{#2}{\value{glyphcounter}<#3}{ + \XeTeXcharclass\value{glyphcounter}=#1} + \XeTeXcharclass#3=#1} + + \newXeTeXintercharclass\@classstart + ... + \ifboolexpr{ + togl {@loadAll} or togl {@loadBasicLatin} + }{\@defineUnicodeClass{\BasicLatinClass}{32}{127}} + ... + \newXeTeXintercharclass\@classend + \end{verbatim} + \enableTransitionRules + + And the transition commands are defined as follows: + + \disableTransitionRules + \begin{verbatim} + \newcommand{\setTransitionsFor}[3]{ + \forloop{iclass}{he\@classstart}{\value{iclass} < \@nameuse{#1Class}}{ + \@transition{he\value{iclass}}{\@nameuse{#1Class}}{{#2}} + \@transition{\@nameuse{#1Class}}{he\value{iclass}}{{#3}}} + \addtocounter{iclass}{2} + \forloop{iclass}{\value{iclass}}{\value{iclass} < he\@classend}{ + \@transition{he\value{iclass}}{\@nameuse{#1Class}}{{#2}} + \@transition{\@nameuse{#1Class}}{he\value{iclass}}{{#3}}} + % and a binding for the transitions to and from boundary characters + \@transition{255}{\@nameuse{#1Class}}{{#2}} + \@transition{\@nameuse{#1Class}}{255}{{#3}}} + + \newcommand{\setTransitionTo}[2] { + \forloop{iclass}{\the\@classstart}{\value{iclass} < \@nameuse{#1Class}}{ + \@transition{\the\value{iclass}}{\@nameuse{#1Class}}{{#2}}} + \addtocounter{iclass}{2} + \forloop{iclass}{\value{iclass}}{\value{iclass} < \the\@classend}{ + \@transition{\the\value{iclass}}{\@nameuse{#1Class}}{{#2}}} + % and a binding for the transition from boundary characters + \@transition{255}{\@nameuse{#1Class}}{{#2}}} + + \newcommand{\setTransitionFrom}[2]{ + \forloop{iclass}{\the\@classstart}{\value{iclass} < \@nameuse{#1Class}}{ + \@transition{\@nameuse{#1Class}}{\the\value{iclass}}{{#2}}} + \addtocounter{iclass}{2} + \forloop{iclass}{\value{iclass}}{\value{iclass} < \the\@classend}{ + \@transition{\@nameuse{#1Class}}{\the\value{iclass}}{{#2}}} + % and a binding for the transition to boundary characters + \@transition{\@nameuse{#1Class}}{255}{{#2}}} + \end{verbatim} + \enableTransitionRules + + The broad level \textbackslash setTransitionsFor(InformalGroupName)[2] commands are essentially wrapper commands, calling \textbackslash setTransitionsFor for each blocks that is in the informal group. For Arabic, for instance, the code is: + + \disableTransitionRules + \begin{verbatim} + \newcommand{\setTransitionsForArabic}[2]{ + \setTransitionsFor{Arabic}{#1}{#2} + \setTransitionsFor{ArabicPresentationFormsA}{#1}{#2} + \setTransitionsFor{ArabicPresentationFormsB}{#1}{#2} + \setTransitionsFor{ArabicSupplement}{#1}{#2} + } + \end{verbatim} + \enableTransitionRules + + \section{Package options and Unicode blocks} + + The following Unicode blocks are available for use in transition rules, as well as for use as package options when you want ucharclasses to only load those classes that you know are used in your document: + + \begin{multicols}{2} + \begin{itemlist} + \item AegeanNumbers + \item AlphabeticPresentationForms + \item AncientGreekMusicalNotation + \item AncientGreekNumbers + \item AncientSymbols + \item Arabic + \item ArabicPresentationFormsA + \item ArabicPresentationFormsB + \item ArabicSupplement + \item Armenian + \item Arrows + \item Balinese + \item BasicLatin + \item Bengali + \item BlockElements + \item Bopomofo + \item BopomofoExtended + \item BoxDrawing + \item BraillePatterns + \item Buginese + \item Buhid + \item ByzantineMusicalSymbols + \item Carian + \item Cham + \item Cherokee + \item CJKCompatibility + \item CJKCompatibilityForms + \item CJKCompatibilityIdeographs + \item CJKCompatibilityIdeographsSupplement + \item CJKRadicalsSupplement + \item CJKStrokes + \item CJKSymbolsandPunctuation + \item CJKUnifiedIdeographs + \item CJKUnifiedIdeographsExtensionA + \item CJKUnifiedIdeographsExtensionB + \item CombiningDiacriticalMarks + \item CombiningDiacriticalMarksforSymbols + \item CombiningDiacriticalMarksSupplement + \item CombiningHalfMarks + \item ControlPictures + \item Coptic + \item CountingRodNumerals + \item Cuneiform + \item CuneiformNumbersandPunctuation + \item CurrencySymbols + \item CypriotSyllabary + \item Cyrillic + \item CyrillicExtendedA + \item CyrillicExtendedB + \item CyrillicSupplement + \item Deseret + \item Devanagari + \item Dingbats + \item DominoTiles + \item EnclosedAlphanumerics + \item EnclosedCJKLettersandMonths + \item Ethiopic + \item EthiopicExtended + \item EthiopicSupplement + \item GeneralPunctuation + \item GeometricShapes + \item Georgian + \item GeorgianSupplement + \item Glagolitic + \item Gothic + \item GreekandCoptic + \item GreekExtended + \item Gujarati + \item Gurmukhi + \item HalfwidthandFullwidthForms + \item HangulCompatibilityJamo + \item HangulJamo + \item HangulSyllables + \item Hanunoo + \item Hebrew + \item Hiragana + \item IdeographicDescriptionCharacters + \item IPAExtensions + \item Kanbun + \item KangxiRadicals + \item Kannada + \item Katakana + \item KatakanaPhoneticExtensions + \item KayahLi + \item Kharoshthi + \item Khmer + \item KhmerSymbols + \item Lao + \item LatinExtendedAdditional + \item LatinExtendedA + \item LatinExtendedB + \item LatinExtendedC + \item LatinExtendedD + \item LatinSupplement + \item Lepcha + \item LetterlikeSymbols + \item Limbu + \item LinearBIdeograms + \item LinearBSyllabary + \item Lycian + \item Lydian + \item MahjongTiles + \item Malayalam + \item MathematicalAlphanumericSymbols + \item MathematicalOperators + \item MiscellaneousMathematicalSymbolsA + \item MiscellaneousMathematicalSymbolsB + \item MiscellaneousSymbols + \item MiscellaneousSymbolsandArrows + \item MiscellaneousTechnical + \item ModifierToneLetters + \item Mongolian + \item MusicalSymbols + \item Myanmar + \item NewTaiLue + \item NKo + \item NumberForms + \item Ogham + \item OldChiki + \item OldItalic + \item OldPersian + \item OpticalCharacterRecognition + \item Oriya + \item Osmanya + \item PhagsPa + \item PhaistosDisc + \item Phoenician + \item PhoneticExtensions + \item PhoneticExtensionsSupplement + \item PrivateUseArea + \item Rejang + \item Runic + \item Saurashtra + \item Shavian + \item Sinhala + \item SmallFormVariants + \item SpacingModifierLetters + \item Specials + \item SuperscriptsandSubscripts + \item SupplementalArrowsA + \item SupplementalArrowsB + \item SupplementalMathematicalOperators + \item SupplementalPunctuation + \item SupplementaryPrivateUseAreaA + \item SupplementaryPrivateUseAreaB + \item SylotiNagri + \item Syriac + \item Tagalog + \item Tagbanwa + \item Tags + \item TaiLe + \item TaiXuanJingSymbols + \item Tamil + \item Telugu + \item Thaana + \item Thai + \item Tibetan + \item Tifinagh + \item Ugaritic + \item UnifiedCanadianAboriginalSyllabics + \item Vai + \item VariationSelectors + \item VariationSelectorsSupplement + \item VerticalForms + \item YiRadicals + \item YiSyllables + \item YijingHexagramSymbols + \end{itemlist} + \end{multicols} + + In addition, the informal blocks for use as package option are: + + \begin{itemlist} + \item FullArabic + \item Chinese + \item CJK + \item FullCyrillic + \item Diacritics + \item Greek + \item Korean + \item Japanese + \item Latin + \item Mathematics + \item Phonetics + \item Punctuation + \item Symbols + \item Yi + \end{itemlist} + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/xelatex/ucharclasses/ucharclasses.sty b/Master/texmf-dist/tex/xelatex/ucharclasses/ucharclasses.sty new file mode 100644 index 00000000000..1617916da32 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/ucharclasses/ucharclasses.sty @@ -0,0 +1,719 @@ +% ---------------------------------------------------------------------------- +% This "ucharclasses" package sets up XeTeX character classes based on which +% unicode block a character is found in. It then allows transition rules to be defined +% when entering or leaving particular unicode blocks, the code of which gets inserted +% automatically when a transition from a character from one unicode block to a +% character from another unicode block is encountered by XeTeX +% +% Current compatibility should be Unicode 6.0, although I may have missed one or +% more blocks that were added between 5 and 6. +% +% License: public domain (http://www.tex.ac.uk/CTAN/help/Catalogue/licenses.pd.html) +% ---------------------------------------------------------------------------- + +\ProvidesPackage{ucharclasses}[2012/09/25 v2.0x Unicode block + character classes for XeLaTeX] + +\newif\if@ucharclassverbose +\DeclareOption{verbose}{\@ucharclassverbosetrue} + +% ---------------------------------------------------------------------------- +% The package options allow you to selectively enable certain unicode blocks +% ---------------------------------------------------------------------------- + +% We first define all blocks in a list together with their start and +% end point + +\def\AllClasses{ +% Unicode 5.1 block definitions + \do{AegeanNumbers}{65792}{65855} + \do{AlphabeticPresentationForms}{64256}{64335} + \do{AncientGreekMusicalNotation}{119296}{119375} + \do{AncientGreekNumbers}{65856}{65935} + \do{AncientSymbols}{65936}{65999} + \do{Arabic}{1536}{1791} + \do{ArabicPresentationFormsA}{64336}{65023} + \do{ArabicPresentationFormsB}{65136}{65279} + \do{ArabicSupplement}{1872}{1919} + \do{Armenian}{1328}{1423} + \do{Arrows}{8592}{8703} + \do{Balinese}{6912}{7039} + \do{BasicLatin}{32}{127} + \do{Bengali}{2432}{2559} + \do{BlockElements}{9600}{9631} + \do{Bopomofo}{12544}{12591} + \do{BopomofoExtended}{12704}{12735} + \do{BoxDrawing}{9472}{9599} + \do{BraillePatterns}{10240}{10495} + \do{Buginese}{6656}{6687} + \do{Buhid}{5952}{5983} + \do{ByzantineMusicalSymbols}{118784}{119039} + \do{Carian}{66208}{66271} + \do{Cham}{43520}{43615} + \do{Cherokee}{5024}{5119} + \do{CJKCompatibility}{13056}{13311} + \do{CJKCompatibilityForms}{65072}{65103} + \do{CJKCompatibilityIdeographs}{63744}{64255} + \do{CJKCompatibilityIdeographsSupplement}{194560}{195103} + \do{CJKRadicalsSupplement}{11904}{12031} + \do{CJKStrokes}{12736}{12783} + \do{CJKSymbolsAndPunctuation}{12288}{12351} + \do{CJKUnifiedIdeographs}{19968}{40959} + \do{CJKUnifiedIdeographsExtensionA}{13312}{19903} + \do{CJKUnifiedIdeographsExtensionB}{131072}{173791} + \do{CJKUnifiedIdeographsExtensionC}{173824}{177983} + \do{CombiningDiacriticalMarks}{768}{879} + \do{CombiningDiacriticalMarksforSymbols}{8400}{8447} + \do{CombiningDiacriticalMarksSupplement}{7616}{7679} + \do{CombiningHalfMarks}{65056}{65071} + \do{ControlPictures}{9216}{9279} + \do{Coptic}{11392}{11519} + \do{CountingRodNumerals}{119648}{119679} + \do{Cuneiform}{73728}{74751} + \do{CuneiformNumbersAndPunctuation}{74752}{74879} + \do{CurrencySymbols}{8352}{8399} + \do{CypriotSyllabary}{67584}{67647} + \do{Cyrillic}{1024}{1279} + \do{CyrillicExtendedA}{11744}{11775} + \do{CyrillicExtendedB}{42560}{42655} + \do{CyrillicSupplement}{1280}{1327} + \do{Deseret}{66560}{66639} + \do{Devanagari}{2304}{2431} + \do{Dingbats}{9984}{10175} + \do{DominoTiles}{127024}{127135} + \do{EnclosedAlphanumerics}{9312}{9471} + \do{EnclosedCJKLettersAndMonths}{12800}{13055} + \do{Ethiopic}{4608}{4991} + \do{EthiopicExtended}{11648}{11743} + \do{EthiopicSupplement}{4992}{5023} + \do{GeneralPunctuation}{8192}{8303} + \do{GeometricShapes}{9632}{9727} + \do{Georgian}{4256}{4351} + \do{GeorgianSupplement}{11520}{11567} + \do{Glagolitic}{11264}{11359} + \do{Gothic}{66352}{66383} + \do{GreekAndCoptic}{880}{1023} + \do{GreekExtended}{7936}{8191} + \do{Gujarati}{2688}{2815} + \do{Gurmukhi}{2560}{2687} + \do{HalfwidthAndFullwidthForms}{65280}{65519} + \do{HangulCompatibilityJamo}{12592}{12687} + \do{HangulJamo}{4352}{4607} + \do{HangulSyllables}{44032}{55215} + \do{Hanunoo}{5920}{5951} + \do{Hebrew}{1424}{1535} + \do{Hiragana}{12352}{12447} + \do{IdeographicDescriptionCharacters}{12272}{12287} + \do{IPAExtensions}{592}{687} + \do{Kanbun}{12688}{12703} + \do{KangxiRadicals}{12032}{12255} + \do{Kannada}{3200}{3327} + \do{Katakana}{12448}{12543} + \do{KatakanaPhoneticExtensions}{12784}{12799} + \do{KayahLi}{43264}{43311} + \do{Kharoshthi}{68096}{68191} + \do{Khmer}{6016}{6143} + \do{KhmerSymbols}{6624}{6655} + \do{Lao}{3712}{3839} + \do{LatinExtendedAdditional}{7680}{7935} + \do{LatinExtendedA}{256}{383} + \do{LatinExtendedB}{384}{591} + \do{LatinExtendedC}{11360}{11391} + \do{LatinExtendedD}{42784}{43007} + \do{LatinSupplement}{128}{255} + \do{Lepcha}{7168}{7247} + \do{LetterlikeSymbols}{8448}{8527} + \do{Limbu}{6400}{6479} + \do{LinearBIdeograms}{65664}{65791} + \do{LinearBSyllabary}{65536}{65663} + \do{Lycian}{66176}{66207} + \do{Lydian}{67872}{67903} + \do{MahjongTiles}{126976}{127023} + \do{Malayalam}{3328}{3455} + \do{MathematicalAlphanumericSymbols}{119808}{120831} + \do{MathematicalOperators}{8704}{8959} + \do{MiscellaneousMathematicalSymbolsA}{10176}{10223} + \do{MiscellaneousMathematicalSymbolsB}{10624}{10751} + \do{MiscellaneousSymbols}{9728}{9983} + \do{MiscellaneousSymbolsAndArrows}{11008}{11263} + \do{MiscellaneousTechnical}{8960}{9215} + \do{ModifierToneLetters}{42752}{42783} + \do{Mongolian}{6144}{6319} + \do{MusicalSymbols}{119040}{119295} + \do{Myanmar}{4096}{4255} + \do{NewTaiLue}{6528}{6623} + \do{NKo}{1984}{2047} + \do{NumberForms}{8528}{8591} + \do{Ogham}{5760}{5791} + \do{OldChiki}{7248}{7295} + \do{OldItalic}{66304}{66351} + \do{OldPersian}{66464}{66527} + \do{OpticalCharacterRecognition}{9280}{9311} + \do{Oriya}{2816}{2943} + \do{Osmanya}{66688}{66735} + \do{PhagsPa}{43072}{43135} + \do{PhaistosDisc}{66000}{66047} + \do{Phoenician}{67840}{67871} + \do{PhoneticExtensions}{7424}{7551} + \do{PhoneticExtensionsSupplement}{7552}{7615} + \do{PrivateUseArea}{57344}{63743} + \do{Rejang}{43312}{43359} + \do{Runic}{5792}{5887} + \do{Saurashtra}{43136}{43231} + \do{Shavian}{66640}{66687} + \do{Sinhala}{3456}{3583} + \do{SmallFormVariants}{65104}{65135} + \do{SpacingModifierLetters}{688}{767} + \do{Specials}{65520}{65535} + \do{SuperscriptsAndSubscripts}{8304}{8351} + \do{SupplementalArrowsA}{10224}{10239} + \do{SupplementalArrowsB}{10496}{10623} + \do{SupplementalMathematicalOperators}{10752}{11007} + \do{SupplementalPunctuation}{11776}{11903} + \do{SupplementaryPrivateUseAreaA}{983040}{1048575} + \do{SupplementaryPrivateUseAreaB}{1048576}{1114111} + \do{SylotiNagri}{43008}{43055} + \do{Syriac}{1792}{1871} + \do{Tagalog}{5888}{5919} + \do{Tagbanwa}{5984}{6015} + \do{Tags}{917504}{917631} + \do{TaiLe}{6480}{6527} + \do{TaiXuanJingSymbols}{119552}{119647} + \do{Tamil}{2944}{3071} + \do{Telugu}{3072}{3199} + \do{Thaana}{1920}{1983} + \do{Thai}{3584}{3711} + \do{Tibetan}{3840}{4095} + \do{Tifinagh}{11568}{11647} + \do{Ugaritic}{66432}{66463} + \do{UnifiedCanadianAboriginalSyllabics}{5120}{5759} + \do{Vai}{42240}{42559} + \do{VariationSelectors}{65024}{65039} + \do{VariationSelectorsSupplement}{917760}{917999} + \do{VerticalForms}{65040}{65055} + \do{YiRadicals}{42128}{42191} + \do{YiSyllables}{40960}{42127} + \do{YijingHexagramSymbols}{19904}{19967} +% Unicode 6.0 block definitions + \do{Mandaic}{2112}{2143} + \do{Batak}{7104}{7167} + \do{EthiopicExtendedA}{43776}{43823} + \do{Brahmi}{69632}{69759} + \do{BamumSupplement}{92160}{92735} + \do{KanaSupplement}{110592}{110847} + \do{PlayingCards}{127136}{127231} + \do{MiscellaneousSymbolsAndPictographs}{127744}{128511} + \do{Emoticons}{128512}{128591} + \do{TransportAndMapSymbols}{128640}{128767} + \do{AlchemicalSymbols}{128768}{128895} + \do{CJKUnifiedIdeographsExtensionD}{177984}{178207} +} +% ---------------------------------------------------------------------------- +% Option handling lets the user turn off "load all" and selectively enable only those blocks +% they are interested in +% ---------------------------------------------------------------------------- + +% Each option starts with \overrideClassLoading; so any specified +% option will set |\if@overrideClassLoading| to true; when one has +% been scanned it's not necessary to set the conditional again. Then +% for block X we let \enableX to \@empty so that later on we can check +% if it is defined + +\newif\if@overrideClassLoading +\newcommand{\overrideClassLoading}{\@overrideClassLoadingtrue + \let\overrideClassLoading\relax} + +\def\do#1#2#3{\DeclareOption{#1}% + {\overrideClassLoading\expandafter\let\csname enable#1\endcsname\@empty}} +% We execute the list with this definition of \do +\AllClasses + +% informal groups +% We define lists also for these groups + +\def\ClassGroups{ + \doclass{Arabic} + \doclass{Chinese} + \doclass{CJK} + \doclass{Cyrillic} + \doclass{Diacritics} + \doclass{Greek} + \doclass{Korean} + \doclass{Japanese} + \doclass{Latin} + \doclass{Mathematics} + \doclass{Phonetics} + \doclass{Punctuation} + \doclass{Symbols} + \doclass{Yi} + \doclass{Other} +} + +\def\ArabicClasses{ + \do{Arabic} + \do{ArabicPresentationFormsA} + \do{ArabicPresentationFormsB} + \do{ArabicSupplement} +} + +\def\ChineseClasses{ + \do{Bopomofo} + \do{BopomofoExtended} + \do{CJKCompatibility} + \do{CJKCompatibilityForms} + \do{CJKCompatibilityIdeographs} + \do{CJKCompatibilityIdeographsSupplement} + \do{CJKRadicalsSupplement} + \do{CJKStrokes} + \do{CJKSymbolsAndPunctuation} + \do{CJKUnifiedIdeographs} + \do{CJKUnifiedIdeographsExtensionA} + \do{CJKUnifiedIdeographsExtensionB} + \do{CJKUnifiedIdeographsExtensionC} + \do{CJKUnifiedIdeographsExtensionD} + \do{EnclosedCJKLettersAndMonths} + \do{IdeographicDescriptionCharacters} + \do{KangxiRadicals} +} + +\def\CJKClasses{ + \do{Bopomofo} + \do{BopomofoExtended} + \do{CJKCompatibility} + \do{CJKCompatibilityForms} + \do{CJKCompatibilityIdeographs} + \do{CJKCompatibilityIdeographsSupplement} + \do{CJKRadicalsSupplement} + \do{CJKStrokes} + \do{CJKSymbolsAndPunctuation} + \do{CJKUnifiedIdeographs} + \do{CJKUnifiedIdeographsExtensionA} + \do{CJKUnifiedIdeographsExtensionB} + \do{CJKUnifiedIdeographsExtensionC} + \do{CJKUnifiedIdeographsExtensionD} + \do{EnclosedCJKLettersAndMonths} + \do{HalfwidthAndFullwidthForms} + \do{HangulCompatibilityJamo} + \do{HangulJamo} + \do{HangulSyllables} + \do{Hiragana} + \do{IdeographicDescriptionCharacters} + \do{Kanbun} + \do{KangxiRadicals} + \do{Katakana} + \do{KatakanaPhoneticExtensions} + \do{KanaSupplement} +} + +\def\CyrillicClasses{ + \do{Cyrillic} + \do{CyrillicExtendedA} + \do{CyrillicExtendedB} + \do{CyrillicSupplement} +} + +\def\DiacriticsClasses{ + \do{CombiningDiacriticalMarks} + \do{CombiningDiacriticalMarksforSymbols} + \do{CombiningDiacriticalMarksSupplement} + \do{CombiningHalfMarks} +} + +\def\GreekClasses{ + \do{Coptic} + \do{GreekAndCoptic} + \do{GreekExtended} +} + +\def\KoreanClasses{ + \do{HangulCompatibilityJamo} + \do{HangulJamo} + \do{HangulSyllables} +} + +\def\JapaneseClasses{ + \do{HalfwidthAndFullwidthForms} + \do{Hiragana} + \do{Kanbun} + \do{KangxiRadicals} + \do{Katakana} + \do{KatakanaPhoneticExtensions} + \do{KanaSupplement} + \do{CJKUnifiedIdeographs} +} + +\def\LatinClasses{ + \do{BasicLatin} + \do{LatinExtendedAdditional} + \do{LatinExtendedA} + \do{LatinExtendedB} + \do{LatinExtendedC} + \do{LatinExtendedD} + \do{LatinSupplement} + \do{AlphabeticPresentationForms} +} + +\def\MathematicsClasses{ + \do{MathematicalAlphanumericSymbols} + \do{MathematicalOperators} + \do{MiscellaneousMathematicalSymbolsA} + \do{MiscellaneousMathematicalSymbolsB} + \do{SupplementalMathematicalOperators} +} + +\def\PhoneticsClasses{ + \do{IPAExtensions} + \do{PhoneticExtensions} + \do{PhoneticExtensionsSupplement} +} + +\def\PunctuationClasses{ + \do{GeneralPunctuation} + \do{SupplementalPunctuation} +} + +\def\SymbolsClasses{ + \do{Arrows} + \do{BoxDrawing} + \do{ByzantineMusicalSymbols} + \do{ControlPictures} + \do{CurrencySymbols} + \do{GeometricShapes} + \do{LetterlikeSymbols} + \do{MiscellaneousSymbols} + \do{MiscellaneousSymbolsAndArrows} + \do{MiscellaneousTechnical} + \do{SupplementalArrowsA} + \do{SupplementalArrowsB} + \do{VariationSelectors} + \do{VariationSelectorsSupplement} + \do{MiscellaneousSymbolsAndPictographs} + \do{Emoticons} + \do{TransportAndMapSymbols} + \do{AlchemicalSymbols} +} + +\def\YiClasses{ + \do{YiRadicals} + \do{YiSyllables} +} + +\def\OtherClasses{ + \do{AegeanNumbers} + \do{AncientGreekMusicalNotation} + \do{AncientGreekNumbers} + \do{Armenian} + \do{Balinese} + \do{Bengali} + \do{BlockElements} + \do{BraillePatterns} + \do{Buginese} + \do{Buhid} + \do{Cherokee} + \do{Coptic} + \do{CountingRodNumerals} + \do{Cuneiform} + \do{CuneiformNumbersAndPunctuation} + \do{CypriotSyllabary} + \do{Deseret} + \do{Devanagari} + \do{Dingbats} + \do{DominoTiles} + \do{EnclosedAlphanumerics} + \do{Ethiopic} + \do{EthiopicExtended} + \do{EthiopicSupplement} + \do{Georgian} + \do{GeorgianSupplement} + \do{Glagolitic} + \do{Gothic} + \do{Gujarati} + \do{Gurmukhi} + \do{Hanunoo} + \do{Hebrew} + \do{Kannada} + \do{Kharoshthi} + \do{Khmer} + \do{KhmerSymbols} + \do{Lao} + \do{Limbu} + \do{LinearBIdeograms} + \do{LinearBSyllabary} + \do{MahjongTiles} + \do{Malayalam} + \do{ModifierToneLetters} + \do{Mongolian} + \do{MusicalSymbols} + \do{Myanmar} + \do{NewTaiLue} + \do{NKo} + \do{NumberForms} + \do{Ogham} + \do{OldItalic} + \do{OldPersian} + \do{OpticalCharacterRecognition} + \do{Oriya} + \do{Osmanya} + \do{PhagsPa} + \do{Phoenician} + \do{PrivateUseArea} + \do{Runic} + \do{Shavian} + \do{Sinhala} + \do{SmallFormVariants} + \do{SpacingModifierLetters} + \do{Specials} + \do{SuperscriptsAndSubscripts} + \do{SupplementaryPrivateUseAreaA} + \do{SupplementaryPrivateUseAreaB} + \do{SylotiNagri} + \do{Syriac} + \do{Tagalog} + \do{Tagbanwa} + \do{Tags} + \do{TaiLe} + \do{TaiXuanJingSymbols} + \do{Tamil} + \do{Telugu} + \do{Thaana} + \do{Thai} + \do{Tibetan} + \do{Tifinagh} + \do{Ugaritic} + \do{UnifiedCanadianAboriginalSyllabics} + \do{VerticalForms} + \do{YijingHexagramSymbols} +} + +% For each class group Z we define the relative option +% \DeclareOption{Z}{\overrideClassLoading\enableX1\enableX2...\enableXn} +% where X1, X2, ..., Xn are the blocks belonging to class Z + +\def\do#1{% + \unexpanded{\expandafter\let\csname enable#1\endcsname\@empty}} +\def\doclass#1{% + \begingroup\edef\x{\endgroup\noexpand\DeclareOption{#1}{% + \noexpand\overrideClassLoading\csname #1Classes\endcsname}}\x} +\ClassGroups + + +\ProcessOptions\relax + +% If no option has been given, \if@overrideClassLoading will still be +% false, and in this case we enable *all* blocks (again by defining +% \enableX equal to \@empty for each block X + +\if@overrideClassLoading\else + \def\do#1#2#3{\expandafter\let\csname enable#1\endcsname\@empty} + \AllClasses +\fi + +% ---------------------------------------------------------------------------- +% After dealing with the options, make sure we have the necessary packages available +% ---------------------------------------------------------------------------- + +% because this package relies on XeTeX's intercharclass sytem, better require XeTeX +\RequirePackage{ifxetex} +\RequireXeTeX + +% ---------------------------------------------------------------------------- +% This package heavily exploits XeTeX's intercharclass system! +% ---------------------------------------------------------------------------- + +% enable/disable commands +\newcommand{\disableTransitionRules}{\XeTeXinterchartokenstate = 0} +\newcommand{\enableTransitionRules}{\XeTeXinterchartokenstate = 1} + +% shorthand commands +\let\uccoff\disableTransitionRules +\let\uccon\enableTransitionRules + +% make sure it's turned on +\enableTransitionRules + +% ---------------------------------------------------------------------------- +% And now, finally, we can start loading all the requested blocks +% ---------------------------------------------------------------------------- + +% \message{Package ucharclasses Message: Assigning character classes per +% Unicode block (this may take a while)} + +%% We record the last allocated class before allocating ours; +%% \newXeTeXintercharclass saves in the counter +%% \xe@alloc@intercharclass the last allocated class number; initially +%% it's 3, but some other code might have allocated interchar classes +%% before loading this package; if \enableX is defined (to \@empty, +%% but that's irrelevant), an intercharclass is allocated by using the +%% list \AllClasses; two cases for block X: +%% +%% (1) \enableX is defined: then \do{X}{a}{b} will become +%% \@defineUnicodeClass{X}{a}{b} which in turn will execute +%% \newXeTeXintercharclass\XClass and start a loop assigning code +%% points from a to b to this class +%% +%% (2) \enableX is not defined: then \do{X}{a}{b} will become +%% \@gobblethree{X}{a}{b} and so nothing will be performed + +\chardef\@classstart=\xe@alloc@intercharclass + +\providecommand\@gobblethree[3]{} +\def\do#1{% + \ifcsname enable#1\endcsname + \expandafter\@defineUnicodeClass + \else + \expandafter\@gobblethree + \fi{#1}} + +\def\@defineUnicodeClass#1#2#3{% + \if@ucharclassverbose\typeout{Defining #1 Class}\fi + \expandafter\newXeTeXintercharclass\csname #1Class\endcsname + \count@=#2 + \loop + \if@ucharclassverbose + \typeout{\XeTeXcharclass\number\count@= + \expandafter\string\csname #1Class\endcsname}% + \fi + \XeTeXcharclass\count@=\csname #1Class\endcsname + \ifnum\count@<#3 + \advance\count@\@ne + \repeat +} +\AllClasses + +% finally, we record the end of our charclass range +\chardef\@classend=\xe@alloc@intercharclass + +%%% Our assigned classes go from \@classstart (excluded) to \@classend (included) + +% ---------------------------------------------------------------------------- +% Use: \setTransitionsFor{block name}{when entering this block}{when leaving this block} +% ---------------------------------------------------------------------------- + +\def\setTransitionsFor#1#2#3{% + \ifcsname enable#1\endcsname + \count@=\@classstart + \loop\ifnum\count@<\@classend + \advance\count@\@ne + \ifnum\count@=\csname #1Class\endcsname\else + \XeTeXinterchartoks\count@ \csname #1Class\endcsname={#2}% + \XeTeXinterchartoks\csname #1Class\endcsname \count@={#3}% + \fi + \repeat + \XeTeXinterchartoks\@cclv\csname #1Class\endcsname={#2}% + \XeTeXinterchartoks\csname #1Class\endcsname\@cclv={#3}% + \else + \if@ucharclassverbose + \PackageWarningNoLine{ucharclasses}{Class #1\MessageBreak + not loaded}% + \fi + \fi +} + +% ---------------------------------------------------------------------------- +% Use: \setTransitionTo{block name}{what to do when entering this block} +% ---------------------------------------------------------------------------- + +\def\setTransitionTo#1#2{% + \ifcsname enable#1\endcsname + \count@=\@classstart + \loop\ifnum\count@<\@classend + \advance\count@\@ne + \ifnum\count@=\csname #1Class\endcsname\else + \XeTeXinterchartoks\count@ \csname #1Class\endcsname={#2}% + \fi + \repeat + \XeTeXinterchartoks\@cclv\csname #1Class\endcsname={#2}% + \else + \if@ucharclassverbose + \PackageWarningNoLine{ucharclasses}{Class #1\MessageBreak + not loaded}% + \fi + \fi +} + +% ---------------------------------------------------------------------------- +% Use: \setTransitionFrom{block name }{what to do when leaving this block} +% ---------------------------------------------------------------------------- + +\def\setTransitionFrom#1#2{% + \ifcsname enable#1\endcsname + \count@=\@classstart + \loop\ifnum\count@<\@classend + \advance\count@\@ne + \ifnum\count@=\csname #1Class\endcsname\else + \XeTeXinterchartoks\csname #1Class\endcsname \count@={#2}% + \fi + \repeat + \XeTeXinterchartoks\csname #1Class\endcsname\@cclv={#2}% + \else + \if@ucharclassverbose + \PackageWarningNoLine{ucharclasses}{Class #1\MessageBreak + not loaded}% + \fi + \fi +} + +% ---------------------------------------------------------------------------- +% Informal Block Rules - for these, to/from must always be defined +% +% Available informal groups are: +% +% - Arabic +% - Chinese (including bopomofo) +% - CJK (Chinese/Japanese/Korean) +% - Cyrillic +% - Diacritics +% - Greek +% - Japanese (it is advised to set CJK first to a catch-all, then set Japanese for specifics) +% - Korean (=Hangul) (same comment as for Japanese) +% - Latin +% - Mathematics +% - Phonetics +% - Punctuation +% - Symbols +% - Yi +% - Other (I am not a fan of lump groups. I hope to un-lump most of it) +% +% ---------------------------------------------------------------------------- + +%% For each class group Z we define \setTransitionsForX as +%% \newcommand\setTransitionsForZ[2]{% +%% \setTransitionsFor{X1}{#1}{#2} +%% \setTransitionsFor{X2}{#1}{#2} +%% ... +%% \setTransitionsFor{Xn}{#1}{#2}} +%% where X1, X2, ..., Xn are the blocks in group Z + +\def\do#1{\noexpand\setTransitionsFor{#1}{####1}{####2}} +\def\doclass#1{ + \begingroup\edef\x{\endgroup + \noexpand\newcommand + \unexpanded\expandafter{\csname setTransitionsFor#1\endcsname}[2]% + {\csname #1Classes\endcsname}}\x} +\ClassGroups + + +% ---------------------------------------------------------------------------- +% +% based on the previous informal groups, we can define a catch-all transition command +% +% ---------------------------------------------------------------------------- + +%% The following is equivalent to define +%% \newcommand{\setDefaultTransitions[2]{ +%% \setTransitionsForArabic{#1}{#2} +%% ... +%% \setTransitionsForOther{#1}{#2}} + +\def\doclass#1{% + \expandafter\noexpand\csname setTransitionsFor#1\endcsname{####1}{####2}} +\begingroup\edef\x{\endgroup + \noexpand\newcommand\noexpand\setDefaultTransitions[2]{% + \ClassGroups}}\x + +% ---------------------------------------------------------------------------- + +\let\do\@undefined\let\doclass\@undefined +\endinput +% +% End of file `ucharclasses.sty'.
\ No newline at end of file diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index d7c3ed6b1e9..c0241c315a9 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -430,7 +430,7 @@ my @TLP_working = qw( twoinone twoup txfonts txfontsb txgreeks type1cm typeface typehtml typeoutfileinfo typogrid - uaclasses uafthesis ucdavisthesis ucs + uaclasses uafthesis ucharclasses ucdavisthesis ucs ucthesis uebungsblatt uiucthesis ukrhyph ulem ulqda umich-thesis uml umlaute umoline diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index a4c66d58c21..e2002ee7107 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -961,7 +961,6 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'typedref', "die 'skipping, nonfree license'", 'typespec', "die 'skipping, nonfree font specimens'", 'uafthesis', "&MAKEnosymlinks", - 'ucharclasses', "die 'skipping, nonfree license'", 'urwchancal', "&MAKEcopy", 'ucs', "&MAKEucs", 'uebungsblatt',"&MAKEflatten", diff --git a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc index b5e025be7b9..1fee1ea4d4a 100644 --- a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc @@ -11,6 +11,7 @@ depend mathspec depend philokalia depend polyglossia depend realscripts +depend ucharclasses depend unisugar depend xecjk depend xecolor diff --git a/Master/tlpkg/tlpsrc/ucharclasses.tlpsrc b/Master/tlpkg/tlpsrc/ucharclasses.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/ucharclasses.tlpsrc |