Skip to content

Commit

Permalink
パターン保持のためのEMF生成経路変更を変換経路図に反映 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
doraTeX committed Jan 8, 2016
1 parent 50c2e7d commit c26a881
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
Binary file modified info/conversion.pdf
Binary file not shown.
55 changes: 29 additions & 26 deletions info/conversion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -205,37 +205,41 @@
\node[output node] (PDF with text) at ($(PDF) + (-10,-3)$) {テキスト保持PDF\\(余白あり・透過)};
\draw[->] (PDF) -- node[right,align=left,xshift=15pt,yshift=-3pt] {pdf\TeX でクロップ\\+余白付与} (PDF with text.north east);

\node[output node] (Multipage PDF with text) at ($(PDF with text) + (0,-4.5)$) {マルチページ\\テキスト保持PDF\\(透過)};
\node[output node] (Multipage PDF with text) at ($(PDF with text) + (0,-4)$) {マルチページ\\テキスト保持PDF\\(透過)};
\draw[->] (PDF with text) -- node[left] {Quartz API} (Multipage PDF with text);

\node[output node] (SVG) at ($(PDF with text) + (4,-1)$) {テキスト保持\\SVG(透過)};
\draw[->] (PDF with text) -- node[right,xshift=-8pt,yshift=8pt] {mudraw} (SVG);
\node[output node] (SVG) at ($(PDF with text) + (2,-2)$) {テキスト保持\\SVG(透過)};
\draw[->] (PDF with text) -- node[right,xshift=-5pt,yshift=8pt] {mudraw} (SVG);

\node[output node] (Filled PDF with text) at ($(PDF with text) + (10,0)$) {テキスト保持PDF\\(余白あり・非透過)};
\node[output node] (Filled PDF with text) at ($(PDF with text) + (7,0)$) {テキスト保持PDF\\(余白あり・非透過)};
\draw[->] (PDF with text) --node[above] {Quartz API で背景塗り} (Filled PDF with text);

\node[output node] (Filled Multipage PDF with text) at ($(Filled PDF with text) + (0,-4.5)$) {マルチページ\\テキスト保持PDF\\(非透過)};
\draw[->] (Filled PDF with text) -- node[right] {Quartz API} (Filled Multipage PDF with text);
\node[output node] (Filled Multipage PDF with text) at ($(Filled PDF with text) + (0,-4)$) {マルチページ\\テキスト保持PDF\\(非透過)};
\draw[->] (Filled PDF with text) -- node[right,near end] {Quartz API} (Filled Multipage PDF with text);


\node[output node] (Filled SVG) at ($(Filled PDF with text) + (-4,-1)$) {テキスト保持\\SVG(非透過)};
\draw[->] (Filled PDF with text) -- node[left,xshift=8pt,yshift=8pt] {mudraw} (Filled SVG);
\node[output node] (Filled SVG) at ($(Filled PDF with text) + (-2,-2)$) {テキスト保持\\SVG(非透過)};
\draw[->] (Filled PDF with text) -- node[left,xshift=5pt,yshift=8pt] {mudraw} (Filled SVG);

\node[relay node] (EPS2) at ($(PDF with text) + (4,-2.5)$) {EPS\\(透過)};
\draw[->] (PDF with text) -- node[below,xshift=-18pt,yshift=-4pt] {Ghostscript\textsuperscript{*1}} (EPS2);
\node[relay node] (EPS for EMF) at ($(PDF) + (0,-2)$) {テキスト形式EPS};
\draw[->] (PDF) -- node[right] {pdftops} (EPS for EMF);

\node[relay node] (PDF for EMF) at ($(EPS for EMF) + (3.5,0)$) {PDF};
\draw[->] (EPS for EMF) -- node[above] {epstopdf\textsuperscript{*3}} (PDF for EMF);

