diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-26 22:22:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-26 22:22:51 +0000 |
commit | 7b7fe1bdeb83f129ceff31a7907db12d8e9340cd (patch) | |
tree | de774131dc96fecd0e48a413895a48852b84fbe2 | |
parent | 4c14a44dc79def4cc89414a6af85369e6aa87f93 (diff) |
graphics-def (26feb21)
git-svn-id: svn://tug.org/texlive/trunk@57951 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/graphics-def/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def | 65 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/graphics-def/xetex.def | 65 |
3 files changed, 131 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/graphics-def/README.md b/Master/texmf-dist/doc/latex/graphics-def/README.md index 4abc4f9279d..f97f5793ead 100644 --- a/Master/texmf-dist/doc/latex/graphics-def/README.md +++ b/Master/texmf-dist/doc/latex/graphics-def/README.md @@ -1,7 +1,7 @@ LaTeX support for color and graphics ==================================== -Release 2020-10-05 +Release 2021-02-26 This bundle contains the 'engine-dependent' part of support for color and graphics in LaTeX2e (the code here will also function diff --git a/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def b/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def index 0944ae0d884..30599167977 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def @@ -336,3 +336,68 @@ } \fi \fi +% Updates for newer dvipdfmx versions +% Loaded last as we can then bail-out if not required +\begingroup + \ifcsname\detokenize{c__kernel_sys_dvipdfmx_version_int}\endcsname + \edef\extractbbversion{% + \number\csname\detokenize{c__kernel_sys_dvipdfmx_version_int}\endcsname}% + \else + \immediate\openin 0 = |"extractbb --version" + \ifeof0 % + \def\extractbbversion{0}% + \else + \read0 to \extractbbversion % \par + \ifeof0 % + \def\extractbbversion{0}% + \else + \read0 to \extractbbversion + \long\def\getextractbbversion#1Version #2 #3\stop{% + \def\extractbbversion{#2}}% + \expandafter\getextractbbversion\extractbbversion Version 0 \stop + \fi + \fi + \fi +\ifnum\extractbbversion<20201111 % + \endgroup + \expandafter\endinput +\else + \endgroup +\fi +% Conversion functions so the internal representation stays unchanged +\let\init@current@color\current@color +\def\convert@color#1{% + \ifx#1\init@current@color + \expandafter\convert@color@init + \else + \expandafter\convert@@color + \fi + #1% +} +\def\convert@color@init#1{0 g 0 G} +\def\convert@@color#1{% + \expandafter\expandafter\expandafter\convert@@@color#1\stop +} +\def\convert@@@color#1 #2\stop{% + \csname convert@color@#1\endcsname{#2}% +} +\def\convert@color@cmyk#1{#1 k #1 K} +\def\convert@color@gray#1{#1 g #1 G} +\def\convert@color@rgb#1{#1 rg #1 RG} +% Change the specials to use the stack +\chardef\main@pdfcolorstack=1 % +\ifx\AtBeginDvi\undefined + \long\def\@firstofone#1{#1}% + \expandafter\@firstofone +\else + \expandafter\AtBeginDvi +\fi + {\special{pdfcolorstackinit \the\main@pdfcolorstack\space page direct (0 g 0 G)}} +\def\@pdfcolorstack{\the\main@pdfcolorstack\space} +\def\set@color{% + \special{pdfcolorstack \@pdfcolorstack push (\convert@color\current@color)}% + \aftergroup \reset@color +} +\def\reset@color{% + \special{pdfcolorstack \@pdfcolorstack pop}% +} diff --git a/Master/texmf-dist/tex/latex/graphics-def/xetex.def b/Master/texmf-dist/tex/latex/graphics-def/xetex.def index 5364b6ccc98..6f37ccc3d4a 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/xetex.def +++ b/Master/texmf-dist/tex/latex/graphics-def/xetex.def @@ -435,3 +435,68 @@ } \fi \fi +% Updates for newer dvipdfmx versions +% Loaded last as we can then bail-out if not required +\begingroup + \ifcsname\detokenize{c__kernel_sys_dvipdfmx_version_int}\endcsname + \edef\extractbbversion{% + \number\csname\detokenize{c__kernel_sys_dvipdfmx_version_int}\endcsname}% + \else + \immediate\openin 0 = |"extractbb --version" + \ifeof0 % + \def\extractbbversion{0}% + \else + \read0 to \extractbbversion % \par + \ifeof0 % + \def\extractbbversion{0}% + \else + \read0 to \extractbbversion + \long\def\getextractbbversion#1Version #2 #3\stop{% + \def\extractbbversion{#2}}% + \expandafter\getextractbbversion\extractbbversion Version 0 \stop + \fi + \fi + \fi +\ifnum\extractbbversion<20201111 % + \endgroup + \expandafter\endinput +\else + \endgroup +\fi +% Conversion functions so the internal representation stays unchanged +\let\init@current@color\current@color +\def\convert@color#1{% + \ifx#1\init@current@color + \expandafter\convert@color@init + \else + \expandafter\convert@@color + \fi + #1% +} +\def\convert@color@init#1{0 g 0 G} +\def\convert@@color#1{% + \expandafter\expandafter\expandafter\convert@@@color#1\stop +} +\def\convert@@@color#1 #2\stop{% + \csname convert@color@#1\endcsname{#2}% +} +\def\convert@color@cmyk#1{#1 k #1 K} +\def\convert@color@gray#1{#1 g #1 G} +\def\convert@color@rgb#1{#1 rg #1 RG} +% Change the specials to use the stack +\chardef\main@pdfcolorstack=1 % +\ifx\AtBeginDvi\undefined + \long\def\@firstofone#1{#1}% + \expandafter\@firstofone +\else + \expandafter\AtBeginDvi +\fi + {\special{pdfcolorstackinit \the\main@pdfcolorstack\space page direct (0 g 0 G)}} +\def\@pdfcolorstack{\the\main@pdfcolorstack\space} +\def\set@color{% + \special{pdfcolorstack \@pdfcolorstack push (\convert@color\current@color)}% + \aftergroup \reset@color +} +\def\reset@color{% + \special{pdfcolorstack \@pdfcolorstack pop}% +} |