diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def | 267 |
1 files changed, 61 insertions, 206 deletions
diff --git a/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def b/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def index 044bc38d6e5..a01c63be14b 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/graphics-def/dvipdfmx.def @@ -1,13 +1,13 @@ -%% This is file `dvipdfmx.def' for DVIPDFMx by J.-H. Cho and S. Hirata -%% based upon `dvipdf.def' in the LaTeX `Graphics Bundle'. +%% dvipdfmx.def Copyright (C) 2005-2017 LaTeX3 Project, Jin-Hwan Cho, Shunsaku Hirata +%% (with contributions from many others) %% -%% Copyright 2005-2016 LaTeX3 Project, Jin-Hwan Cho, Shunsaku Hirata -%% (with contributions from many others) -%% -%% This file is not part of the Standard LaTeX `Graphics Bundle'. -%% It may be distributed under the terms of the LaTeX Project Public -%% License, as described in lppl.txt in the base LaTeX distribution. -%% Either version 1.0 or, at your option, any later version. +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. %% @@ -16,25 +16,7 @@ %% https://github.com/latex3/graphics-def/issues %% \ProvidesFile{dvipdfmx.def} - [2016/07/11 v4.12 LaTeX color/graphics driver for dvipdfmx (L3/ChoF)] -% -% miniltx.tex does not define \PackageWarning -\@ifundefined{PackageWarning}{% - \def\PackageWarning#1#2{% - \begingroup - \def\@spaces{\space\space\space\space}% - \ifx\on@line\@undefined\def\on@line{}\fi - \newlinechar=10 % - \def\MessageBreak{% - ^^J(#1)\@spaces\@spaces\@spaces\@spaces - }% - \immediate\write16{^^JPackage #1 Warning: #2\on@line.^^J}% - \endgroup - }% -}{} - -\def\GPT@warn{\PackageWarning{dvipdfmx.def}}% - + [2017/06/01 v5.0a Graphics/color driver for dvipdfmx] \def\c@lor@arg#1{% \dimen@#1\p@ \ifdim\dimen@<\z@\dimen@\maxdimen\fi @@ -71,15 +53,6 @@ \dimen@#1\p@ \divide\dimen@\@cclv \edef#2{\strip@pt\dimen@}} -%% -%% the following 7 lines do not work. (2016/06/22) -%%\def\color@hsb#1#2{\c@lor@@hsb#2\@@#1} -%%\def\c@lor@@hsb#1,#2,#3\@@#4{% -%% \c@lor@arg{#1}% -%% \c@lor@arg{#2}% -%% \c@lor@arg{#3}% -%% \edef#4{[#1 #2 #3] hsb}% -%% } \def\color@named#1#2{\c@lor@@named#2,,\@@#1} \def\c@lor@@named#1,#2,#3\@@#4{% \@ifundefined{col@#1}% @@ -102,87 +75,25 @@ pdf:bgcolor \current@color}} \def\define@color@named#1#2{% \expandafter\let\csname col@#1\endcsname\@nnil} -% -% Graphics -% -\def\declareimagemask{% - \@ifnextchar[\declareimagemask@i{\declareimagemask@i[]}} -\def\declareimagemask@i[#1]#2#3{% - \special{pdf:image @#2\space hide (#3) #1}} -% -% import from pdftex.def -% -\let\GPT@pagebox@option\@empty -\begingroup -\toks@{% -\define@key{Gin}{page}{\def\Gin@page{#1}} -\define@key{Gin}{mask}{\def\Gin@mask{#1}} -\define@key{Gin}{interpolate}[true]{% - \lowercase{\Gin@boolkey{#1}}{interpolate}} -\define@key{Gin}{pagebox}{% - \expandafter\let\expandafter\GPT@pagebox% - \csname GPT@pagebox@#1\endcsname - \ifx\GPT@pagebox\relax - \let\GPT@pagebox\@empty - \GPT@warn{% - Unknown value `#1' for `pagebox'.\MessageBreak - Supported values:\MessageBreak - mediabox, cropbox, bleedbox, trimbox, artbox% - }% - \else% - \def\GPT@pagebox@option{-B \GPT@pagebox\space}% - \fi% -}% -} -\@ifundefined{define@key}{ - \edef\x{\endgroup - \noexpand\AtBeginDocument{% - \noexpand\@ifundefined{define@key}{}{\the\toks@}% - }% - }\x - }{% - \expandafter\endgroup\the\toks@ - }% - -\def\GPT@pagebox@cropbox{cropbox}% -\def\GPT@pagebox@mediabox{mediabox}% -\def\GPT@pagebox@artbox{artbox}% -\def\GPT@pagebox@trimbox{trimbox}% -\def\GPT@pagebox@bleedbox{bleedbox}% -% -% end (import from pdftex.def) -% -% improved by N. Abe to cache BoundingBox for pdfpages package -% +\@ifundefined{Gin@page} + {\let\Gin@page\@empty} + {} +\@ifundefined{Gin@pagebox} + {\def\Gin@page{cropbox}} + {} +\@ifundefined{Gin@interpolate} + {\csname newif\endcsname\ifGin@interpolate} + {} \def\Gread@pdf#1{% -\edef\@tempa{pdf@bbox@cache@\Gin@page @\GPT@pagebox @#1}% -\expandafter\expandafter\expandafter\@ifundefined\expandafter{\@tempa}{\Gread@@pdf{#1}}{% -\edef\@gtempa{\csname\@tempa\endcsname}% -\expandafter\Gread@parse@bb\@gtempa\\}} -\def\Gread@@pdf#1{% - \begingroup - \@tempcnta\z@ - \loop\ifnum\@tempcnta<\@xxxii - \catcode\@tempcnta14 % - \advance\@tempcnta\@ne - \repeat - \catcode`\^^?14 % - \let\do\@makeother - \dospecials - \catcode`\ 10 % - \catcode`\^^I10 % - \catcode\endlinechar5 % - \@makeother\:% - \@makeother\-% - \immediate\openin\@inputcheck"#1" % allow spaces in a name of a .xbb file + \Gread@generic{#1}\Gread@extractbb@aux +} +\def\Gread@extractbb@aux#1{% \ifeof\@inputcheck - \def\@tempc{!}% - \ifx\Gin@page\@tempc - \def\@tempc{}% - \else - \def\@tempc{-p \Gin@page\space}% - \fi - \immediate\openin\@inputcheck="|extractbb \GPT@pagebox@option \@tempc -O \Gin@base\Gin@ext"% + \immediate\openin\@inputcheck=% + "|extractbb % + \ifx\Gin@page\@empty\else -p \Gin@page\space\fi + \ifx\Gin@pagebox\@empty\else -B \Gin@pagebox\space\fi + -O \Gin@base\Gin@ext"% \fi \Gread@true \let\@tempb\Gread@false @@ -203,102 +114,34 @@ \repeat \immediate\closein\@inputcheck \fi -% -% If BoundingBox is not obtained, extractbb may be an old one which does not -% support the -p and/or -B options, and usage of extractbb is printed to stdout. -% Thus we retry without the -p and/or -B optons. -% - \ifGin@bbox\else - \immediate\openin\@inputcheck="|extractbb -O \Gin@base\Gin@ext"% - \message{^^JI try without the new options^^J}% - \Gread@true - \let\@tempb\Gread@false - \ifeof\@inputcheck - \@latex@error - {Cannot run pipe command. Try --shell-escape^^J% - (--enable-pipes in MikTeX) option}% - {}% - \else - \loop - \read\@inputcheck to\@tempa - \ifeof\@inputcheck - \Gread@false - \else - \expandafter\Gread@find@bb\@tempa:.\\% - \fi - \ifGread@ - \repeat - \immediate\closein\@inputcheck - \aftergroup\Gin@clear@pagebox - \fi - \fi -% -% improved by N. Abe to cache BoundingBox for pdfpages package -% - \ifGin@bbox - \edef\@tempa{pdf@bbox@cache@\Gin@page @\GPT@pagebox @#1}% - \expandafter\expandafter\expandafter\xdef\expandafter\csname\@tempa\endcsname{\@gtempa}% - \else - \@latex@error - {Cannot determine size of image (no BoundingBox)}% - {}% - \gdef\@gtempa{0 0 72 72 }% - \fi - \endgroup - \expandafter\Gread@parse@bb\@gtempa\\} -\def\Gin@clear@pagebox{% - \let\GPT@pagebox\@empty} +} \let\Gread@bmp\Gread@pdf -\def\Gin@page{!} -\def\Gin@mask{!} -\newif\ifGin@interpolate\Gin@interpolatefalse -\let\GPT@pagebox\@empty \def\Ginclude@pdf#1{% - \message{<#1>}% + \Gin@interpolatefalse + \Ginclude@dvipdfmx{#1}{epdf}% +} +\def\Ginclude@bmp#1{% + \let\Gin@page\@empty + \let\Gin@pagebox\@empty + \Ginclude@dvipdfmx{#1{image}}% +} +\def\Ginclude@dvipdfmx#1#2{% + \Gin@log{<#1>}% \bgroup \def\@tempa{!}% - \special{pdf:epdf\space - \ifx\Gin@page\@tempa\else page\space\Gin@page\space\fi - \ifx\GPT@pagebox\@empty\else pagebox\space\GPT@pagebox\space\fi + \special{pdf:#2\space + \ifx\Gin@page\@empty\else page\space\Gin@page\space\fi + \ifx\Gin@pagebox\@empty\else pagebox\space\Gin@pagebox\space\fi bbox\space\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury\space clip\space\ifGin@clip 1\else 0\fi\space \ifx\Gin@scalex\@tempa\else width\space\the\Gin@req@width\space\fi \ifx\Gin@scaley\@tempa\else height\space\the\Gin@req@height\space\fi (#1)\space - \ifx\Gin@mask\@tempa - \ifGin@interpolate<</Interpolate\space true>>\fi - \else - <</SMask @\Gin@mask\space% - \ifGin@interpolate/Interpolate\space true\fi>>% - \fi}% - \egroup} -\def\Ginclude@bmp#1{% - \message{<#1>}% - \bgroup - \def\@tempa{!}% - \special{pdf:image\space - \ifx\Gin@page\@tempa\else page\space\Gin@page\space\fi - % The next line was \ifGin@bbox previously. However, LaTeX can read - % BoundingBox from a .xbb file even when \Gin@bboxfalse. - % Thus, we give bbox in the cases of trim/viewport, since - % trim/viewport don't work without bbox. - \ifx\Gin@ollx\@undefined\else - bbox\space\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury\space - clip\space\ifGin@clip 1\else 0\fi\space - \fi - \ifx\Gin@scalex\@tempa\else width\space\the\Gin@req@width\space\fi - \ifx\Gin@scaley\@tempa\else height\space\the\Gin@req@height\space\fi - (#1)\space - \ifx\Gin@mask\@tempa - \ifGin@interpolate<</Interpolate\space true>>\fi - \else - <</SMask @\Gin@mask\space% - \ifGin@interpolate/Interpolate\space true\fi>>% - \fi}% + \ifGin@interpolate<</Interpolate\space true>>\fi}% \egroup} \newif\if@trim@vport \def\Ginclude@eps#1{% - \message{<#1>}% + \Gin@log{<#1>}% \bgroup \ifx\Undefined\Gin@vllx\else\@trim@vporttrue\fi \def\@tempa{!}% @@ -345,7 +188,7 @@ % the option --mvorigin. % \def\Ginclude@mps#1{% - \message{<#1>}% + \Gin@log{<#1>}% \bgroup \def\@tempa{!}% \dimen@\Gin@req@width @@ -366,9 +209,25 @@ \def\Grot@start{% \special{pdf:btrans rotate \Grot@angle}} \def\Grot@end{\special{pdf:etrans}} + +% 4.13 add support for ptex vertical writing mode +% inspired by pxtatescale package (Hironobu Yamashita) +\ifx\kanjiskip\@undefined \def\Gscale@start{% \special{pdf:btrans}% - \special{pdf:literal \Gscale@x\space 0 0 \Gscale@y\space 0 0 cm}} + \special{x:scale \Gscale@x\space\Gscale@y}% +} +\else +\edef\Gscale@start{% + \special{pdf:btrans}% + \special{x:scale + \expandafter\noexpand\csname iftdir\endcsname + \noexpand\Gscale@y\noexpand\space\noexpand\Gscale@x + \expandafter\noexpand\csname else\endcsname + \noexpand\Gscale@x\noexpand\space\noexpand\Gscale@y + \expandafter\noexpand\csname fi\endcsname}} +\fi +% \def\Gscale@end{\special{pdf:etrans}} \def\Gin@PS@raw#1{\special{ps: #1}} \def\Gin@PS@restored#1{\special{" #1}} @@ -459,7 +318,3 @@ } \fi \fi - -\endinput -%% -%% End of file `dvipdfmx.def'. |