\node[relay node] (PDF2 for EMF) at ($(PDF for EMF) + (0,-1.7)$) {テキスト保持PDF};
\draw[->] (PDF for EMF) -- node[left,align=right] {pdf\TeX でクロップ\\+余白付与} (PDF2 for EMF);
\path[->] ($(PDF2 for EMF.north east) + (-6pt,0pt)$) edge [loop right,out=90,in=0,distance=35] node[right,xshift=-25pt,yshift=14pt] {Quartz APIで背景塗り} ($(PDF2 for EMF.north east) + (0pt,-6pt)$);

\path[->] (EPS2) edge [loop left,out=165,in=-165,distance=20] node[left,xshift=2pt,yshift=2pt] {BB編集} (EPS2);

\node[output node] (EMF) at ($(EPS2) + (0,-2)$) {EMF\\(透過)};
\draw[->] (EPS2) -- node[left,align=right] {eps2emf\textsuperscript{*3}\\(改造版pstoedit)} (EMF);

\node[relay node] (Filled EPS2) at ($(Filled PDF with text) + (-4,-2.5)$) {EPS\\(非透過)};
\draw[->] (Filled PDF with text) -- node[below,xshift=15pt,yshift=-4pt] {Ghostscript\textsuperscript{*1}} (Filled EPS2);
\node[relay node] (EPS2 for EMF) at ($(PDF2 for EMF) + (0,-1.7)$) {EPS};
\draw[->] (PDF2 for EMF) -- node[left] {Ghostscript\textsuperscript{*1}} (EPS2 for EMF);

\node[output node] (Filled EMF) at ($(Filled EPS2) + (0,-2)$) {EMF\\(非透過)};
\draw[->] (Filled EPS2) -- node[right,align=left] {eps2emf\textsuperscript{*3}\\(改造版pstoedit)} (Filled EMF);
\node[relay node] (EMF) at ($(EPS2 for EMF) + (0,-1.7)$) {EMF};
\draw[->] (EPS2 for EMF) -- node[left,align=right] {eps2emf\\(改造版pstoedit)} (EMF);

\node[output node] (EPS without margin) at ($(Filled PDF with text) + (8,0)$) {EPS\\(余白なし・透過)};
\node[output node] (EPS without margin) at ($(Filled PDF with text) + (12,0)$) {EPS\\(余白なし・透過)};

\node[relay node] (PDF with text 2) at ($(EPS without margin) + (0,3)$) {テキスト保持PDF\\(余白なし・透過・単一ページ)};
\path[->] ($(PDF with text 2.north east) + (-6pt,0pt)$) edge [loop right,out=90,in=0,distance=35] node[above,yshift=2pt] {Quartz APIで再保存} ($(PDF with text 2.north east) + (0pt,-6pt)$);
Expand All @@ -247,14 +251,13 @@
\path[->] ($(Outlined PDF without margin.north east) + (-6pt,0pt)$) edge [loop right,out=90,in=0,distance=35] node[right,xshift=2pt,yshift=2pt] {pdf\TeX で余白付与} ($(Outlined PDF without margin.north east) + (0pt,-6pt)$);
\path[->] ($(Outlined PDF without margin.south east) + (0pt,6pt)$) edge [loop right,out=0,in=-90,distance=35] node[right,xshift=2pt,yshift=-2pt] {Quartz APIで背景塗り} ($(Outlined PDF without margin.south east) + (-6pt,0pt)$);


\node[output node] (Multipage Outlined PDF) at ($(Outlined PDF without margin) + (-2,-3)$) {マルチページ\\アウトライン化PDF};
\node[output node] (Multipage Outlined PDF) at ($(Outlined PDF without margin) + (-2,-2.5)$) {マルチページ\\アウトライン化PDF};
\draw[->] (Outlined PDF without margin) -- node[left] {Quartz API} (Multipage Outlined PDF);

