summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
blob: f25ee8fbbb654777a84c17f825295d07037cf912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

% \section{expl3 interface for primitive font loading}
%
% \iffalse
%    \begin{macrocode}
%<*fontspec&(xetexx|luatex)>
%    \end{macrocode}
% \fi
%
% \begin{macro}{\@@_primitive_font_set:Nnn,\@@_primitive_font_gset:Nnn}
%    \begin{macrocode}
\cs_set:Npn \@@_primitive_font_set:Nnn #1#2#3
  {
    \font #1 = #2 ~at~ #3 \scan_stop:
  }
%    \end{macrocode}
%    \begin{macrocode}
\cs_set:Npn \@@_primitive_font_gset:Nnn #1#2#3
  {
    \global \font #1 = #2 ~at~ #3 \scan_stop:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_font_suppress_not_found_error:}
%    \begin{macrocode}
\cs_set:Npn \@@_font_suppress_not_found_error:
  {
    \int_set_eq:NN \xetex_suppressfontnotfounderror:D \c_one
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[pTF]{\@@_primitive_font_if_null:N}
%    \begin{macrocode}
\prg_set_conditional:Nnn \@@_primitive_font_if_null:N {p,TF,T,F}
  {
    \ifx #1 \nullfont
      \prg_return_true:
    \else
      \prg_return_false:
    \fi
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[TF]{\@@_primitive_font_if_exist:n}
%    \begin{macrocode}
\prg_set_conditional:Nnn \@@_primitive_font_if_exist:n {TF,T,F}
  {
    \group_begin:
      \@@_font_suppress_not_found_error:
      \@@_primitive_font_set:Nnn \l_@@_primitive_font {#1} {10pt}
      \@@_primitive_font_if_null:NTF \l_@@_primitive_font
        { \group_end: \prg_return_false: }
        { \group_end: \prg_return_true:  }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_primitive_font_glyph_if_exist:NnTF}
%    \begin{macrocode}
\prg_new_conditional:Nnn \@@_primitive_font_glyph_if_exist:Nn {p,TF,T,F}
  {
    \etex_iffontchar:D #1 #2 \scan_stop:
      \prg_return_true:
    \else:
      \prg_return_false:
    \fi:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_primitive_font_set_hyphenchar:Nn}
%    \begin{macrocode}
\cs_new:Nn \@@_primitive_font_set_hyphenchar:Nn
  {
     \tex_hyphenchar:D #1 = #2 \scan_stop:
  }
%    \end{macrocode}
% \end{macro}
%
% \iffalse
%    \begin{macrocode}
%</fontspec&(xetexx|luatex)>
%    \end{macrocode}
% \fi