aminophen / dviout-util Goto Github PK
View Code? Open in Web Editor NEWSubset of DVIOUT utilities
License: Other
Subset of DVIOUT utilities
License: Other
dvipdfmx は,pdf:bann 〜 pdf:eann がネストされると
dpxlink.dvi -> dpxlink.pdf
[1
dvipdfmx:warning: Can't begin an annotation when one is pending.
dvipdfmx:warning: Interpreting special command bann (pdf:) failed.
dvipdfmx:warning: >> at page="1" position="(196.512, 119.253)" (in PDF)
dvipdfmx:warning: >> xxx "pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 1..."
dvipdfmx:warning: >> Reading special command stopped around >><</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 1]/A<</S/...<<
][2
dvipdfmx:warning: Tried to end an annotation without starting one!
dvipdfmx:warning: Interpreting special command eann (pdf:) failed.
dvipdfmx:warning: >> at page="2" position="(207.866, 657.235)" (in PDF)
dvipdfmx:warning: >> xxx "pdf:eann"
]
のように警告が出る。dvispc の開発版はアノテーションのスタックを扱えるので,
としたい。
なお,pdf:nolink による中断 (suspend),pdf:link による再開 (resume) がある場合(例示ソース)は,これだけでは支障があるかもしれないため要確認。
類似プログラムとの関連性など。
TeX-Guy については https://www.tug.org/TUGboat/tb21-3/tb68kaku.pdf も参照。「DVIlib」という独自だが包括的な DVI ライブラリ(これも独自の「VFlib」に依存)を使ってビルドする。但し,DVIlib の機能の多くはビューア部分 (xgdvi) のためと考えられ,単に dvispecials,dvifontlist,dvipages が欲しいだけならば,かなりのオーバースペックである。
大島先生の dvispc と比較して改善した点をメモしておきます。(追記:この内容は全てデフォルトのモード=ページ独立にするモードのみに関係します。)
(1) 追加した -z オプションは,
という目的で追加した。
(2) 上記 (1) にも関連するが,
は従来の dvispc がうまく対処していたが,
は未対処であった。そこで,最初に全ページをスキャンして,「どこかでぺージの色 (background) が一度でも変更されていれば,それ以前のページは白と明示する」という処理を加えた。
(3) 長さが 255 を超える長い special をサポートした (b9a22fe)。従来の color だけをサポートしていた頃は不要だったのだろうが,pdf:bann では非常に長い URL がありうる。
I've found a security vulnerability in this package, can you enable github security advisories for me to report it ?
警告が出るし,動作はまったく未確認であるが
でコンパイルできることを確認した手順のメモ。なお,リポジトリには現時点では Shift-JIS encoding でファイルを置いている。
propw は CP932 encoding の状態でコンパイルするとよさそう。現時点では GitHub に置いているファイルが全て CP932 (LF) なので,このままコンパイルしてよい。
$ cl -O1 /MD -DMSVC -DWIN32 chkfont.c
$ cl -O1 /MD dvispc.c
$ cl -O1 /MD -DWIN32 propw.c /link gdi32.lib
propw は UTF-8 encoding の状態でコンパイルするとよさそう。(動作は未確認;特に,propw はコードを見る限り EUC mode として動作しそうなので不安…)
$ gcc -o chkfont.exe -DUNIX -DGCC chkfont.c
$ gcc -o dvispc.exe -DUNIX dvispc.c
$ gcc -o propw.exe -DUNIX propw.c
後日,実際の動作確認を行う予定。
$ dvispc test testout
のように拡張子 .dvi を省略すると,test.dvi を入力できるが,出力が testout となり .dvi が付かない。「拡張子がない場合は .dvi を補う」でよい?
chkdvifont の TFM/JFM/OFM モードで,bc/ec に限らず,パラメータ表 (lf, nt, nl, ...) の各サイズをより詳細に見せる機能を追加したい。
tests/longspec.dvi を dvipdfmx にそのまま通すと annotation rectangle が各行の「A」をバラバラに囲むが,dvispc で「修正」してから dvipdfmx に通すと annotation rectangle が合体する。
dvispc で「修正」した後の 2 ページ目冒頭を見ると以下のようになっている。
[2]
bop 2 0 0 0 0 0 0 0 0 0 42
xxx4 282 'pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 1]/H/I/C[0 1 1]/A<</S/URI/URI(https://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex?revision=20236&view=markup)>>>>'
push
down3 982795
push
right3 3997451
xxx1 51 'pdf:dest (page.2) [@thispage /XYZ @xpos @ypos null]'
pop
pop
down4 41484288
push
push
down4 -39649280
down4 37683200
push
down4 -35389440 (<- 1)
push (<- 2)
right3 4063232 (<- 3)
fntnum7
setchar65
"A"
pop
となる(ここで (<-1)
, (<-2)
, (<-3)
は説明のためにつけた)。この「bop 直後の xxx4」が dvispc によって直前の 1 ページ目から持ち越されたものだが,この場所に pdf:bann があると dvipdfmx はアノテーションを合体させてしまうらしい。さらに調べてみると
(<-1)
の直後に動かしてもダメ(<-2)
あるいは (<-3)
の直後ならば OKらしい。
対応したものは、dvips/dviout などで使われている specials で以下のものです。
color specials: color push/pop, background
tpic specials: pn, sh
tpic specials の pn は、ペンの太さを決める、また、sh はシェーディングの濃さを決めるもので、その定義以降に影響を及ぼします。
他にもあるかも。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.