\node[output node] (Outlined SVG) at ($(Outlined PDF without margin) + (2,-3)$) {アウトライン化SVG};
\draw[->] (Outlined PDF without margin) -- node[right] {mudraw} (Outlined SVG);
\node[output node] (Outlined SVG) at ($(Outlined PDF without margin) + (2,-2.5)$) {アウトライン化SVG};
\draw[->] (Outlined PDF without margin) -- node[right,yshift=3pt] {mudraw} (Outlined SVG);

\node[output node] (Animated SVG) at ($(Outlined SVG) + (0,-2)$) {アニメーションSVG};
\node[output node] (Animated SVG) at ($(Outlined SVG) + (0,-1.5)$) {アニメーションSVG};
\draw[->] (Outlined SVG) -- node[right] {SVG編集} (Animated SVG);


Expand All @@ -267,10 +270,10 @@
\node[output node] (Animation GIF 2) at ($(Bitmap2) + (2,2)$) {アニメーションGIF\\(画質優先)};
\draw[->] (Bitmap2.north east) -- node[right,yshift=-5pt] {Quartz API} (Animation GIF 2);

\node[output node] (EPS with margin) at ($(EPS without margin) + (0,-2)$) {EPS\\(余白あり・透過)};
\node[output node] (EPS with margin) at ($(EPS without margin) + (0,-2.5)$) {EPS\\(余白あり・透過)};
\draw[->] (EPS without margin) -- node[left] {BB編集} (EPS with margin);

\node[output node] (Filled EPS with margin) at ($(Filled PDF with text) + (4,-2)$) {EPS\\(余白あり・非透過)};
\node[output node] (Filled EPS with margin) at ($(Filled PDF with text) + (3,-2)$) {EPS\\(余白あり・非透過)};
\draw[->] (Filled PDF with text) -- node[right,yshift=5pt] {Ghostscript\textsuperscript{*1}} (Filled EPS with margin);

\end{tikzpicture}
Expand All @@ -287,7 +290,7 @@
\item\relax[*1]のGhostscirpt実行における \texttt{-r} オプションの値は,画質優先モードでは20016固定,速度優先モードでは解像度レベル設定に従う。
\item\relax[*1]のGhostscript実行においては,出力されるEPSのBoundingBox値が誤っている場合がある。そこで,epswriteで生成されたEPSに対しては,Ghostscriptのbboxデバイスで取得されるBoundingBox値によって常に上書きするようにしている。
\item\relax[*2]のepstopdf実行においては,OS X 10.11 El Capitan 以上では \texttt{--hires} オプションありで,それ未満ではなしで実行する。これは El Capitan で修正された Quartz API の不具合に対応するための措置である。OS X 10.10 Yosemite 以下のOSでは,\texttt{--hires} オプションありで生成されたPDFを Quartz API にかけると端が欠けるという現象が発生する。
\item\relax[*3]のeps2emf実行前に,パスのアウトライン化を行うように生成EPSを加工しておく。
\item\relax[*3]のepstopdf実行前に,パスのアウトライン化を行うように生成EPSを加工しておく。
\item 「元のページサイズを維持」がONの場合,[*1]のGhostscript実行においては,出力されるEPSのBB値を,変換前のPDFの指定されたPageBoxの値で上書きする。
\item 「元のページサイズを維持」がONの場合,「pdf\TeX でクロップ」の過程では,変換前のPDFの指定されたPageBox(余白付与の場合はそれに余白を加えたもの)をMediaBoxにしたPDF(左下が原点,他のBoxは非明示)を生成する。
\item\relax[*1]で用いられるGhostscriptのepswriteデバイスは,\TikZ のshadowsライブラリを用いた場合など,特定の種類の図は苦手としている。[*1]においてepswriteデバイスでEPSに変換すると,無数のパスに分割されてエラーを起こす原因となる。そのような図は,Ghostscriptによって綺麗にアウトライン化することはできないので,Ghostscriptを経由しない経路(テキスト保持PDF,テキスト保持SVG,速度優先モードでのビットマップ画像)で代用できないか検討してほしい。
Expand Down

0 comments on commit c26a881

Please sign in to comment.