texlive[71893] Master/texmf-dist: bxpdfver (24jul24)

commits+karl at tug.org commits+karl at tug.org
Wed Jul 24 21:49:57 CEST 2024


Revision: 71893
          https://tug.org/svn/texlive?view=revision&revision=71893
Author:   karl
Date:     2024-07-24 21:49:57 +0200 (Wed, 24 Jul 2024)
Log Message:
-----------
bxpdfver (24jul24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bxpdfver/LICENSE
    trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md
    trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md
    trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty

Modified: trunk/Master/texmf-dist/doc/latex/bxpdfver/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxpdfver/LICENSE	2024-07-24 19:49:48 UTC (rev 71892)
+++ trunk/Master/texmf-dist/doc/latex/bxpdfver/LICENSE	2024-07-24 19:49:57 UTC (rev 71893)
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2014-2022 Takayuki YATO (aka. "ZR")
+Copyright (c) 2014-2024 Takayuki YATO (aka. "ZR")
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md	2024-07-24 19:49:48 UTC (rev 71892)
+++ trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md	2024-07-24 19:49:57 UTC (rev 71893)
@@ -52,7 +52,8 @@
   * `lenient+`: サポートしない機能に対するエラーを完全に抑止する。
   * `nolenient`(既定): `lenient(+)` の否定。  
   * `new-dvipdfmx`: dvipdfmx に対するバージョン検査を省略し、常に最新の
-    バージョンであると仮定する。
+    バージョンであると仮定する。  
+    ※ドライバオプションが `dvipdfmx` に変更される。
 
 `compress`、`objcompress` はこのパッケージによる抑止を行わないという意味
 であり、既に抑止されている場合にそれを再び有効化するものではない。
@@ -72,6 +73,8 @@
   * `\preservepdfdestinations`: PDF 目的地(PDF destination)の名前の
     短縮を抑止し、TeX 文書で指定された名前を用いる。異なる PDF 文書間で
     のリンクを正常に機能させるために必要である。
+  * `\setpdfpkresolution{<解像度>}`: PDF に埋め込まれる PK フォントの
+    解像度(dpi 値)を指定する。
 
 ### ドライバ指定に関する補足
 
@@ -83,30 +86,42 @@
     \suppresspdfobjcompression     Yes        Maybe(*2)  No
     \setpdfdecimaldigits           Yes        Maybe(*2)  No
     \preservepdfdestinations       No-op(*1)  Maybe(*2)  No
+    \setpdfpkresolution            Yes        Maybe(*3)  No
 
  1. pdfTeX/LuaTeX では PDF 目的地の名前が短縮されるることはない。つまり
     `\preservepdfdestinations` は常に有効になっていると見なせる。
- 2. これらの機能を使用するためには、(x)dvipdfmx のバージョンが 20160307
-    以上である必要がある。
-      - バージョン判定のために kpsewhich と extractbb の起動を利用する
-        ため、少なくともこれらのプログラムについて、シェルエスケープが
-        許可されている必要がある。
-      - dvipdfmx のバージョン情報は補助ファイル(.aux)中にキャッシュ
-        される。このため、何か状況が変わった場合は、一旦補助ファイルを
-        削除する必要が生じる。
+ 2. (x)dvipdfmx のバージョンが 20160307 以上である必要がある。
+ 3. (x)dvipdfmx のバージョンが 20211016 以上である必要がある。
 
+dvipdfmx のバージョン判定について:
+
+  - 必要が生じた場合にのみバージョン判定が実行される。
+  - `new-dvipdfmx` オプションを指定した場合は、バージョン判定を全て
+    省略した上で、最新の dvipdfmx を使用していると見なす。
+  - バージョン判定のために kpsewhich と extractbb の起動を利用するため、
+    少なくともこれらのプログラムについて、シェル実行が許可されている
+    必要がある。
+  - バージョン判定は少し時間がかかるため、dvipdfmx のバージョン情報は
+    補助ファイル(.aux)中にキャッシュされる。このため、何か状況が変化
+    した場合は、一旦補助ファイルを削除する必要が生じる。
+
 以下のことにも注意されたい。
 
-  * 使用不可能な機能を使おうと試みるとエラーが発生する。
+  * 使用不可能な機能を使おうと試みるとエラーが発生する。  
+    ※`lenient` オプションが指定された場合はエラーが警告に変更され、
+    また `lenient+` が指定された場合はエラーも警告も抑止される。
   * `dvips` 等の“全く対応していない”若干のドライバオプションを認識
     する。この場合、全ての機能の呼出でエラーが発生する。
-  * `nodvidriver` は特殊で、これを指定した場合は、どの機能の呼出でも
-    エラーは発生しないが、全く何の動作も行わない。
+  * `nodvidriver` オプションは既定で `lenient+` を指定する。つまり、
+    どの機能の呼出でもエラーは発生しないが、全く何の動作も行わない。
 
 
 更新履歴
 --------
 
+  * Version 0.7  ‹2024/07/24›
+      - `\setpdfpkresolution` を(正式に)サポート。(dvipdfmx/XeTeX
+        でも使用可能になった。)
   * Version 0.6  ‹2022/04/28›
       - `lenient+`/`nolenient` オプションを追加。
       - 非サポートのドライバでも読込自体はエラーにしない。

Modified: trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md	2024-07-24 19:49:48 UTC (rev 71892)
+++ trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md	2024-07-24 19:49:57 UTC (rev 71893)
@@ -72,6 +72,8 @@
   * `\preservepdfdestinations`: Stops shortening the PDF destination
     names and uses the original names given in the LaTeX documents. This
     is necessary for cross-document links to work correctly.
+  * `\setpdfpkresolution{<resolution>}`: Sets the resolution (in dpi)
+    of the PK fonts embedded in the PDF file.
 
 ### NOTE ON DRIVERS
 
@@ -83,23 +85,34 @@
     \suppresspdfobjcompression     Yes        Maybe(*2)  No
     \setpdfdecimaldigits           Yes        Maybe(*2)  No
     \preservepdfdestinations       No-op(*1)  Maybe(*2)  No
+    \setpdfpkresolution            Yes        Maybe(*3)  No
 
  1. In pdfTeX and LuaTeX, PDF destination names are never shortened;
     that is, it can be thought as if `\preservepdfdestinations` were
     always in effect.
  2. These features are available only when the version of (x)dvipdfmx
-    is 20160307 or later. Also shell escape must be accepted (with or
-    without restriction) so that `kpsewhich` and `extractbb` will be
-    allowed to run, because those programs are used in order to detect
-    the dvipdfmx version.
+    is 20160307 or later.
+ 2. These features are available only when the version of (x)dvipdfmx
+    is 20211016 or later.
 
+On the detection of dvipdfmx version:
+
+  * Shell escape must be accepted (with or without restriction) so that
+    `kpsewhich` and `extractbb` will be allowed to run, because those
+    programs are used in order to detect the dvipdfmx version.
+  * The detection process is slow, so the result is cached in the
+    auxiliary file (`.aux`). When the environment is changed, you need
+    to delete the auxiliary file.
+
 More notices:
 
-  * If you try to use unavailable features, an error will occur.
+  * If you try to use unavailable features, an error will occur.  
+    NB. Option `lenient` turns the errors into warnings, and `lenient+`
+    completely suppresses the errors.
   * The package recognizes some “unsupported” driver options such as
     `dvips`; when such drivers are used, use of any feature will cause
     an error.
-  * The use of `nodvidriver` sets `lenient*` by default; use of any
+  * The use of `nodvidriver` sets `lenient+` by default; use of any
     feature will do nothing (nor issue an error).
 
 
@@ -106,6 +119,8 @@
 REVISION HISTORY
 ----------------
 
+  * Version 0.7  ‹2024/07/24›
+      - Support (officialy) `\setpdfpkresolution`.
   * Version 0.6  ‹2022/04/28›
       - Added the `lenient+` and `nolenient` options.
   * Version 0.5a ‹2021/02/14›

Modified: trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty	2024-07-24 19:49:48 UTC (rev 71892)
+++ trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty	2024-07-24 19:49:57 UTC (rev 71893)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'bxpdfver.sty'.
 %%
-%% Copyright (c) 2014-2022 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2014-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxpdfver}[2022/04/28 v0.6]
+\ProvidesPackage{bxpdfver}[2024/07/24 v0.7]
 \def\bxpv at pkgname{bxpdfver}
 
 %% preparations
