%%
%% This is file `ptrace.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% plfonts.dtx  (with options: `trace')
%% 
%% Copyright (c) 2010 ASCII MEDIA WORKS
%% Copyright (c) 2016-2020 Japanese TeX Development Community
%% 
%% This file is part of the pLaTeX2e system (community edition).
%% -------------------------------------------------------------
%% 
%% File: plfonts.dtx
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{ptrace}
     [2021/06/27 v1.7n Standard pLaTeX package (font tracing)]
\RequirePackageWithOptions{tracefnt}
\plIncludeInRelease{2020/04/12}{\selectfont}
                   {Check \KanjiEncodingPair}%
\ifx\delayed@f@adjustment\@undefined % --- for <= 2020-10-01 BEGIN
%%
\DeclareRobustCommand\selectfont{%
  \let\tmp@error@fontshape\error@fontshape
  \let\error@fontshape\error@kfontshape
  \edef\tmp@item{{\k@encoding}}%
  \expandafter\expandafter\expandafter
  \inlist@\expandafter\tmp@item\expandafter{\kyenc@list}%
  \ifin@
    \let\cy@encoding\k@encoding
    \ensure@KanjiEncodingPair{t}%
    \edef\ct@encoding{\csname t@enc@\k@encoding\endcsname}%
  \else
    \expandafter\expandafter\expandafter
    \inlist@\expandafter\tmp@item\expandafter{\ktenc@list}%
    \ifin@
      \let\ct@encoding\k@encoding
      \ensure@KanjiEncodingPair{y}%
      \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}%
    \else
      \@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
    \fi
  \fi
  \let\font\tfont
  \let\k@encoding\ct@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \let\font\jfont
  \let\k@encoding\cy@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \expandafter\def\expandafter\k@encoding\tmp@item
  \kenc@update
  \let\error@fontshape\tmp@error@fontshape
  \if@knjcmd \@knjcmdfalse
    \expandafter\ifx
    \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax
      \expandafter\ifx
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax
      \else
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname
      \fi
    \else
       \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname
    \fi
  \fi
  \let\font\afont
  \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \ifnum \tracingfonts>\tw@
    \@font@info{Roman:Switching to \font@name}\fi
  \enc@update
  \ifx\f@linespread\baselinestretch \else
    \set@fontsize\baselinestretch\f@size\f@baselineskip
  \fi
  \size@update}
%%
\else        % --- for <= 2020-10-01 END & for >= 2021-06-01 BEGIN
%%
\DeclareRobustCommand\selectfont{%
  % !! sync with ltfsstrc.dtx 2021/04/26 v3.0o BEGIN
  \ifx\delayed@k@adjustment\@empty
  \else
    \let\k@shape@saved\k@shape
    \let\k@series@saved\k@series
    \delayed@k@adjustment
    \begingroup\let\f@encoding\k@encoding\let\f@family\k@family
      \maybe@load@fontshape\endgroup
    \ifcsname \k@encoding/\k@family/\k@series/\k@shape \endcsname
    \else
      \let\k@shape\k@shape@saved
      \let\k@series\k@series@saved
      \let\delayed@merge@kanji@shape\merge@kanji@shape
      \let\delayed@merge@kanji@series\merge@kanji@series
      \delayed@k@adjustment
      \let\delayed@merge@kanji@shape\merge@kanji@shape@without@substitution
      \let\delayed@merge@kanji@series\merge@kanji@series@without@substitution
    \fi
    \let\delayed@k@adjustment\@empty
  \fi
  \@forced@series@kanjifalse
  % !! sync with ltfsstrc.dtx 2021/04/26 v3.0o END
  \let\tmp@error@fontshape\error@fontshape
  \let\error@fontshape\error@kfontshape
  \edef\tmp@item{{\k@encoding}}%
  \expandafter\expandafter\expandafter
  \inlist@\expandafter\tmp@item\expandafter{\kyenc@list}%
  \ifin@
    \let\cy@encoding\k@encoding
    \ensure@KanjiEncodingPair{t}%
    \edef\ct@encoding{\csname t@enc@\k@encoding\endcsname}%
  \else
    \expandafter\expandafter\expandafter
    \inlist@\expandafter\tmp@item\expandafter{\ktenc@list}%
    \ifin@
      \let\ct@encoding\k@encoding
      \ensure@KanjiEncodingPair{y}%
      \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}%
    \else
      \@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
    \fi
  \fi
  \let\font\tfont
  \let\k@encoding\ct@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \let\font\jfont
  \let\k@encoding\cy@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \expandafter\def\expandafter\k@encoding\tmp@item
  \kenc@update
  \let\error@fontshape\tmp@error@fontshape
  \if@knjcmd \@knjcmdfalse
    \expandafter\ifx
    \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax
      \expandafter\ifx
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax
      \else
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname
      \fi
    \else
       \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname
    \fi
  \fi
  % !! sync with ltfsstrc.dtx 2021/04/26 v3.0o BEGIN
  \ifx\delayed@f@adjustment\@empty
  \else
    \let\f@shape@saved\f@shape
    \let\f@series@saved\f@series
    \delayed@f@adjustment
    \maybe@load@fontshape
    \ifcsname \f@encoding/\f@family/\f@series/\f@shape \endcsname
    \else
      \let\f@shape\f@shape@saved
      \let\f@series\f@series@saved
      \let\delayed@merge@font@shape\merge@font@shape
      \let\delayed@merge@font@series\merge@font@series
      \delayed@f@adjustment
      \let\delayed@merge@font@shape\merge@font@shape@without@substitution
      \let\delayed@merge@font@series\merge@font@series@without@substitution
    \fi
    \let\delayed@f@adjustment\@empty
  \fi
  \@forced@seriesfalse
  % !! sync with ltfsstrc.dtx 2021/04/26 v3.0o END
  \let\font\afont
  \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \UseHook{selectfont}% since LaTeX2e 2021-06-01
  \enc@update
  \ifx\f@linespread\baselinestretch \else
    \set@fontsize\baselinestretch\f@size\f@baselineskip
  \fi
  \size@update}
