diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2006-09-29 15:15:10 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2006-09-29 15:15:10 +0000 |
commit | 387cf3625583fb046baf756f72f188924f35cfe2 (patch) | |
tree | 6e09f2e03b9c590a9f14689dfdb4d77ed66e773d /Build/source/texk/xdvipdfmx/contrib | |
parent | fe77ff4cdab25604b424a273c726920830f63abc (diff) |
adding xdvipdfmx sources
git-svn-id: svn://tug.org/texlive/trunk@2220 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvipdfmx/contrib')
6 files changed, 1809 insertions, 0 deletions
diff --git a/Build/source/texk/xdvipdfmx/contrib/context/spec-dpx.tex b/Build/source/texk/xdvipdfmx/contrib/context/spec-dpx.tex new file mode 100644 index 00000000000..0feffbf0b90 --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/context/spec-dpx.tex @@ -0,0 +1,841 @@ +%D \module +%D [ file=spec-dpx, +%D version=2005.08.12, +%D title=\CONTEXT\ Special Macros, +%D subtitle=DVIPDFMx support, +%D author=Jin-Hwan Cho, +%D date=\currentdate, +%D copyright={Jin-Hwan Cho \& Hans Hagen}] +%C +%C DVIPDFMx is an eXtended version of the DVIPDFM, a DVI to PDF +%C translator, still under construction by Jin-Hwan Cho and +%C Shunsaku Hirata. +%C +%C It supports multi-byte character encodings and large character +%C sets for East Asian languages by CID-keyed font technology, +%C and many features including PDF encryption, PDF bookmarks and +%C annotations with Chinese, Japanese, Korean characters, etc. +%C +%C DVIPDFMx (and information) can be downloaded from: +%C +%C http://project.ktug.or.kr/dvipdfmx/ + +\unprotect + +%D This driver is built on top of the general \PDF\ macros, +%D as defined in \type{spec-fdf}, so we inherit that one. + +\startspecials[dpx][reset,fdf] + +%D 1. Modified codes from \type{spec-dpm} + +%D \macros +%D {jobsuffix} +%D +%D Because no intermediate output format is used, we set the +%D jobsuffix to \PDF. + +\setjobsuffix{pdf} + +%D Map files (experimental) + +\definespecial\doloadmapfile#1#2% + {\flushatshipout{\special{pdf:mapfile +#2}}} + +%D DVIPDFMx supports the special command \type{pdf: literal ...} +%D since the version \type{dvipdfmx-20021028}. +%D +%D 1. \type{pdf: literal #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 x y cm"} +%D to set the current DVI position $(x,y)$ to the origin. +%D +%D 2. \type{pdf: literal reverse #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 -x -y cm"}. +%D +%D 3. \type{pdf: literal direct #1} puts directly the given PDF +%D commands \#1 without changing the text matrix. +%D +%D Since the version \type{dvipdfmx-20050812}, the role of the special +%D command \type{pdf:literal} is changed so that +%D +%D 1. \type{pdf:literal #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 x y cm"} +%D to set the current DVI position $(x,y)$ to the origin. After that +%D it restores the previous setting by changing the text matrix with +%D \type{"1 0 0 1 -x -y cm"}. +%D +%D 2. \type{pdf:literal direct #1} puts directly the given PDF commands +%D #1 without changing the text matrix. +%D +%D Literal \PDF\ inclusion is implemented as: + +\def\PDFcode #1{\special{pdf:literal #1}} +\def\PDFcontentcode#1{\special{pdf:content #1}} +\def\PDFdirectcode #1{\special{pdf:literal direct #1}} + +%D \type{\dosetuppaper} in \type{spec-dpm} did not work properly +%D because DVIPDFM did not permit changing the page size. +%D +%D However, DVIPDFMx permits different page size in each page +%D since the version \type{dvipdfmx-20021028}. +%D +%D \macros +%D {dosetuppaper} +%D +%D A simple one. + +\definespecial\dosetuppaper#1#2#3% + {\bgroup + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf:pagesize width \width height \height}% + \egroup} + +%D \macros +%D {doinsertfile} +%D +%D Only \METAPOST, \BMP\ \JPG\ \PNG\ and \PDF\ inclusion are supported. + +\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9% + {\dodoinsertfile{dpx}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}} + +%D Even though DVIPDFM supports \METAPOST directly, the funtionality +%D is not good. It conflicts much with \CONTEXT. +%D +%D So, \METAPOST will be treated as the same way as PDFTeX using +%D MPtoPDF in DVIPDFMx since the version \type{dvipdfmx-20021028}. + +%\definefileinsertion{dpx}{mps}#1#2#3#4#5#6#7#8#9% +% {\hbox +% {%\convertMPcolors{#1}% plugged in supp-mpe +% \scratchdimen#3\points \PointsToReal{.01\scratchdimen}\xscale +% \scratchdimen#4\points \PointsToReal{.01\scratchdimen}\yscale +% \convertMPtoPDF{#1}\xscale\yscale +% \global\let\PDFimagereference\empty}} + +%D DVIPDFM (and DVIPDFMx too) supports the image files with +%D the extension, \PDF, \JPG, \PNG, \BMP, and \EPS. + +\def\handleepsimage#1#2#3#4#5#6#7#8#9% + {\PointsToWholeBigPoints{#7}\width + \PointsToWholeBigPoints{#8}\height + \special + {PSfile="#1"\space + llx=\EPSllx\space lly=\EPSlly\space + urx=\EPSurx\space ury=\EPSury\space + rwi=\width0\space rhi=\height0}} + +\definefileinsertion{dpx}{mps}{\handleepsimage} +\definefileinsertion{dpx}{eps}{\handleepsimage} % unstable + +\def\handlebmpimage#1#2#3#4#5#6#7#8#9% + {\bgroup + \scratchdimen#7\edef\width {\the\scratchdimen\space}% + \scratchdimen#8\edef\height{\the\scratchdimen\space}% + \special{pdf: image width \width height \height (#1)}% + \egroup} + +\definefileinsertion{dpx}{pdf}{\handlebmpimage} +\definefileinsertion{dpx}{jpg}{\handlebmpimage} +\definefileinsertion{dpx}{png}{\handlebmpimage} +\definefileinsertion{dpx}{bmp}{\handlebmpimage} + +\definefileinsertion{dpx}{mov}{\doPDFinsertmov} +\definefileinsertion{dpx}{avi}{\doPDFinsertmov} + +%D \macros +%D {doinsertsoundtrack} +%D +%D Sounds are supported too. + +\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} + +%D \type{\doPDFovalbox} in \type{spec-fdf} was modifed because +%D the definition of \type{\PDFcode} was changed in this module. +%D +%D \macros +%D {doPDFovalbox} +%D +%D For drawing ovals we use quite raw \PDF\ code. The next +%D implementation does not differ that much from the one +%D implemented in the \POSTSCRIPT\ driver. + +\def\doPDFovalbox#1#2#3#4#5#6#7% todo: \scratchdimen/\scatchbox + {\bgroup + \dimen0=#4\divide\dimen0 2 + \doPDFovalcalc{0pt}{+\dimen0}\xmin + \doPDFovalcalc{#1}{-\dimen0}\xmax + \doPDFovalcalc{#2}{-\dimen0}\ymax + \doPDFovalcalc{-#3}{+\dimen0}\ymin + \advance\dimen0 by #5% + \doPDFovalcalc{0pt}{+\dimen0}\xxmin + \doPDFovalcalc{#1}{-\dimen0}\xxmax + \doPDFovalcalc{#2}{-\dimen0}\yymax + \doPDFovalcalc{-#3}{+\dimen0}\yymin + \doPDFovalcalc{#4}{\zeropoint}\stroke + \doPDFovalcalc{#5}{\zeropoint}\radius + \edef\dostroke{#6}% + \edef\dofill{#7}% + \setbox0\hbox + {\ifnum\dostroke\dofill>0 + \ifPDFstrokecolor\else\ifnum\dostroke=1 + \writestatus\m!colors{pdf stroke color will fail}\wait + \fi\fi + \special{pdf:content + \stroke\space w + \xxmin\space \ymin\space m + \xxmax\space \ymin\space l + \xmax \space \ymin\space \xmax\space \yymin\space y + \xmax \space \yymax\space l + \xmax \space \ymax\space \xxmax\space \ymax\space y + \xxmin\space \ymax\space l + \xmin \space \ymax\space \xmin\space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin\space \xxmin\space \ymin\space y + \ifnum\dostroke=1 S \fi + \ifnum\dofill=1 f \fi}% + \fi}% + \wd0=#1\ht0=#2\dp0=#3\box0 + \egroup} + +%D \macros +%D {doovalbox} + +\definespecial\doovalbox{\doPDFovalbox} + +%D \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, +%D dostopcolormode, +%D dostartrotation,dostoprotation, +%D dostartscaling,dostopscaling, +%D dostartmirroring,dostopmirroring, +%D dostartnegative,dostopnegative} +%D +%D Unfortunately the direct \PDF\ inclusion is not suited +%D for the next macros, which means that we cannot use the +%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains +%D its own colorstack, we use the \DVIPS\ alternatives. + +\definespecial\dostartgraymode {\doPDFstartgraymode} +\definespecial\dostopgraymode {\doPDFstopgraymode} +\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode} +\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode} +\definespecial\dostartgraycolormode{\doPDFstartgraycolormode} +\definespecial\dostartspotcolormode{\doPDFstartspotcolormode} +\definespecial\dostopcolormode {\doPDFstopcolormode} + +\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor} +\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} +\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} + +\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor} +\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor} +\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor} + +\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor} + +\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} +\definespecial\doregisternonecolor {\doPDFregisternonecolor} + +\definespecial\dostartrotation #1{\special{pdf:btrans rotate #1}} +\definespecial\dostoprotation {\special{pdf:etrans}} +\definespecial\dostartscaling#1#2{\special{pdf:btrans xscale #1 yscale #2}} +\definespecial\dostopscaling {\special{pdf:etrans}} +\definespecial\dostartmirroring {\special{pdf:btrans xscale -1}} +\definespecial\dostopmirroring {\special{pdf:etrans}} + +%D Negation is not (yet) supported: +\definespecial\dostartnegative {\doPDFstartnegative} +\definespecial\dostopnegative {\doPDFstopnegative} +\definespecial\dostartoverprint {\doPDFstartoverprint} +\definespecial\dostopoverprint {\doPDFstopoverprint} + +\definespecial\dostarttransparency{\doPDFstarttransparency} +\definespecial\dostoptransparency {\doPDFstoptransparency} + +\PDFtransparencysupportedtrue + +\def\@@PDT{@PDT@} + +\ifx\PDFcurrenttransparency\undefined + \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 +\fi + +\def\assignPDFtransparency#1#2% + {\def\PDFtransparencyidentifier{/Tr#1}% + %\def\PDFtransparencyreference{\PDFobjref{#2}}} + \def\PDFtransparencyreference{@TR:#2}} + +\def\presetPDFtransparency#1#2% + {\initializePDFtransparency + \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} + +\def\dopresetPDFtransparency#1#2% + {\global\advance\PDFcurrenttransparency \plusone + %\immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% +% \special{pdf: object @TR:\the\PDFcurrenttransparency\space \PDFtransparancydictionary{#1}{#2}{}}% + \doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}% + \special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}% + \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% + %\edef\PDFtransparencyreference {\PDFobjref\pdflastobj}% + \edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}% + \setxvalue{\@@PDT#1:#2}% + {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyidentifier\space + \PDFtransparencyreference\space}} + +\def\initializePDFtransparency + %{\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}% +% {\special{pdf: object @TR:0 \PDFtransparancydictionary{1}{1}{/AIS false}}% + {\doPDFreserveDPXobject{TR:0}{<< >>}% + \special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}% + \xdef\PDFtransparencyresetidentifier{/Tr0}% + %\xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}% + \xdef\PDFtransparencyresetreference{@TR:0}% + \setxvalue{\@@PDT0:0}% + %{\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}% + {\noexpand\assignPDFtransparency{0}{0}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyresetidentifier\space + \PDFtransparencyresetreference\space}% + \global\let\initializePDFtransparency\relax} + +%D \macros +%D {dosetupinteraction, +%D dosetupopenaction,dosetupcloseaction} + +\definespecial\dosetupinteraction + {\showmessage\m!interactions{21}{DVIPDFMx}} + +\definespecial\dosetupopenaction {\doPDFsetupopenaction} +\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} + +%D \macros +%D {doresetgotowhereever, +%D dostartthisisrealpage,dostartthisislocation, +%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} + +\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} +\definespecial\dostartthisislocation{\doPDFstartthisislocation} + +\definespecial\dostartgotolocation{\doPDFstartgotolocation} +\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} +\definespecial\dostartgotoJS {\doPDFstartgotoJS} + +%D \macros +%D {doflushJSpreamble} + +\definespecial\doflushJSpreamble#1% + {\bgroup + \let\compositeJScode\empty + \def\docommando##1% + {\edef\sanitizedJScode{\getJSpreamble{##1}}% + \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode + \special{pdf:object @JS:##1 <</S /JavaScript /JS (\sanitizedJScode)>>}% + \edef\compositeJScode{\compositeJScode\space (##1) @JS:##1}}% + \processcommalist[#1]\docommando + \special{pdf:names /JavaScript [\compositeJScode]}% + \egroup} + +%D \macros +%D {dostarthide,dostophide} + +\definespecial\dostarthide{} +\definespecial\dostophide {} + +%D \macros +%D {dosetupscreen} + +\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} + +\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} +\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} +\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} +\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} + +%D \macros +%D {dostartexecutecommand} + +\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} + +%D \macros +%D {dosetupidentity} + +\definespecial\dosetupidentity{\doPDFsetupidentity} + +%D \macros +%D {dostartrunprogam} + +\definespecial\dostartrunprogram{\doPDFstartrunprogram} + +%D \macros +%D {dostartgotoprofile, dostopgotoprofile, +%D dobeginofprofile, doendofprofile} + +\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} + +\definespecial\dobeginofprofile#1#2#3#4% + {\bgroup + \setPDFdestination{#1}% + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \doifsomething{\PDFdestination} + {\special + {pdf:thread @ART::\PDFdestination\space + width \width height \height + <</Title (\PDFdestination)>>}}% + \egroup} + +\definespecial\doendofprofile + {} + +%D \macros +%D {doinsertbookmark} + +\definespecial\doinsertbookmark{\doPDFinsertbookmark} + +%D \macros +%D {dostartobject,dostopobject,doinsertobject} +%D +%D Modified to support the color shading feature since version +%D \type{dvipdfmx-20021128}. + +% wd nextbox > #3 ivm offset + +\definespecial\dostartobject#1#2#3#4#5% + {\bgroup + \dowithnextbox + {\dosetobjectreference{#1}{#2}{@#1::#2}% + \scratchdimen#3\edef\width {\the\scratchdimen\space}% + \scratchdimen#4\edef\height{\the\scratchdimen\space}% + \setbox\nextbox\vbox + {\special{pdf:bxobj @#1::#2 width \width height \height}% + % we need to compensate for the box offset (ugly, sigh) + \scratchdimen\nextboxht + \advance\scratchdimen\nextboxdp + \advance\scratchdimen-#4\relax + \nextboxdp\zeropoint + \nextboxht\zeropoint + \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% + \ifx\currentPDFresources\empty + \else + \special{pdf:put @resources + <<\currentPDFresources\the\pdfpageresources>>}% + \global\let\currentPDFresources\empty + \fi + \special{pdf:exobj}}% + \smashbox\nextbox + \flushatshipout{\box\nextbox}% + \egroup}% + \hbox\bgroup} + +\definespecial\dostopobject + {\egroup} + +\definespecial\doinsertobject#1#2% + {\hbox + {\doPDFgetobjectreference{#1}{#2}\PDFobjectreference + \ifx\PDFobjectreference\empty \else + \special{pdf:uxobj @#1::#2}% + \fi}} + +%D \macros +%D {dosetpagetransition} + +\definespecial\dosetpagetransition{\doPDFsetpagetransition} + +%D \macros +%D {doinsertcomment, doflushcomments} + +\definespecial\doinsertcomment{\doPDFinsertcomment} +\definespecial\doflushcomments{\doPDFflushcomments} + +%D \macros +%D {dopresetlinefield,dopresettextfield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetpushfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} + +\definespecial\dopresetlinefield {\doFDFpresetlinefield} +\definespecial\dopresettextfield {\doFDFpresettextfield} +\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} +\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} +\definespecial\dopresetcombofield {\doFDFpresetcombofield} +\definespecial\dopresetpushfield {\doFDFpresetpushfield} +\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} +\definespecial\dopresetradiofield {\doFDFpresetradiofield} +\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} + +\definespecial\dodefinefieldset{\doFDFdefinefieldset} +\definespecial\dogetfieldset {\doFDFgetfieldset} +\definespecial\doiffieldset {\doFDFiffieldset} + +%D \macros +%D {doregistercalculationset} + +\definespecial\doregistercalculationset{\doFDFregistercalculationset} + +%D \type{\doPDFdestination} in \type{spec-dpm} had a bug. +%D +%D \macros +%D {doPDFdestination} + +\def\doPDFdestination name #1% + {\special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]}} + +%D \macros +%D {doPDFaction,doPDFannotation,ifsharePDFactions} +%D +%D Sharing is not yet supported. + +\newif\ifsharePDFactions \sharePDFactionsfalse + +\def\dodoPDFaction#1#2#3#4% + {\ifcollectreferenceactions + \xdef\lastPDFaction{#4}% + \else + \bgroup + % this is yet untested + %\ifsharePDFactions + % \ifcase\similarreference\relax + % \xdef\lastPDFaction{<<#4>>}% + % \or + % \global\advance\nofPDFsimilar by 1 + % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% + % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% + % \else + % % leave \lastPDFaction untouched + % \fi + %\else + \xdef\lastPDFaction{<<#4>>}% + %\fi + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf:ann #1 width \width height \height + <</Subtype /Link /Border [0 0 0] + \ifhighlighthyperlinks \else /H /N \fi + /A \lastPDFaction\space>>}% + \egroup + \fi} + +\def\doPDFaction width #1 height #2 action #3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + +%D \type{\doPDFannotation} in \type{spec-dpm} had a bug. +%D +%D \type{\doPDFannotation} conflicts with \type{\doPDFinsertmov}, +%D since width and height also defined in \type{\doPDFinsertmov}. + +\def\doPDFannotation width #1 height #2 data #3% + {\bgroup + \edef\data{#3}% + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special{pdf:ann width \width height \height <<\data>>}% + \egroup} + +%D \macros +%D {doPDFannotationobject,doPDFactionobject} + +\def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5% + {\bgroup + \scratchdimen#3\edef\width {\the\scratchdimen\space}% + \scratchdimen#4\edef\height{\the\scratchdimen\space}% + \special{pdf:ann @#1::#2 width \width height \height <<#5>>}% + \dosetobjectreference{#1}{#2}{@#1::#2}% + \egroup} + +\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5% + {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{@#1::#2}} + +%D \macros +%D {doPDFaddtocatalog,doPDFaddtoinfo, +%D doPDFpageattribute,doPDFpagesattribute} + +% we could move much more to spec-fdf + +% \ifx\pdfcatalog \undefined \newtoks\pdfcatalog \fi +% \ifx\pdfinfo \undefined \newtoks\pdfinfo \fi +% \ifx\pdfpageattr \undefined \newtoks\pdfpageattr \fi +% \ifx\pdfpageresources\undefined \newtoks\pdfpageresources \fi +% \ifx\pdfpagesattr \undefined \newtoks\pdfpagesattr \fi + +% \def\doPDFaddtocatalog #1{\expanded{\global\pdfcatalog {#1\the\pdfcatalog }}} +% \def\doPDFaddtoinfo #1{\expanded{\global\pdfinfo {#1\the\pdfinfo }}} +% \def\doPDFpageattribute #1{\expanded{\global\pdfpageattr {#1\the\pdfpageattr }}} +% \def\doPDFpageresource #1{\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}} +% \def\doPDFpagesattribute#1{\expanded{\global\pdfpagesattr {#1\the\pdfpagesattr }}} + +% \def\doPDFresetpageattributes{\global\pdfpageattr\emptytoks} +% \def\doPDFresetpageresources {\global\pdfpageresources\emptytoks} + +% \appendtoks +% \special{pdf: put @catalog <<#1>>}% +% \special{pdf: docinfo <<#1>>}% +% \special{pdf: put @pages <<#1>>}% +% \to \everylastshipout + +% \appendtoks +% \special{pdf: put @thispage <<#1>>}% +% \to\everyshipout + +\def\doPDFaddtocatalog#1% + {\special{pdf:put @catalog <<#1>>}} + +\def\doPDFaddtoinfo#1% + {\special{pdf:put @docinfo <<#1>>}} + +\def\doPDFpageattribute#1% + {\special{pdf:put @thispage <<#1>>}} + +\def\doPDFpagesattribute#1% + {\special{pdf:put @pages <<#1>>}} + +\def\doPDFpageresource#1% + {\special{pdf:put @resources <<#1>>}} + +\let\doPDFresetpageresources \relax +\let\doPDFresetpageattributes\relax + +%D \type{\doPDFbookmark} in \type{spec-dpm} had a bug. +%D The openbookmark option \#5 is not supported yet. +%D +%D \macros +%D {doPDFbookmark} + +\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5% + {\ifcase#1\else + %\scratchcounter#4\advance\scratchcounter\minusone + \special{pdf:outline #1 %\ifcase#5 opened\fi + % <</Title (#3) /A <</S /GoTo /D (page:\the\scratchcounter)>>>>}% + <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}% + \fi} + +%D \macros +%D {doPDFdictionaryobject,doPDFarrayobject} + +% Dvipdfmx can't handle +% +% \special{pdf:put @foo << /Bar @bar >>} +% \special{pdf:put @bar << /Foo @foo >>} +% +% Objects must be defined before they are used. +% +% \special{pdf:obj @foo << >>} +% \special{pdf:obj @bar << >>} +% \special{pdf:put @foo << /Bar @bar >>} +% \special{pdf:put @bar << /Foo @foo >>} +% +% However, this only works for dictionary and array. + +\def\doPDFreserveDPXobject#1#2% + {\ifundefined{r:pdx:d:#1}% + % we need a \flushatshipoutprep (prepended, normally appended) + \flushatshipout{\special{pdf:object @#1 #2}}% + \global\letvalue{r:pdx:d:#1}\empty + \fi} + +\def\doPDFreserveDPXobjectfirst#1#2% + {\ifundefined{r:pdx:d:#1}% + \doglobal\prependtoks\special{pdf:object @#1 #2}\to\everyfirstshipout + \global\letvalue{r:pdx:d:#1}\empty + \fi} + +\def\doPDFcheckedDPXobject#1{\ifundefined{r:pdx:d:#1}object\else put\fi\space @#1\space} + +% todo when etex is fixed, \everyPDFpresets, leeg voor pdftex, nodig voor dvipdfmx + +\doPDFreserveDPXobjectfirst{FDF::docuextgstates}{<< >>} + +\def\doPDFdictionaryobject class #1 name #2 data #3% + {\flushatshipout + {\special{pdf:\doPDFcheckedDPXobject{#1::#2}<<#3>>}% + \dosetobjectreference{#1}{#2}{@#1::#2}}} + +\def\doPDFarrayobject class #1 name #2 data #3% + {\flushatshipout + {\special{pdf:\doPDFcheckedDPXobject{#1::#2}[#3]}% + \dosetobjectreference{#1}{#2}{@#1::#2}}} + +%D \macros +%D {defaultobjectreference,doPDFgetobjectreference} + +\def\defaultobjectreference#1#2{@#1::#2} + +%D \type{\doPDFgetobjectreference} in \type{spec-dpm} had a bug. + +\def\doPDFgetobjectreference#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \ifx#3\empty\else\edef#3{#3}\fi} + +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{@page#1}} + +%D Done. + +% %D 2. Modified codes from \type{spec-fdf} +% +% \definespecial\dostartgraphicgroup{\special{pdf: literal direct q}} +% \definespecial\dostopgraphicgroup {\special{pdf: literal direct Q}} + +%D 3. Copied codes from \type{spec-tpd} + +%D \macros +%D {dostartclipping,dostopclipping} +%D +%D Clipping in \PDFTEX\ is rather trivial. We can even hook +%D in \METAPOST\ without problems. + +\definespecial\dostartclipping#1#2#3% + {\PointsToBigPoints{#2}\width + \PointsToBigPoints{#3}\height + \grabMPclippath{#1}{1}\width\height + {0 0 m \width\space 0 l \width \height l 0 \height l}% + \PDFcode + {q 0 w \MPclippath\space W n}} + +\definespecial\dostopclipping + {\PDFcode{Q n}} + +%D 4. Modified codes from \type{supp-mpe} + +\def\stopMPshading + {\global\advance\currentPDFshade \plusone + \setxvalue{obj:Sh:\currentMPspecial}% + {/Sh\the\currentPDFshade\space @obj:Sh:\currentMPspecial\space}% + \setxvalue{mps:Sh:\currentMPspecial}% + {\the\currentPDFshade}} + +\defineMPspecial{30} + {\startMPshading{14}% type 2 + \setMPshadingcolors{4}{5}{6}{9}{10}{11}% + \special{pdf:object @ftn:Sh:\currentMPspecial\space + <</FunctionType 2 + /Domain [\gMPs1 \gMPs2] + /C0 [\MPshadeA] + /C1 [\MPshadeB] + /N \gMPs3>>}% + \special{pdf:object @obj:Sh:\currentMPspecial\space + <</ShadingType 2 + /ColorSpace /\MPshadeC\space + /Function @ftn:Sh:\currentMPspecial\space + /Coords [\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}] + /Extend [true true]>>}% + \stopMPshading} + +\defineMPspecial{31} + {\startMPshading{16}% type 3 + \setMPshadingcolors{4}{5}{6}{10}{11}{12}% + \special{pdf:object @ftn:Sh:\currentMPspecial\space + <</FunctionType 2 + /Domain [\gMPs1 \gMPs2] + /C0 [\MPshadeA] + /C1 [\MPshadeB] + /N \gMPs3>>}% + \special{pdf:object @obj:Sh:\currentMPspecial\space + <</ShadingType 3 + /ColorSpace /\MPshadeC\space + /Function @ftn:Sh:\currentMPspecial\space + /Coords [\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}] + /Extend [true true]>>}% + \stopMPshading} + +\def\handleMPfigurespecial#1#2#3#4#5#6#7% toto : combine with ext fig + {\doiffileelse{#7} + {\vbox to \zeropoint + {\vss + \hbox to \zeropoint + {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}% + \rlap{\special{pdf:image width 1bp height 1bp (#7)}} + \special{pdf:etrans}\hss}}} + {\message{[unknown figure #7]}}} + +%D 5. Modified codes from \type{supp-pdf} + +\let\handleMPfshow\dohandleMPfshow + +\newcounter\MPPDFcounter + +\def\setMPPDFobject#1#2% + {\ifx\currentPDFresources\empty\else\doPDFpageresource{#1}\fi + \def\getMPPDFobject{\box#2}} + +\let\getMPPDFobject\relax + +\definespecial\doinsertMPfile#1% + {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} + +%D Experimental (untested): + +\definespecial\dostartfonteffect#1#2#3% + {\ifdim#2>\zeropoint + \PointsToBigPoints{#2}\ascii + \PDFdirectcode{\ascii\space w}% + \fi + \ifdim#3\points=\onepoint\else + \scratchdimen#3\points + \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}% + \fi + \PDFdirectcode{\purenumber#1 Tr}} + +\definespecial\dostopfonteffect + {\PDFdirectcode{1 w 0 Tc 0 Tr}} + +%D 6. Modified codes from \type{core-obj} +%D +%D In the viewpoint of TeX, the special command \type{pdf:uxobj @obj} +%D generates a box with zero point width and zero point height so that +%D it must be careful to place the box at the reference point. + +\def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf + {\initializepaper + \forgetall + \dontshowcomposition + \setbox\scratchbox\vbox + {\doinsertobject{#1}{#2}}% + \setbox\scratchbox#3% + {\vbox to #5\scaledpoint + {\ifdim\ht\scratchbox>#5\scaledpoint + \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss + \else\ifdim\wd\scratchbox>#4\scaledpoint + \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss + \else + %\vss\box\scratchbox + \vss\hbox to #4\scaledpoint{\box\scratchbox\hss} + \fi\fi}}% + \box\scratchbox + \elabelgroup} + +%D 7. Copied codes from \type{spec-dvi} + +\definespecial\dosetposition#1% + {\special{pos:pxy "#1"}} + +\definespecial\dosetpositionwhd#1#2#3#4% + {\special{pos:pxywhd "#1" #2 #3 #4}} + +\definespecial\dosetpositionplus#1#2#3#4#5% + {\special{pos:pxyplus "#1" #2 #3 #4 #5}} + +\let\flushDVIpositionpapersize\relax + +\definespecial\dosetpositionpapersize#1#2% + {\xdef\flushDVIpositionpapersize% + {\special{pos:papersize #1 #2}% + \noexpand\installprogram{dvipos \jobname}% + \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} + +\prependtoksonce \flushDVIpositionpapersize \to \everyshipout + +\stopspecials + +\protect \endinput diff --git a/Build/source/texk/xdvipdfmx/contrib/latex/color.sty.sample b/Build/source/texk/xdvipdfmx/contrib/latex/color.sty.sample new file mode 100644 index 00000000000..27009a3fe86 --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/latex/color.sty.sample @@ -0,0 +1,177 @@ +%% +%% This is file `color.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% color.dtx (with options: `package') +%% +%% color.dtx Copyright (C) 1994--1999 David Carlisle +%% +%% This file is 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. +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{color} + [1999/02/16 v1.0i Standard LaTeX Color (DPC)] +\edef\Gin@codes{% + \catcode`\noexpand\^^A\the\catcode`\^^A\relax + \catcode`\noexpand\"\the\catcode`\"\relax + \catcode`\noexpand\*\the\catcode`\*\relax + \catcode`\noexpand\!\the\catcode`\!\relax + \catcode`\noexpand\:\the\catcode`\:\relax} +\catcode`\^^A=\catcode`\% +\catcode`\"=12 +\catcode`\*=11 +\catcode`\!=12 +\catcode`\:=12 +\providecommand\Gin@driver{} +\def\c@lor@error#1{% + \@latex@error{Undefined color #1}\@ehd} +\DeclareOption{monochrome}{% + \def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}% + \AtEndOfPackage{% + \colors@false + \def\set@color{% + \c@lor@special\m@ne + {color push \current@color}\aftergroup\reset@color}% + \def\reset@color{\c@lor@special\m@ne{color pop}}% + \def\set@page@color{% + \c@lor@special\m@ne{background \current@color}}% + \def\define@color#1#2{% + \c@lor@special\m@ne{define #1 #2}}}} +\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout} +\DeclareOption{dvips}{\def\Gin@driver{dvips.def}% + \def\c@lor@namefile{dvipsnam.def}} +\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}} +\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}} +\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}} +\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}} +\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}} +\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}} +\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}} +\DeclareOption{emtex}{\def\Gin@driver{emtex.def}} +\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}} +\DeclareOption{oztex}{\ExecuteOptions{dvips}} +\DeclareOption{textures}{\def\Gin@driver{textures.def}} +\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}} +\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}} +\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}} +\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}} +\DeclareOption{truetex}{\def\Gin@driver{truetex.def}} +\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}} +\DeclareOption{vtex}{\def\Gin@driver{vtex.def}} +\DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}} +\DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax} +\let\c@lor@usename\@gobble +\DeclareOption{usenames}{% + \def\c@lor@usename#1{% + \expandafter\color@named\csname\string\color @#1\endcsname{#1}}} +\DeclareRobustCommand\color{% + \@ifnextchar[\@undeclaredcolor\@declaredcolor} +\def\@undeclaredcolor[#1]#2{% + \@ifundefined{color@#1}% + {\c@lor@error{model `#1'}}% + {\csname color@#1\endcsname\current@color{#2}% + \set@color}% + \ignorespaces} +\def\@declaredcolor#1{% + \@ifundefined{\string\color @#1}% + {\c@lor@error{`#1'}}% + {\expandafter\let\expandafter\current@color + \csname\string\color @#1\endcsname + \set@color}% + \ignorespaces} +\def\textcolor#1#{\@textcolor{#1}} +\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}} +\def\pagecolor{% + \begingroup + \let\ignorespaces\endgroup + \let\set@color\set@page@color + \color} +\def\definecolor#1#2#3{% + \@ifundefined{color@#2}% + {\c@lor@error{model `#2'}}% + {\@ifundefined{\string\color @#1}{}% + {\PackageInfo{color}{Redefining color #1}}% + \csname color@#2\expandafter\endcsname + \csname\string\color @#1\endcsname{#3}}} +\def\DefineNamedColor#1#2#3#4{% + \@ifundefined{define@color@#1}% + {\c@lor@error{model `#1'}}% + {\@ifundefined{color@#3}% + {\c@lor@error{model `#3'}}% + {\@ifundefined{c@lor@#1@#2}{}% + {\PackageInfo{color}{Redefining color #2 in named color model}}% + \csname color@#3\endcsname\@tempa{#4}% + \csname define@color@#1\endcsname{#2}\@tempa + \c@lor@usename{#2}}}} +\@onlypreamble\DefineNamedColor +\newif\ifcolors@ +\colors@true +\def\c@lor@special#1#2{% + \edef\@tempa{\write#1{#2}}\@tempa} +\InputIfFileExists{color.cfg}{}{} +\ProcessOptions +\if!\Gin@driver! + \PackageError{color} + {No driver specified} + {You should make a default driver option in a file \MessageBreak + color.cfg\MessageBreak + eg: \protect\ExecuteOptions{dvips}% + } +\else + \PackageInfo{color}{Driver file: \Gin@driver} + \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{} +\fi +\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}} +\def\normalcolor{\let\current@color\default@color\set@color} +\AtBeginDocument{\let\default@color\current@color} +\def\color@block#1#2#3{% + {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}} +\def\colorbox#1#{\color@box{#1}} +\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}} +\def\fcolorbox#1#{\color@fbox{#1}} +\def\color@fbox#1#2#3{% + \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}} + +\long\def\color@b@x#1#2#3{% + \leavevmode + \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}% + \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@ + \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@ + {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}% + \box\z@}}} +\def\color@setgroup{\begingroup\set@color} +\let\color@begingroup\begingroup +\def\color@endgroup{\endgraf\endgroup} +\def\color@hbox{\hbox\bgroup\color@begingroup} +\def\color@vbox{\vbox\bgroup\color@begingroup} +\def\color@endbox{\color@endgroup\egroup} +\ifx\color@gray\@undefined + \ifx\color@rgb\@undefined + \else + \definecolor{black}{rgb}{0,0,0} + \definecolor{white}{rgb}{1,1,1} + \fi +\else + \definecolor{black}{gray}{0} + \definecolor{white}{gray}{1} +\fi +\ifx\color@rgb\@undefined\else + \definecolor{red}{rgb}{1,0,0} + \definecolor{green}{rgb}{0,1,0} + \definecolor{blue}{rgb}{0,0,1} +\fi +\ifx\color@cmyk\@undefined\else + \definecolor{cyan}{cmyk}{1,0,0,0} + \definecolor{magenta}{cmyk}{0,1,0,0} + \definecolor{yellow}{cmyk}{0,0,1,0} +\fi +\Gin@codes +\let\Gin@codes\relax +\endinput +%% +%% End of file `color.sty'. diff --git a/Build/source/texk/xdvipdfmx/contrib/latex/dvipdfmx.def.sample b/Build/source/texk/xdvipdfmx/contrib/latex/dvipdfmx.def.sample new file mode 100644 index 00000000000..e67d195de3d --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/latex/dvipdfmx.def.sample @@ -0,0 +1,139 @@ +%% This is file `dvipdfmx.def' for DVIPDFMx by J.-H. Cho and S. Hirata +%% which is written based on `dvipdf.def' in the LaTeX `Graphics Bundle'. +%% +%% This is file `dvipdf.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% drivers.dtx (with options: `dvipdf,color1,psrulesZ') +%% +%% drivers.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz +%% Copyright (C) 1995 1996 1997 1998 1999 David Carlisle +%% +%% This file is 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. +%% +\ProvidesFile{dvipdfmx.def} + [1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)] +\def\c@lor@arg#1{% + \dimen@#1\p@ + \ifdim\dimen@<\z@\dimen@\maxdimen\fi + \ifdim\dimen@>\p@ + \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd + \fi} +\def\color@gray#1#2{% + \c@lor@arg{#2}% + \edef#1{[#2]}% + } +\def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1} +\def\c@lor@@cmyk#1,#2,#3,#4\@@#5{% + \c@lor@arg{#4}% + \c@lor@arg{#1}% + \c@lor@arg{#2}% + \c@lor@arg{#3}% + \edef#5{[#1 #2 #3 #4]}% + } +\def\color@rgb#1#2{\c@lor@@rgb#2\@@#1} +\def\c@lor@@rgb#1,#2,#3\@@#4{% + \c@lor@arg{#1}% + \c@lor@arg{#2}% + \c@lor@arg{#3}% + \edef#4{[#1 #2 #3]}% + } +\def\color@RGB#1#2{\c@lor@@RGB#2\@@#1} +\def\c@lor@@RGB#1,#2,#3\@@#4{% + \c@lor@RGB@rgb{#1}\@tempa + \c@lor@RGB@rgb{#2}\@tempb + \c@lor@RGB@rgb{#3}\@tempc + \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4% + } +\def\c@lor@RGB@rgb#1#2{% + \dimen@#1\p@ + \divide\dimen@\@cclv + \edef#2{\strip@pt\dimen@}} +\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}% + {\PackageError{color}{Undefined color `#1'}\@ehd}% + {\edef#4{ #1}}% + } +\def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@} +\def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end} +\def\c@lor@ps@rgb#1\@@{#1 setrgbcolor} +\def\c@lor@ps@hsb#1\@@{#1 sethsbcolor} +\def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor} +\def\c@lor@ps@gray#1\@@{#1 setgray} +\def\current@color{[0]} +\def\set@color{% + \special{pdf:bcolor \current@color + }\aftergroup\reset@color} +\def\reset@color{\special{% + pdf:ecolor}} +\def\set@page@color{\special{% + pdf:bgcolor \current@color}} +\def\define@color@named#1#2{% + \expandafter\let\csname col@#1\endcsname\@nnil} +\def\Ginclude@eps#1{% + \message{<#1>}% + \bgroup + \def\@tempa{!}% + \dimen@\Gin@req@width + \dimen@ii.1bp% + \divide\dimen@\dimen@ii + \@tempdima\Gin@req@height + \divide\@tempdima\dimen@ii + \special{PSfile="#1"\space + llx=\Gin@llx\space + lly=\Gin@lly\space + urx=\Gin@urx\space + ury=\Gin@ury\space + \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi + \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi + \ifGin@clip clip\fi}% + \egroup} +\def\Ginclude@bmp#1{% + \message{<#1>}% + \bgroup + \def\@tempa{!}% + \special{pdf:image\space + width \the\Gin@req@width\space + height \the\Gin@req@height\space + (#1)}% + \egroup} +\def\Grot@start{% +\special{pdf:btrans rotate \Grot@angle}} +\def\Grot@end{\special{pdf:etrans}} +\def\Gscale@start{% +\special{pdf:btrans xscale \Gscale@x\space yscale \Gscale@y}} +\def\Gscale@end{\special{pdf:etrans}} +\def\Gin@PS@raw#1{\special{ps: #1}} +\def\Gin@PS@restored#1{\special{" #1}} +\def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}} +\def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}} +\@namedef{Gin@rule@.jpg}#1{{bmp}{.bb}{#1}} +\@namedef{Gin@rule@.jpeg}#1{{bmp}{.bb}{#1}} +\@namedef{Gin@rule@.png}#1{{bmp}{.bb}{#1}} +\@namedef{Gin@rule@.bmp}#1{{bmp}{.bb}{#1}} +\def\Gin@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z} +\@namedef{Gin@rule@.pdf}#1{{eps}{.bb}{#1}} +\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}} +\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}} +\@namedef{Gin@rule@.pz}#1{{eps}{.bb}{`gunzip -c #1}} +\@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.bb}{`gunzip -c #1}} +\@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.bb}{`gunzip -c #1}} +\@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.bb}{`gunzip -c #1}} +\@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.bb}{`gunzip -c #1}} +\@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}} +\endinput +%% +%% End of file `dvipdfmx.def'. diff --git a/Build/source/texk/xdvipdfmx/contrib/latex/graphics.sty.sample b/Build/source/texk/xdvipdfmx/contrib/latex/graphics.sty.sample new file mode 100644 index 00000000000..57c92cff620 --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/latex/graphics.sty.sample @@ -0,0 +1,473 @@ +%% +%% This is file `graphics.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% graphics.dtx (with options: `package') +%% +%% graphics.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz +%% Copyright (C) 1995--1999 2001 David Carlisle +%% +%% This file is 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. +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{graphics} + [2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)] +\edef\Gin@codes{% + \catcode`\noexpand\^^A\the\catcode`\^^A\relax + \catcode`\noexpand\"\the\catcode`\"\relax + \catcode`\noexpand\*\the\catcode`\*\relax + \catcode`\noexpand\!\the\catcode`\!\relax + \catcode`\noexpand\:\the\catcode`\:\relax} +\catcode`\^^A=\catcode`\% +\@makeother\"% +\catcode`\*=11 +\@makeother\!% +\@makeother\:% +\RequirePackage{trig} +\providecommand\Grot@start{\@latex@error{Rotation not supported}\@ehc + \global\let\Grot@start\relax} +\providecommand\Grot@end{} +\providecommand\Gscale@start{\@latex@error{Scaling not supported}\@ehc + \global\let\Gscale@start\relax} +\providecommand\Gscale@end{} +\edef\Gread@BBox{\@percentchar\@percentchar BoundingBox} +\DeclareOption{draft}{\Gin@drafttrue} +\DeclareOption{final}{\Gin@draftfalse} +\newif\ifGin@draft +\DeclareOption{hiresbb}{% + \edef\Gread@BBox{\@percentchar\@percentchar HiResBoundingBox}} +\providecommand\Gin@driver{} +\DeclareOption{dvips}{\def\Gin@driver{dvips.def}} +\DeclareOption{xdvi}{\ExecuteOptions{dvips}} +\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}} +\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}} +\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}} +\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}} +\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}} +\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}} +\DeclareOption{emtex}{\def\Gin@driver{emtex.def}} +\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}} +\DeclareOption{oztex}{\ExecuteOptions{dvips}} +\DeclareOption{textures}{\def\Gin@driver{textures.def}} +\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}} +\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}} +\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}} +\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}} +\DeclareOption{truetex}{\def\Gin@driver{truetex.def}} +\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}} +\DeclareOption{vtex}{\def\Gin@driver{vtex.def}} +\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout} +\InputIfFileExists{graphics.cfg}{}{} +\DeclareOption{hiderotate}{% + \def\Grot@start{\begingroup\setbox\z@\hbox\bgroup} + \def\Grot@end{\egroup\endgroup}} +\DeclareOption{hidescale}{% + \def\Gscale@start{\begingroup\setbox\z@\hbox\bgroup} + \def\Gscale@end{\egroup\endgroup}} +\ProcessOptions +\if!\Gin@driver! + \PackageError{graphics} + {No driver specified} + {You should make a default driver option in a file \MessageBreak + graphics.cfg\MessageBreak + eg: \protect\ExecuteOptions{textures}% + } +\else + \PackageInfo{graphics}{Driver file: \Gin@driver} + \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{} +\fi +\def\Gin@llx{0} +\let\Gin@lly\Gin@llx +\let\Gin@urx\Gin@llx +\let\Gin@ury\Gin@llx +\let\Gin@nat@width\leftmarginv +\let\Gin@nat@height\leftmarginvi +\newif\ifGin@clip +\newcommand\DeclareGraphicsExtensions[1]{% + \edef\Gin@extensions{\zap@space#1 \@empty}} +\providecommand\Gin@extensions{} +\def\includegraphics{% + \@ifstar + {\Gin@cliptrue\Gin@i}% + {\Gin@clipfalse\Gin@i}} +\def\Gin@i{% + \@ifnextchar[%] + \Gin@ii + {\Gin@bboxfalse\Ginclude@graphics}} +\def\Gin@ii[#1]{% + \@ifnextchar[%] + {\Gin@iii[#1]} + {\Gin@iii[0,0][#1]}} +\def\Gin@iii[#1,#2][#3,#4]#5{% + \begingroup + \Gin@bboxtrue + \Gin@defaultbp\Gin@llx{#1}% + \Gin@defaultbp\Gin@lly{#2}% + \Gin@defaultbp\Gin@urx{#3}% + \Gin@defaultbp\Gin@ury{#4}% + \Ginclude@graphics{#5}% + \endgroup} +\def\Gin@defaultbp#1#2{% + \afterassignment\Gin@def@bp\dimen@#2bp\relax{#1}{#2}} +\def\Gin@def@bp#1\relax#2#3{% + \if!#1!% + \def#2{#3}% + \else + \dimen@.99626\dimen@ + \edef#2{\strip@pt\dimen@}% + \fi} +\def\DeclareGraphicsRule#1#2#3#4{% + \edef\@tempa{\string *}\def\@tempb{#3}% + \expandafter\edef\csname Gin@rule@#1\endcsname##1% + {{#2}% + {\ifx\@tempa\@tempb\noexpand\Gin@ext\else#3\fi}% + {\ifx\indent#4\indent##1\else#4\fi}}} +\def\graphicspath#1{\def\Ginput@path{#1}} +\ifx\Ginput@path\@undefined + \let\Ginput@path\input@path +\fi +\def\Gin@getbase#1{% + \edef\Gin@tempa{% + \def\noexpand\@tempa####1#1\space{% + \def\noexpand\Gin@base{####1}}}% + \IfFileExists{\filename@area\filename@base#1}% + {\Gin@tempa + \expandafter\@tempa\@filef@und + \edef\Gin@ext{#1}}{}}% +\let\Gin@ext\relax +\def\Gin@sepdefault{.} +\def\Ginclude@graphics#1{% + \begingroup + \let\input@path\Ginput@path + \filename@parse{#1}% + \ifx\filename@ext\relax + \@for\Gin@temp:=\Gin@extensions\do{% + \ifx\Gin@ext\relax + \Gin@getbase\Gin@temp + \fi}% + \else + \Gin@getbase{\Gin@sepdefault\filename@ext}% + \ifx\Gin@ext\relax + \@warning{File `#1' not found}% + \def\Gin@base{\filename@area\filename@base}% + \edef\Gin@ext{\Gin@sepdefault\filename@ext}% + \fi + \fi + \ifx\Gin@ext\relax + \@latex@error{File `#1' not found}% + {I could not locate the file with any of these extensions:^^J% + \Gin@extensions^^J\@ehc}% + \else + \@ifundefined{Gin@rule@\Gin@ext}% + {\ifx\Gin@rule@*\@undefined + \@latex@error{Unknown graphics extension: \Gin@ext}\@ehc + \else + \expandafter\Gin@setfile\Gin@rule@*{\Gin@base\Gin@ext}% + \fi}% + {\expandafter\expandafter\expandafter\Gin@setfile + \csname Gin@rule@\Gin@ext\endcsname{\Gin@base\Gin@ext}}% + \fi + \endgroup} +\newif\ifGread@\Gread@true +\def\Gin@setfile#1#2#3{% + \ifx\\#2\\\Gread@false\fi + \ifGin@bbox\else + \ifGread@ + \csname Gread@% + \expandafter\ifx\csname Gread@#1\endcsname\relax + eps% + \else + #1% + \fi + \endcsname{\Gin@base#2}% + \else + \Gin@nosize{#3}% + \fi + \fi + \Gin@viewport@code + \Gin@nat@height\Gin@ury bp% + \advance\Gin@nat@height-\Gin@lly bp% + \Gin@nat@width\Gin@urx bp% + \advance\Gin@nat@width-\Gin@llx bp% + \Gin@req@sizes + \expandafter\ifx\csname Ginclude@#1\endcsname\relax + \Gin@drafttrue + \expandafter\ifx\csname Gread@#1\endcsname\relax + \@latex@error{Can not include graphics of type: #1}\@ehc + \global\expandafter\let\csname Gread@#1\endcsname\@empty + \fi + \fi + \leavevmode + \ifGin@draft + \hb@xt@\Gin@req@width{% + \vrule\hss + \vbox to \Gin@req@height{% + \hrule \@width \Gin@req@width + \vss + \edef\@tempa{#3}% + \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}% + \vss + \hrule}% + \hss\vrule}% + \else + \@addtofilelist{#3}% + \ProvidesFile{#3}[Graphic file (type #1)]% + \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}% + \dp\z@\z@ + \ht\z@\Gin@req@height + \wd\z@\Gin@req@width + \box\z@ + \fi} +\def\Gin@exclamation{!} +\let\Gin@req@sizes\relax +\def\Gin@scalex{1}% +\let\Gin@scaley\Gin@exclamation +\let\Gin@req@height\Gin@nat@height +\let\Gin@req@width\Gin@nat@width +\let\Gin@viewport@code\relax +\def\Gin@nosize#1{% + \@latex@error + {Cannot determine size of graphic in #1 (no size specifed)}% + \@ehc} +\newif\ifGin@bbox +\def\Gread@eps#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 % + \ifeof\@inputcheck + \@latex@error{File `#1' not found}\@ehc + \else + \Gread@true + \let\@tempb\Gread@false + \loop + \read\@inputcheck to\@tempa + \ifeof\@inputcheck + \Gread@false + \else + \expandafter\Gread@find@bb\@tempa:.\\% + \fi + \ifGread@ + \repeat + \immediate\closein\@inputcheck + \fi + \ifGin@bbox\else + \@latex@error + {Cannot determine size of graphic in #1 (no BoundingBox)}% + \@ehc + \gdef\@gtempa{0 0 72 72 }% + \fi + \endgroup + \expandafter\Gread@parse@bb\@gtempa\\} +\long\def\Gread@find@bb#1:#2#3\\{% + \def\@tempa{#1}% + \ifx\@tempa\Gread@BBox + \Gread@test@atend#2#3()\\% + \fi} +\def\Gread@test@atend#1(#2)#3\\{% + \def\@tempa{#2}% + \ifx\@tempa\Gread@atend + \Gread@true + \let\@tempb\relax + \else + \gdef\@gtempa{#1}% + \@tempb + \Gin@bboxtrue + \fi} +\def\Gread@parse@bb#1 #2 #3 #4 #5\\{% + \Gin@defaultbp\Gin@llx{#1}% + \Gin@defaultbp\Gin@lly{#2}% + \Gin@defaultbp\Gin@urx{#3}% + \Gin@defaultbp\Gin@ury{#4}}% +\def\Gread@atend{atend} +\let\Grot@height\@ovxx +\let\Grot@left\@ovyy +\let\Grot@right\@ovdx +\let\Grot@depth\@ovdy +\let\Grot@l\@ovro +\let\Grot@r\@ovri +\let\Grot@h\@xdim +\let\Grot@d\@ydim +\let\Grot@x\@linelen +\let\Grot@y\@dashdim +\long\def\rotatebox#1#2{% + \leavevmode + \Grot@setangle{#1}% + \setbox\z@\hbox{{#2}}% + \Grot@x\z@ + \Grot@y\z@ + \Grot@box} +\def\Grot@setangle#1{\edef\Grot@angle{#1}} +\def\Grot@Px#1#2#3{% + #1\Grot@cos#2% + \advance#1-\Grot@sin#3} +\def\Grot@Py#1#2#3{% + #1\Grot@sin#2% + \advance#1\Grot@cos#3} +\def\Grot@box{% + \begingroup + \CalculateSin\Grot@angle + \CalculateCos\Grot@angle + \edef\Grot@sin{\UseSin\Grot@angle}% + \edef\Grot@cos{\UseCos\Grot@angle}% +^^A \GDebug{Rotate: angle \Grot@angle, sine is \Grot@sin, +^^A cosine is \Grot@cos}% + \Grot@r\wd\z@ \advance\Grot@r-\Grot@x + \Grot@l\z@ \advance\Grot@l-\Grot@x + \Grot@h\ht\z@ \advance\Grot@h-\Grot@y + \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y + \ifdim\Grot@sin\p@>\z@ + \ifdim\Grot@cos\p@>\z@ + \Grot@Py\Grot@height \Grot@r\Grot@h%B + \Grot@Px\Grot@right \Grot@r\Grot@d%E + \Grot@Px\Grot@left \Grot@l\Grot@h%C + \Grot@Py\Grot@depth \Grot@l\Grot@d%D + \else + \Grot@Py\Grot@height \Grot@r\Grot@d%E + \Grot@Px\Grot@right \Grot@l\Grot@d%D + \Grot@Px\Grot@left \Grot@r\Grot@h%B + \Grot@Py\Grot@depth \Grot@l\Grot@h%C + \fi + \else + \ifdim\Grot@cos\p@<\z@ + \Grot@Py\Grot@height \Grot@l\Grot@d%D + \Grot@Px\Grot@right \Grot@l\Grot@h%C + \Grot@Px\Grot@left \Grot@r\Grot@d%E + \Grot@Py\Grot@depth \Grot@r\Grot@h%B + \else + \Grot@Py\Grot@height \Grot@l\Grot@h%C + \Grot@Px\Grot@right \Grot@r\Grot@h%B + \Grot@Px\Grot@left \Grot@l\Grot@d%D + \Grot@Py\Grot@depth \Grot@r\Grot@d%E + \fi + \fi + \advance\Grot@height\Grot@y + \advance\Grot@depth\Grot@y + \Grot@Px\dimen@ \Grot@x\Grot@y + \Grot@Py\dimen@ii \Grot@x\Grot@y + \dimen@-\dimen@ \advance\dimen@-\Grot@left + \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y +^^A \GDebug{Rotate: (l,r,h,d)^^J% +^^A Original \the\Grot@l,\the\Grot@r,\the\Grot@h,\the\Grot@d,^^J% +^^A New..... \the\Grot@left,\the\Grot@right,% +^^A \the\Grot@height,\the\Grot@depth}% + \setbox\z@\hbox{% + \kern\dimen@ + \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}% + \ht\z@\Grot@height + \dp\z@-\Grot@depth + \advance\Grot@right-\Grot@left\wd\z@\Grot@right + \leavevmode\box\z@ + \endgroup} +\def\scalebox#1{% + \@ifnextchar[{\Gscale@box{#1}}{\Gscale@box{#1}[#1]}} +\long\def\Gscale@box#1[#2]#3{% + \leavevmode + \def\Gscale@x{#1}\def\Gscale@y{#2}% + \setbox\z@\hbox{{#3}}% + \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}% + \ifdim#2\p@<\z@ + \ht\tw@-#2\dp\z@ + \dp\tw@-#2\ht\z@ + \else + \ht\tw@#2\ht\z@ + \dp\tw@#2\dp\z@ + \fi + \ifdim#1\p@<\z@ + \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}% + \else + \wd\tw@#1\wd\z@ + \box\tw@ + \fi} +\def\reflectbox{\Gscale@box-1[1]} +\def\resizebox{% + \leavevmode + \@ifstar{\Gscale@@box\totalheight}{\Gscale@@box\height}} +\def\Gscale@@box#1#2#3{% + \let\@tempa\Gin@exclamation + \expandafter\def\expandafter\@tempb\expandafter{\string#2}% + \expandafter\def\expandafter\@tempc\expandafter{\string#3}% + \ifx\@tempb\@tempa + \ifx\@tempc\@tempa + \toks@{\mbox}% + \else + \toks@{\Gscale@box@dd{#3}#1}% + \fi + \else + \ifx\@tempc\@tempa + \toks@{\Gscale@box@dd{#2}\width}% + \else + \toks@{\Gscale@box@dddd{#2}\width{#3}#1}% + \fi + \fi + \the\toks@} +\long\def\Gscale@box@dd#1#2#3{% + \@begin@tempboxa\hbox{#3}% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \Gscale@div\@tempa\@tempdima\@tempdimb + \Gscale@box\@tempa[\@tempa]{\box\@tempboxa}% + \@end@tempboxa} +\long\def\Gscale@box@dddd#1#2#3#4#5{% + \@begin@tempboxa\hbox{#5}% + \setlength\@tempdima{#1}% + \setlength\@tempdimb{#2}% + \Gscale@div\@tempa\@tempdima\@tempdimb + \setlength\@tempdima{#3}% + \setlength\@tempdimb{#4}% + \Gscale@div\@tempb\@tempdima\@tempdimb + \ifGin@iso + \ifdim\@tempa\p@>\@tempb\p@ + \let\@tempa\@tempb + \else + \let\@tempb\@tempa + \fi + \fi + \Gscale@box\@tempa[\@tempb]{\box\@tempboxa}% + \@end@tempboxa} +\newif\ifGin@iso +\def\Gscale@div#1#2#3{% + \setlength\dimen@{#3}% + \ifdim\dimen@=\z@ + \PackageError{graphics}{Division by 0}\@eha + \dimen@#2% + \fi + \edef\@tempd{\the\dimen@}% + \setlength\dimen@{#2}% + \count@65536\relax + \ifdim\dimen@<\z@ + \dimen@-\dimen@ + \count@-\count@ + \fi + \ifdim\dimen@>\z@ + \loop + \ifdim\dimen@<8192\p@ + \dimen@\tw@\dimen@ + \divide\count@\tw@ + \repeat + \dimen@ii\@tempd\relax + \divide\dimen@ii\count@ + \divide\dimen@\dimen@ii + \fi + \edef#1{\strip@pt\dimen@}} +\Gin@codes +\let\Gin@codes\relax +\endinput +%% +%% End of file `graphics.sty'. diff --git a/Build/source/texk/xdvipdfmx/contrib/patches/glyphlist-cm-add.txt b/Build/source/texk/xdvipdfmx/contrib/patches/glyphlist-cm-add.txt new file mode 100644 index 00000000000..ba8497776e6 --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/patches/glyphlist-cm-add.txt @@ -0,0 +1,76 @@ +# Additional entries for CMR10, CMMI10, CMSY10 +# +# CMR10 +# suppress -> COMBINING SHORT SOLIDUS OVERLAY +#supress;0337 +# CMMI10 +# tie -> COMBINING INVERTED BREVE +# vector -> COMBINING RIGHT ARROW ABOVE +# arrowhookleft, arrowhookright missing +# +pi1;03D6 +rho1;03F1 +arrowlefttophalf;21BC +arrowleftbothalf;21BD +arrowrighttophalf;21C0 +arrowrightbothalf;21C1 +triangleright;25C3 +triangleleft;25B9 +flat;266D +natural;266E +sharp;266F +slurbelow;2323 +slurabove;2322 +lscript;2113 +vector;20D7 +epsilon1;03F5 +star;22C6 +#tie;0311 +# CMSY10 +# owner -> CONTAINS AS MEMBER +# circlecopyrt -> COMBINING ENCLOSING CIRCLE +# mapsto + [RIGHTWARDS ARROW] -> [RIGHTWARDS ARROW FROM BAR] +arrownortheast;2197 +arrowsoutheast;2198 +similarequal;2245 +arrownorthwest;2196 +arrowsouthwest;2199 +prime;2032 +owner;220B +triangle;25B3 +triangleinv;25BD +negationslash;0338 +#mapsto;21A6 +Rfractur;211C +Ifractur;2111 +latticetop;22A4 +unionmulti;228E +turnstileleft;22A2 +turnstileright;22A3 +floorleft;230A +floorright;230B +ceilingleft;2308 +ceilingright;2309 +angbracketleft;2329 +angbracketright;232A +bardbl;2225 +arrowbothv;2195 +arrowdblbothv;21D5 +wreathproduct;2240 +coproduct;2210 +unionsq;2294 +intersectionsq;2293 +subsetsqequal;2286 +supersetsqequal;2287 +diamondmath;22C4 +circleminus;2296 +circledivide;2298 +circledot;2299 +circlecopyrt;20DD +equivasymptotic;2243 +precedesequal;227C +followsequal;227D +lessmuch;226A +greatermuch;226B +follows;227B +#--end diff --git a/Build/source/texk/xdvipdfmx/contrib/patches/patch-ebb-artbox.diff b/Build/source/texk/xdvipdfmx/contrib/patches/patch-ebb-artbox.diff new file mode 100644 index 00000000000..7c9ff45c660 --- /dev/null +++ b/Build/source/texk/xdvipdfmx/contrib/patches/patch-ebb-artbox.diff @@ -0,0 +1,103 @@ +--- ebb.c.orig Fri Jun 29 04:55:26 2001 ++++ ebb.c Tue Dec 2 11:48:16 2003 +@@ -40,7 +40,7 @@ + #endif + + #define EBB_PROGRAM "ebb" +-#define EBB_VERSION "Version 0.5.2" ++#define EBB_VERSION "Version 0.5.2 (+ArtBox)" + + static void usage (void) + { +@@ -51,11 +51,13 @@ + fprintf (stderr, "under certain conditions. Details are distributed with the software.\n"); + fprintf (stderr, "\nUsage: [-v] [-b] ebb [files]\n"); + fprintf (stderr, "\t-b\t\tWrite .bb file in binary mode\n"); ++ fprintf (stderr, "\t-c\t\tUse MediaBox/CropBox for BoundingBox. (PDF)\n"); + fprintf (stderr, "\t-v\t\tVerbose\n"); + exit(1); + } + + static char verbose = 0; ++static char compat = 0; + + static void do_time(FILE *file) + { +@@ -189,7 +191,7 @@ + + void do_pdf (FILE *file, char *filename) + { +- pdf_obj *trailer, *catalog, *page_tree, *media_box, *crop_box; ++ pdf_obj *trailer, *catalog, *page_tree, *media_box, *crop_box, *rotate; + pdf_obj *kids_ref, *kids, *tmp1; + if (verbose) { + fprintf (stderr, "%s looks like a PDF file...", filename); +@@ -211,6 +213,7 @@ + /* Media box can be inherited so start looking for it now */ + media_box = pdf_deref_obj (pdf_lookup_dict (page_tree, "MediaBox")); + crop_box = pdf_deref_obj (pdf_lookup_dict (page_tree, "CropBox")); ++ rotate = pdf_deref_obj(pdf_lookup_dict(page_tree, "Rotate")); + while ((kids_ref = pdf_lookup_dict (page_tree, "Kids")) != NULL) { + kids = pdf_deref_obj (kids_ref); + pdf_release_obj (page_tree); +@@ -228,15 +231,43 @@ + pdf_release_obj (crop_box); + if (tmp1) + crop_box = tmp1; ++ tmp1 = pdf_deref_obj(pdf_lookup_dict(page_tree, "Rotate")); ++ if (tmp1 && rotate) ++ pdf_release_obj (rotate); ++ if (tmp1) ++ rotate = tmp1; + } ++ ++ if (crop_box) { ++ pdf_release_obj(media_box); ++ media_box = crop_box; ++ } ++ ++ if (!compat) { ++ pdf_obj *tmp; ++ ++ if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "TrimBox")))) { ++ if (media_box) ++ pdf_release_obj(media_box); ++ media_box = tmp; ++ } ++ if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "BleedBox")))) { ++ if (media_box) ++ pdf_release_obj(media_box); ++ media_box = tmp; ++ } ++ if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "ArtBox")))) { ++ if (media_box) ++ pdf_release_obj(media_box); ++ media_box = tmp; ++ } ++ if (rotate && pdf_number_value(rotate) != 0.0) ++ fprintf(stderr, "\n<< /Rotate %d >> found.\n", (int)pdf_number_value(rotate)); ++ } ++ + /* At this point, we should have the media box for the first page */ + { + pdf_obj *bbllx, *bblly, *bburx, *bbury; +- if (crop_box) { +- pdf_release_obj (media_box); +- media_box = crop_box; +- crop_box = NULL; +- } + if ((bbllx = pdf_get_array (media_box, 0)) == NULL || + (bblly = pdf_get_array (media_box, 1)) == NULL || + (bburx = pdf_get_array (media_box, 2)) == NULL || +@@ -267,6 +298,11 @@ + bb_file_mode = FOPEN_WBIN_MODE; + case 'v': + verbose = 1; ++ argc -= 1; ++ argv += 1; ++ break; ++ case 'c': ++ compat = 1; + argc -= 1; + argv += 1; + break; |