| 1 |
%%^^A%% fontspec-code-enc.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 2 |
|
| 3 |
% \section{Extended font encodings} |
| 4 |
% |
| 5 |
% \iffalse |
| 6 |
% \begin{macrocode} |
| 7 |
%<*fontspec> |
| 8 |
% \end{macrocode} |
| 9 |
% \fi |
| 10 |
% |
| 11 |
% |
| 12 |
% \begin{macro}{\EncodingCommand} |
| 13 |
% \begin{macrocode} |
| 14 |
\DeclareDocumentCommand \EncodingCommand { m O{} O{} m } |
| 15 |
{ |
| 16 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 17 |
{ \@@_error:nn {only-inside-encdef} \EncodingCommand } |
| 18 |
\DeclareTextCommand{#1}{\UnicodeEncodingName}[#2][#3]{#4} |
| 19 |
} |
| 20 |
% \end{macrocode} |
| 21 |
% \end{macro} |
| 22 |
% |
| 23 |
% \begin{macro}{\EncodingAccent} |
| 24 |
% \begin{macrocode} |
| 25 |
\DeclareDocumentCommand \EncodingAccent {mm} |
| 26 |
{ |
| 27 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 28 |
{ \@@_error:nn {only-inside-encdef} \EncodingAccent } |
| 29 |
\DeclareTextCommand{#1}{\UnicodeEncodingName}{\add@unicode@accent{#2}} |
| 30 |
} |
| 31 |
% \end{macrocode} |
| 32 |
% \end{macro} |
| 33 |
% |
| 34 |
% \begin{macro}{\EncodingSymbol} |
| 35 |
% \begin{macrocode} |
| 36 |
\DeclareDocumentCommand \EncodingSymbol {mm} |
| 37 |
{ |
| 38 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 39 |
{ \@@_error:nn {only-inside-encdef} \EncodingSymbol } |
| 40 |
\DeclareTextSymbol{#1}{\UnicodeEncodingName}{#2} |
| 41 |
} |
| 42 |
% \end{macrocode} |
| 43 |
% \end{macro} |
| 44 |
% |
| 45 |
% \begin{macro}{\EncodingComposite} |
| 46 |
% \begin{macrocode} |
| 47 |
\DeclareDocumentCommand \EncodingComposite {mmm} |
| 48 |
{ |
| 49 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 50 |
{ \@@_error:nn {only-inside-encdef} \EncodingComposite } |
| 51 |
\DeclareTextComposite{#1}{\UnicodeEncodingName}{#2}{#3} |
| 52 |
} |
| 53 |
% \end{macrocode} |
| 54 |
% \end{macro} |
| 55 |
% |
| 56 |
% \begin{macro}{\EncodingCompositeCommand} |
| 57 |
% \begin{macrocode} |
| 58 |
\DeclareDocumentCommand \EncodingCompositeCommand {mmm} |
| 59 |
{ |
| 60 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 61 |
{ \@@_error:nn {only-inside-encdef} \EncodingCompositeCommand } |
| 62 |
\DeclareTextCompositeCommand{#1}{\UnicodeEncodingName}{#2}{#3} |
| 63 |
} |
| 64 |
% \end{macrocode} |
| 65 |
% \end{macro} |
| 66 |
% |
| 67 |
% \begin{macro}{\DeclareUnicodeEncoding} |
| 68 |
% \begin{macrocode} |
| 69 |
\DeclareDocumentCommand \DeclareUnicodeEncoding {mm} |
| 70 |
{ |
| 71 |
\DeclareFontEncoding{#1}{}{} |
| 72 |
\DeclareFontSubstitution{#1}{lmr}{m}{n} |
| 73 |
\DeclareFontFamily{#1}{lmr}{} |
| 74 |
|
| 75 |
\DeclareFontShape{#1}{lmr}{m}{n} |
| 76 |
{<->\UnicodeFontFile{lmroman10-regular}{\UnicodeFontTeXLigatures}}{} |
| 77 |
\DeclareFontShape{#1}{lmr}{m}{it} |
| 78 |
{<->\UnicodeFontFile{lmroman10-italic}{\UnicodeFontTeXLigatures}}{} |
| 79 |
\DeclareFontShape{#1}{lmr}{m}{sc} |
| 80 |
{<->\UnicodeFontFile{lmromancaps10-regular}{\UnicodeFontTeXLigatures}}{} |
| 81 |
\DeclareFontShape{#1}{lmr}{bx}{n} |
| 82 |
{<->\UnicodeFontFile{lmroman10-bold}{\UnicodeFontTeXLigatures}}{} |
| 83 |
\DeclareFontShape{#1}{lmr}{bx}{it} |
| 84 |
{<->\UnicodeFontFile{lmroman10-bolditalic}{\UnicodeFontTeXLigatures}}{} |
| 85 |
|
| 86 |
\tl_set_eq:NN \l_@@_prev_unicode_name_tl \UnicodeEncodingName |
| 87 |
\tl_set:Nn \UnicodeEncodingName {#1} |
| 88 |
\bool_set_true:N \l_@@_defining_encoding_bool |
| 89 |
#2 |
| 90 |
\bool_set_false:N \l_@@_defining_encoding_bool |
| 91 |
\tl_set_eq:NN \UnicodeEncodingName \l_@@_prev_unicode_name_tl |
| 92 |
} |
| 93 |
% \end{macrocode} |
| 94 |
% \end{macro} |
| 95 |
% |
| 96 |
% \begin{macro}{\UndeclareSymbol} |
| 97 |
% \begin{macro}{\UndeclareAccent} |
| 98 |
% \begin{macro}{\UndeclareCommand} |
| 99 |
% Synonyms for each other but all included for completeness. |
| 100 |
% \begin{macrocode} |
| 101 |
\DeclareDocumentCommand \UndeclareSymbol {m} |
| 102 |
{ |
| 103 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 104 |
{ \@@_error:nn {only-inside-encdef} \UndeclareSymbol } |
| 105 |
\UndeclareTextCommand {#1} {\UnicodeEncodingName} |
| 106 |
} |
| 107 |
\DeclareDocumentCommand \UndeclareAccent {m} |
| 108 |
{ |
| 109 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 110 |
{ \@@_error:nn {only-inside-encdef} \UndeclareAccent } |
| 111 |
\UndeclareTextCommand {#1} {\UnicodeEncodingName} |
| 112 |
} |
| 113 |
\DeclareDocumentCommand \UndeclareCommand {m} |
| 114 |
{ |
| 115 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 116 |
{ \@@_error:nn {only-inside-encdef} \UndeclareCommand } |
| 117 |
\UndeclareTextCommand {#1} {\UnicodeEncodingName} |
| 118 |
} |
| 119 |
% \end{macrocode} |
| 120 |
% \end{macro} |
| 121 |
% \end{macro} |
| 122 |
% \end{macro} |
| 123 |
% |
| 124 |
% \begin{macro}{\UndeclareComposite} |
| 125 |
% \begin{macrocode} |
| 126 |
\DeclareDocumentCommand \UndeclareComposite {mm} |
| 127 |
{ |
| 128 |
\bool_if:NF \l_@@_defining_encoding_bool |
| 129 |
{ \@@_error:nn {only-inside-encdef} \UndeclareComposite } |
| 130 |
\cs_undefine:c |
| 131 |
{ \c_backslash_str \UnicodeEncodingName \token_to_str:N #1 - \tl_to_str:n {#2} } |
| 132 |
} |
| 133 |
% \end{macrocode} |
| 134 |
% \end{macro} |
| 135 |
% |
| 136 |
% \iffalse |
| 137 |
% \begin{macrocode} |
| 138 |
%</fontspec> |
| 139 |
% \end{macrocode} |
| 140 |
% \fi |
| 141 |
|
| 142 |
|
| 143 |
\endinput |
| 144 |
|
| 145 |
% /© |
| 146 |
% ------------------------------------------------ |
| 147 |
% The FONTSPEC package <latex3.github.io/fontspec> |
| 148 |
% ------------------------------------------------ |
| 149 |
% Copyright 2022-2025 The LaTeX project, LPPL "maintainer" |
| 150 |
% Copyright 2004-2022 Will Robertson |
| 151 |
% Copyright 2009-2015 Khaled Hosny |
| 152 |
% Copyright 2013 Philipp Gesang |
| 153 |
% Copyright 2013-2016 Joseph Wright |
| 154 |
% ------------------------------------------------ |
| 155 |
% This package is free software and may be redistributed and/or modified under |
| 156 |
% the conditions of the LaTeX Project Public License, version 1.3c or higher |
| 157 |
% (your choice): <http://www.latex-project.org/lppl/>. |
| 158 |
% ------------------------------------------------ |
| 159 |
% ©/ |