%%
\fi          % --- for >= 2021-06-01 END
\plEndIncludeInRelease
\plIncludeInRelease{0000/00/00}{\selectfont}
                   {ASCII Corporation original}%
\DeclareRobustCommand\selectfont{%
  \let\tmp@error@fontshape\error@fontshape
  \let\error@fontshape\error@kfontshape
  \edef\tmp@item{{\k@encoding}}%
  \expandafter\expandafter\expandafter
  \inlist@\expandafter\tmp@item\expandafter{\kyenc@list}%
  \ifin@
    \let\cy@encoding\k@encoding
    \edef\ct@encoding{\csname t@enc@\k@encoding\endcsname}%
  \else
    \expandafter\expandafter\expandafter
    \inlist@\expandafter\tmp@item\expandafter{\ktenc@list}%
    \ifin@
      \let\ct@encoding\k@encoding
      \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}%
    \else
      \@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
    \fi
  \fi
  \let\font\tfont
  \let\k@encoding\ct@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \let\font\jfont
  \let\k@encoding\cy@encoding
  \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \expandafter\def\expandafter\k@encoding\tmp@item
  \kenc@update
  \let\error@fontshape\tmp@error@fontshape
  \if@knjcmd \@knjcmdfalse
    \expandafter\ifx
    \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax
      \expandafter\ifx
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax
      \else
         \csname rel@\k@encoding/\k@family/\k@series/all\endcsname
      \fi
    \else
       \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname
    \fi
  \fi
  \let\font\afont
  \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
  \pickup@font
  \font@name
  \ifnum \tracingfonts>\tw@
    \@font@info{Roman:Switching to \font@name}\fi
  \enc@update
  \ifx\f@linespread\baselinestretch \else
    \set@fontsize\baselinestretch\f@size\f@baselineskip
  \fi
  \size@update}
\plEndIncludeInRelease
\plIncludeInRelease{2017/04/08}{\set@fontsize}
                   {Construct \ystrutbox}%
\def\set@fontsize#1#2#3{%
    \@defaultunits\@tempdimb#2pt\relax\@nnil
    \edef\f@size{\strip@pt\@tempdimb}%
    \@defaultunits\@tempskipa#3pt\relax\@nnil
    \edef\f@baselineskip{\the\@tempskipa}%
    \edef\f@linespread{#1}%
    \let\baselinestretch\f@linespread
    \def\size@update{%
      \baselineskip\f@baselineskip\relax
      \baselineskip\f@linespread\baselineskip
      \normalbaselineskip\baselineskip
      \adjustbaseline
      \setbox\ystrutbox\hbox{\yoko
          \vrule\@width\z@
                \@height.7\baselineskip \@depth.3\baselineskip}%
      \setbox\tstrutbox\hbox{\tate
          \vrule\@width\z@
                \@height.5\baselineskip \@depth.5\baselineskip}%
      \setbox\zstrutbox\hbox{\tate
          \vrule\@width\z@
                \@height.7\baselineskip \@depth.3\baselineskip}%
    \ifnum \tracingfonts>\tw@
      \ifx\f@linespread\@empty
        \let\reserved@a\@empty
      \else
        \def\reserved@a{\f@linespread x}%
      \fi
      \@font@info{Changing size to\space
            \f@size/\reserved@a \f@baselineskip}%
      \aftergroup\type@restoreinfo
    \fi
        \let\size@update\relax}}
\plEndIncludeInRelease
\plIncludeInRelease{0000/00/00}{\set@fontsize}
                   {ASCII Corporation original}%
