% \iffalse meta-comment
%
%% File: rule-D.dtx Copyright (C) 2017-2021 Markus Kohm
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the "GS1 bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -------------------------------------------------------------------------
%
%<*driver|package>
\RequirePackage{expl3}[2019/01/17]
\GetIdInfo$Id: rule-D.dtx 23 2021-06-17 07:00:36Z mjk $
  {rule functions for LaTeX3}
%</driver|package>
%<*driver>
\documentclass{l3doc}
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
%   The \pkg{rule-D} Package\\
%   Rule Functions\thanks
%     {^^A
%       This file describes v\ExplFileVersion,
%       last revised \ExplFileDate.^^A
%     }^^A
% }
%
% \author{^^A
%   Markus Kohm\thanks
%     {^^A
%       E-mail: \href{mailto:komascript@gmx.info}{komascript@gmx.info}^^A
%     }^^A
% }
%
% \date{Released \ExplFileDate}
%
% \maketitle
%
% \begin{documentation}
%   At \LaTeXe{} you have command \cmd{\rule} to make horizontal and vertical
%   rules and even boxes.  Currently there's no L3 command for this.  This
%   module provides two new L3 functions for rules.  The ``-D'' in the module
%   name indicates, that currently the implementation uses deprecated
%   functions like \cmd{\tex_vrule:D}.  Nevertheless, the new rule functions
%   aren't declared to be deprecated.
%
%   This package has been made only, because \pkg{GS1} needs such rule
%   functions.  So maybe it's simply a helper package for \pkg{GS1}.
%
%
% \begin{function}{\rule:nn , \rule:nnn}
%   \begin{syntax}
%     "\rule:nnn" \Arg{dimexpr_{raise}} \Arg{dimexpr_{width}}^^A
% \Arg{dimexpr_{height}}
%     "\rule:nn"  \Arg{dimexpr_{width}} \Arg{dimexpr_{height}}
%   \end{syntax}
%   Draw a rule of width \meta{dimexpr_{width}}, height
%   \meta{dimexpr_{height}} and raise it by \meta{dimexpr_{raise}}. It the
%   \meta{dimex_{raise}} has not been given, the rule will be drawn at the
%   base line.
% \end{function}
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{\pkg{rule-D} implementation}
% \label{sec:rule-D:implementation}
%
%    \begin{macrocode}
%<*package>
%<@@=rule>
%    \end{macrocode}
%
% First of all we have to setup package information:
%    \begin{macrocode}
\ProvidesExplPackage
  {rule-D} {\ExplFileDate} {\ExplFileVersion}
  {experimental~L3~rule~functions}
%    \end{macrocode}
%
% \begin{macro}[updated = 2021-06-17]{\rule:nn , \rule:nnn}
%    \begin{macrocode}
\cs_new:Npn \rule:nn #1#2
  {
    \rule:nnn { \c_zero_dim } { #1 } { #2 }
  }
\cs_new:Npn \rule:nnn #1#2#3
  {
%    \end{macrocode}
% \changes{v23}{2021/06/17}{deprecated \cs{hbox_unpack_clear} replaced by
%   \cs{hbox_unpack_drop}}
% Following line is same like \cs{leavevmode}, but it's \LaTeX3 instead of
% plain\TeX.
%    \begin{macrocode}
    \hbox_unpack_drop:N \c_empty_box
    \hbox:n
      {
        \tex_vrule:D width \dim_eval:n { #2 }
                     height \dim_eval:n { #1 + #3 } 
                     depth -\dim_eval:n { #1 }
      }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \end{implementation}
%
% \PrintIndex
%
\endinput
%
% end of file

% \endinput
% Local Variables:
% mode: doctex
% TeX-master: t
% End: