File: annotate.asy

package info (click to toggle)
asymptote 3.09%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,392 kB
  • sloc: cpp: 282,597; ansic: 69,697; python: 15,252; sh: 5,888; perl: 3,006; makefile: 1,719; lisp: 1,507; yacc: 614; lex: 449; xml: 182; javascript: 79; asm: 8
file content (16 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void annotate(picture pic=currentpicture, string title, string text,
              pair position)
{
  pic.add(new void(frame f, transform t) {
      position=t*position;
      label(f,"\special{!/pdfmark where
                 {pop} {userdict /pdfmark /cleartomark load put} ifelse
                 [/Rect["+(string) position.x+" 0 0 "+(string) position.y+"]
                 /Subtype /Text
                 /Name /Comment
                 /Title ("+title+")
                 /Contents ("+text+")
                 /ANN pdfmark}");
    },true);
  draw(pic,position,invisible);
}