\def\set@fontsize#1#2#3{%
    \@defaultunits\@tempdimb#2pt\relax\@nnil
    \edef\f@size{\strip@pt\@tempdimb}%
    \@defaultunits\@tempskipa#3pt\relax\@nnil
    \edef\f@baselineskip{\the\@tempskipa}%
    \edef\f@linespread{#1}%
    \let\baselinestretch\f@linespread
    \def\size@update{%
      \baselineskip\f@baselineskip\relax
      \baselineskip\f@linespread\baselineskip
      \normalbaselineskip\baselineskip
      \adjustbaseline
      \setbox\strutbox\hbox{\yoko
          \vrule\@width\z@
                \@height.7\baselineskip \@depth.3\baselineskip}%
      \setbox\tstrutbox\hbox{\tate
          \vrule\@width\z@
                \@height.5\baselineskip \@depth.5\baselineskip}%
      \setbox\zstrutbox\hbox{\tate
          \vrule\@width\z@
                \@height.7\baselineskip \@depth.3\baselineskip}%
    \ifnum \tracingfonts>\tw@
      \ifx\f@linespread\@empty
        \let\reserved@a\@empty
      \else
        \def\reserved@a{\f@linespread x}%
      \fi
      \@font@info{Changing size to\space
            \f@size/\reserved@a \f@baselineskip}%
      \aftergroup\type@restoreinfo
    \fi
        \let\size@update\relax}}
\plEndIncludeInRelease
\plIncludeInRelease{2019/10/01}{\adjustbaseline}
                   {Make robust}%
\DeclareRobustCommand\adjustbaseline{%
    \setbox\adjust@box\hbox{\char\jis"3441}%"
    \cht\ht\adjust@box
    \cdp\dp\adjust@box
    \cwd\wd\adjust@box
    \cvs\normalbaselineskip
    \chs\cwd
    \cHT\cht \advance\cHT\cdp
  \iftdir
    \setbox\adjust@box\hbox{\tbaselineshift\z@ M}%
    \adjust@dimen\ht\adjust@box
    \advance\adjust@dimen\dp\adjust@box
    \advance\adjust@dimen-\cHT
    \divide\adjust@dimen\tw@
    \advance\adjust@dimen\cdp
    \advance\adjust@dimen-\dp\adjust@box
    \tbaselineshift\adjust@dimen
    \ifnum \tracingfonts>\tw@
      \typeout{baselineshift:\the\tbaselineshift}%
    \fi
  \fi}
\plEndIncludeInRelease
\plIncludeInRelease{2017/07/29}{\adjustbaseline}
                   {Change zenkaku reference}%
\def\adjustbaseline{%
    \setbox\adjust@box\hbox{\char\jis"3441}%"
    \cht\ht\adjust@box
    \cdp\dp\adjust@box
    \cwd\wd\adjust@box
    \cvs\normalbaselineskip
    \chs\cwd
    \cHT\cht \advance\cHT\cdp
  \iftdir
    \setbox\adjust@box\hbox{\tbaselineshift\z@ M}%
    \adjust@dimen\ht\adjust@box
    \advance\adjust@dimen\dp\adjust@box
    \advance\adjust@dimen-\cHT
    \divide\adjust@dimen\tw@
    \advance\adjust@dimen\cdp
    \advance\adjust@dimen-\dp\adjust@box
    \tbaselineshift\adjust@dimen
    \ifnum \tracingfonts>\tw@
      \typeout{baselineshift:\the\tbaselineshift}%
    \fi
  \fi}
\expandafter \let \csname adjustbaseline \endcsname \@undefined
\plEndIncludeInRelease
\plIncludeInRelease{0000/00/00}{\adjustbaseline}
                   {ASCII Corporation original}%
\def\adjustbaseline{%
    \setbox\adjust@box\hbox{\char\euc"A1A1}%"
    \cht\ht\adjust@box
    \cdp\dp\adjust@box
    \cwd\wd\adjust@box
    \cvs\normalbaselineskip
    \chs\cwd
    \cHT\cht \advance\cHT\cdp
  \iftdir
    \setbox\adjust@box\hbox{\tbaselineshift\z@ M}%
    \adjust@dimen\ht\adjust@box
    \advance\adjust@dimen\dp\adjust@box
    \advance\adjust@dimen-\cHT
    \divide\adjust@dimen\tw@
    \advance\adjust@dimen\cdp
    \advance\adjust@dimen-\dp\adjust@box
    \tbaselineshift\adjust@dimen
    \ifnum \tracingfonts>\tw@
      \typeout{baselineshift:\the\tbaselineshift}
    \fi
  \fi}
\expandafter \let \csname adjustbaseline \endcsname \@undefined
\plEndIncludeInRelease
\endinput
%%
%% End of file `ptrace.sty'.
