Skip to content

Commit

Permalink
code doc update (fontload)
Browse files Browse the repository at this point in the history
again #496
  • Loading branch information
wspr committed May 12, 2024
1 parent 11e87bb commit 15fc6a8
Showing 1 changed file with 63 additions and 4 deletions.
67 changes: 63 additions & 4 deletions fontspec-code-fontload.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,65 @@

% \section{expl3 interface for primitive font loading}
%
% \begin{function}{\@@_primitive_font_set:Nnn,\@@_primitive_font_gset:Nnn}
% \begin{syntax}
% |\@@_primitive_font_set:Nnn| \meta{font cs} \Arg{file/name} \Arg{size (dim.\ expr)}
% \end{syntax}
% Wrapper around \TeX\ \cs{font} primitive.
% \end{function}
%
% \begin{function}{\@@_font_suppress_not_found_error:}
% Wrapper around \XeTeX\/Lua\TeX\ primitive, used to be able to programmatically query font existence.
% \end{function}
%
% \begin{function}[pTF]{\@@_primitive_font_if_null:N}
% \begin{syntax}
% |\@@_primitive_font_if_null:NTF| \meta{font cs} \Arg{true code} \Arg{false code}
% \end{syntax}
% Query whether the \meta{font cs} is the \cs{nullfont}.
% \end{function}
%
% \begin{function}[TF]{\@@_primitive_font_set:Nnn,\@@_primitive_font_gset:Nnn}
% \begin{syntax}
% |\@@_primitive_font_set:NnnTF| \meta{font cs} \Arg{file/name} \Arg{size (dim.\ expr)} \Arg{true code} \Arg{false code}
% \end{syntax}
% Attempts to set the \meta{font cs} and provide branching for success or failure according to whether the font exists.
% \end{function}
%
% \begin{function}[TF]{\@@_primitive_font_if_exist:n}
% \begin{syntax}
% |\@@_primitive_font_if_exist:nTF| \Arg{file/name} \Arg{true code} \Arg{false code}
% \end{syntax}
% Attempts to load the font at the current font size minus 1\,sp with a dummy meta{font cs}
% (\verb|\l_@@_primitive_font|), and branches according to whether the font exists.
% This is intended to be used speculatively before potentially performing additional processing
% steps (e.g., an analysis of available font features) before setting up the `true' font.
% \end{function}
%
% \begin{function}[pTF]{\@@_primitive_font_glyph_if_exist:Nn}
% \begin{syntax}
% |\@@_primitive_font_glyph_if_exist:nTF| \meta{font cs} \Arg{char. number (int.\ expr)} \Arg{true code} \Arg{false code}
% \end{syntax}
% Wrapper around primitive \cs{iffontchar}.
% \end{function}
%
% \begin{function}{\@@_primitive_font_set_hyphenchar:Nn}
% \begin{syntax}
% |\@@_primitive_font_set_hyphenchar:Nn| \meta{font cs} \Arg{char. number (int.\ expr)}
% \end{syntax}
% Setter function around primitive \cs{hyphenchar}.
% \end{function}
%
% \begin{function}{\@@_primitive_font_get_name:N,\@@_primitive_font_current_name:}
% \begin{syntax}
% |\@@_primitive_font_get_name:N| \meta{font cs}
% \end{syntax}
% Wrapper function around \TeX\ primitive \cs{fontname}. The no-argument version is
% equivalent to \verb|\fontname\font|.
% \end{function}
%
% \section{Implementation}
%
% \iffalse
% \begin{macrocode}
%<*fontspec>
Expand Down Expand Up @@ -45,7 +104,7 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[pTF]{\@@_primitive_font_set:NnnTF,\@@_primitive_font_gset:NnnTF}
% \begin{macro}[TF]{\@@_primitive_font_set:Nnn,\@@_primitive_font_gset:Nnn}
% \begin{macrocode}
\prg_new_conditional:Nnn \@@_primitive_font_set:Nnn {TF,T,F}
{
Expand Down Expand Up @@ -78,11 +137,11 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_primitive_font_glyph_if_exist:NnTF}
% \begin{macro}[pTF]{\@@_primitive_font_glyph_if_exist:Nn}
% \begin{macrocode}
\prg_new_conditional:Nnn \@@_primitive_font_glyph_if_exist:Nn {p,TF,T,F}
{
\tex_iffontchar:D #1 #2 \scan_stop:
\tex_iffontchar:D #1 \int_eval:n {#2} \scan_stop:
\prg_return_true:
\else:
\prg_return_false:
Expand All @@ -95,7 +154,7 @@
% \begin{macrocode}
\cs_new:Nn \@@_primitive_font_set_hyphenchar:Nn
{
\tex_hyphenchar:D #1 = #2 \scan_stop:
\tex_hyphenchar:D #1 = \int_eval:n {#2} \scan_stop:
}
% \end{macrocode}
% \end{macro}
Expand Down

0 comments on commit 15fc6a8

Please sign in to comment.