@@ -144,6 +144,13 @@
   \def#3{#2}%
 }
 
+%% \bxpv at info{<message>}
+% Issues an info message.
+\@onlypreamble\bxpv at info
+\def\bxpv at info#1{%
+  \PackageInfo\bxpv at pkgname{#1\@gobble}%
+}
+
 %% \bxpv at warn{<message>}
 % Issues a warning.
 \@onlypreamble\bxpv at warn
@@ -175,10 +182,10 @@
 }
 
 %% \ifbxpv at defined
-\let\ifbxpv at defined\ifdefined
-\ifx\ifbxpv at defined\@undefined \expandafter\@firstofone
-\else \expandafter\@gobble
-\fi{\let\ifbxpv at defined\iffalse}
+% Identical to \ifdefined, and is used only in e-TeX-aware code.
+% On non-e-TeX engines it is made \iffalse to keep \if-balancedness.
+\bxpv at csletcs{ifbxpv at defined}{%
+    if\ifx\ifdefined\@undefined false\else defined\fi}
 
 %% \ifbxpv at old@hook at system
 \newif\ifbxpv at old@hook at system
@@ -186,6 +193,9 @@
 
 %--------------------------------------- internal dispatchers
 
+% Initially all dispatchers are "unavailable".
+% They are later redefined according to the driver type.
+
 %% \bxpv at suppress@compress
 \@onlypreamble\bxpv at suppress@compress
 \def\bxpv at suppress@compress{%
@@ -242,7 +252,7 @@
   \fi
 \fi
 
-%% adjust internal dispatchers
+%% Redefine internal dispatchers.
 \ifx 0\bxpv at drv@type\else               %--------
 \begingroup
 
@@ -386,12 +396,14 @@
   \bxpv at warn
    {Unsupported engine}%
 \else\if d\bxpv at drv@type % 'dvipdfmx'
+  % All the real settings are done in the begin-document hook,
+  % so the dispatchers themselves will do nothing (if available).
   \global\let\bxpv at suppress@compress\relax
   \global\let\bxpv at suppress@obj at compress\relax
   \global\let\bxpv at check@version\relax
   \global\let\bxpv at set@version\relax
   \global\let\bxpv at set@decimaldigits\relax
-  %\global\let\bxpv at set@pkresolution\relax
+  \global\let\bxpv at set@pkresolution\relax
   \global\let\bxpv at preserve@destinations\relax
   \g at addto@macro\bxpv at begin@document at hook{%
     \bxpv at begin@document at dvipdfmx
@@ -671,6 +683,7 @@
 \fi
 
 %% variables
+\let\bxpv at dvipdfmx@known at min\relax
 \let\bxpv at C@value\relax
 
 %% \bxpv at C@bits
@@ -689,6 +702,7 @@
 %% \bxpv at begin@document at dvipdfmx
 \@onlypreamble\bxpv at begin@document at dvipdfmx
 \def\bxpv at begin@document at dvipdfmx{%
+  \bxpv at get@dvipdfmx at known@min
   % PDF version
   \ifx\bxpdfverMajorVersion\tw@
     \bxpv at check@dvipdfmx at version{20180217}%
@@ -701,8 +715,8 @@
       \bxpv at put@special{pdf:minorversion \the\bxpdfverMinorVersion}%
     \fi
     \ifx\bxpdfverMinorVersion\relax\else
-      \bxpv at cache@fetch{dvipdfmxver}%
-      \ifnum\bxpv at cache@@dvipdfmxver<20180217 \else
+      \bxpv at at@least at dvipdfmx@version{20180217}%
+      \ifbxpv at ok
         \bxpv at put@special{pdf:majorversion \the\bxpdfverMajorVersion}%
       \fi
     \fi
@@ -734,7 +748,9 @@
   \fi
   % PK resolution
   \ifx\bxpdfverPkResolution\relax\else
-    \iffalse % This will never work....
+    \bxpv at check@dvipdfmx at version{20211016}%
+     {Cannot set PK resolution}%
+    \ifbxpv at ok
       \bxpv at put@special{dvipdfmx:config r \the\bxpdfverPkResolution}%
     \fi
   \fi
@@ -748,10 +764,9 @@
   \fi
   % C option value
   \ifx\bxpv at C@bits\@empty\else
-    \bxpv at cache@fetch{dvipdfmxcfg}%
-    \def\bxpv at next##1##2\bxpv at mk{\def\bxpv at C@value{##1}}%
-    \expandafter\bxpv at next\bxpv at cache@@dvipdfmxcfg{0}\bxpv at mk
-    \bxpv at rc@bitset{\bxpv at C@value}{64}%
+    % When C option is used, its value is automatically OR'ed with
+    % the current value, so we need read the config for that.
+    \def\bxpv at C@value{0}%
     \def\do##1{%
       \bxpv at rc@bitset{\bxpv at C@value}{##1}%
       \let\bxpv at C@value\bxpv at rc@num}%
@@ -776,25 +791,58 @@
   \fi
 }
 
+%% \bxpv at get@dvipdfmx at known@min
+\@onlypreamble\bxpv at get@dvipdfmx at known@min
+\def\bxpv at get@dvipdfmx at known@min{%
+  \def\bxpv at dvipdfmx@known at min{0}%
+  \def\bxpv at tmpa{def}%
+  \let\bxpv at tmpb\@gobbletwo
+  \@ifl at aded\bxpv at tmpa{l3backend-dvipdfmx}{%
+    \def\bxpv at tmpb{\@ifl at ter\bxpv at tmpa{l3backend-dvipdfmx}}%
+  }{}%
+  \@ifl at aded\bxpv at tmpa{l3backend-dvips}{%
+    \def\bxpv at tmpb{\@ifl at ter\bxpv at tmpa{l3backend-dvips}}%
+  }{}%
+  \bxpv at tmpb{2022/04/10}{%
+    \def\bxpv at dvipdfmx@known at min{20201111}%
+  }{}%
+  \bxDebug{dvipdfmx-known-min:\bxpv at dvipdfmx@known at min}%
+}
+
+%% \bxpv at at@least at dvipdfmx@version{<version>}
+% Checks if dvipdfmx >= <version> and sets bxpv at ok.
+\@onlypreamble\bxpv at at@least at dvipdfmx@version
+\def\bxpv at at@least at dvipdfmx@version#1{%
+  % first check using known-min
+  \ifnum\bxpv at dvipdfmx@known at min<#1
+    % get real version
+    \bxpv at cache@fetch{dvipdfmxver}%
+    \bxpv at info
+     {dvipdfmx version is \bxpv at cache@@dvipdfmxver}%
+    \bxpv at oktrue
+    \ifnum\bxpv at cache@@dvipdfmxver<#1
+      \bxpv at okfalse
+    \fi
+  \else % new enough
+    \bxpv at oktrue
+  \fi
+}
+
 %% \bxpv at check@dvipdfmx at version
 \@onlypreamble\bxpv at check@dvipdfmx at version
 \def\bxpv at check@dvipdfmx at version#1#2{%
-  \bxpv at cache@fetch{dvipdfmxver}%
-  \bxpv at okfalse
-  \ifnum\bxpv at cache@@dvipdfmxver=\z@
+  \bxpv at at@least at dvipdfmx@version{#1}%
+  \ifbxpv at ok % no-op
+  \else\ifnum\bxpv at cache@@dvipdfmxver=\z@
     \bxpv at fail
      {#2, because the\MessageBreak
       version of dvipdfmx in use is unknown
       \MessageBreak (v.#1 or later is required)}%
-  \else\ifnum\bxpv at cache@@dvipdfmxver<#1
+  \else
     \bxpv at fail
      {#2, because the\MessageBreak
       version of dvipdfmx in use (v.\bxpv at cache@@dvipdfmxver) is too old
       \MessageBreak (v.#1 or later is required)}%
-  \else
-    \PackageInfo\bxpv at pkgname
-     {dvipdfmx version is \bxpv at cache@@dvipdfmxver\@gobble}%
-    \bxpv at oktrue
   \fi\fi
 }
 



More information about the tex-live-commits mailing list.