Skip to content

Commit

Permalink
clipping PDF and PS now fully supported by dvisvgm
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Grahn committed Mar 21, 2020
1 parent 2efc45a commit a36ce58
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions dvisvgm.def
Expand Up @@ -15,7 +15,7 @@
%%
%% https://github.com/latex3/graphics-def/issues
%
\ProvidesFile{dvisvgm.def}[2018//11/02 v1.1a dvisvgm graphics driver for latex]
\ProvidesFile{dvisvgm.def}[2020/03/22 v1.2 dvisvgm graphics driver for latex]
% The following is copied from dvips.def:
\def\GPT@space{ }
\def\c@lor@arg#1{%
Expand Down Expand Up @@ -88,16 +88,6 @@
\divide\dimen@\dimen@ii
\@tempdima\Gin@req@height
\divide\@tempdima\dimen@ii
\ifGin@clip%
\Gin@req@width0.99626\Gin@req@width%
\Gin@req@height0.99626\Gin@req@height%
\special{dvisvgm:raw
<g><clipPath id="GinClip\Gin@clip@id">%
<path d="M{?x},{?y}l\strip@pt\Gin@req@width,0l0,-\strip@pt\Gin@req@height
l-\strip@pt\Gin@req@width,0Z"/>%
</clipPath>%
<g clip-path="url(\Gin@hash@tag GinClip\Gin@clip@id)">}%
\fi%
\special{#2="#1"\GPT@space
\ifx\Gin@page\@empty\else page=\Gin@page\GPT@space\fi
llx=\Gin@llx\GPT@space
Expand All @@ -106,14 +96,8 @@
ury=\Gin@ury\GPT@space
\ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\GPT@space\fi
\ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\GPT@space\fi
% \ifGin@clip clip\fi % to be implemented in dvisvgm-2.7.x
\ifGin@clip clip\fi
}%
\ifGin@clip%
\special{dvisvgm:raw </g></g>}%
\begingroup%
\count@\Gin@clip@id\advance\count@ by\@ne\xdef\Gin@clip@id{\the\count@}%
\endgroup%
\fi%
\egroup}
\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
Expand Down Expand Up @@ -231,7 +215,6 @@
\def\Gread@svg@width@double"#1"#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\edef\Gin@urx{\strip@pt\dimen@}}
\def\Gin@gobble@till@relax#1\relax{}
\edef\Gin@hash@tag{\string#}
\def\Gin@clip@id{0}

\@namedef{Gin@rule@.jpg}#1{{bitmap}{.xbb}{#1}}
\@namedef{Gin@rule@.jpeg}#1{{bitmap}{.xbb}{#1}}
Expand Down

0 comments on commit a36ce58

Please sign in to comment.