589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
# File 'lib/deplate/regions.rb', line 589
def prepare(accum, out, sfx)
pre = []
post = []
case sfx
when "png"
args = check_arguments("png", ["width", "height", "pointsize",
"bg"])
pre << %{png(filename="#{out}"%s)} % args
when "jpg"
args = check_arguments("png", ["width", "height", "pointsize",
"bg", "pointsize", "quality", "res"])
pre << %{jpg(filename="#{out}"%s)} % args
when "bmp"
args = check_arguments("png", ["width", "height", "pointsize",
"bg", "pointsize", "res"])
pre << %{bmp(filename="#{out}"%s)} % args
when "pdf"
args = check_arguments("pdf", ["width", "height", "family",
"title", "encoding", "bg", "fg",
"pointsize"])
pre << %{pdf(file="#{out}", onefile=TRUE%s)} % args
when "ps"
args = check_arguments("ps", ["width", "height", "family",
"title", "encoding", "bg", "fg",
"pointsize", "horizontal"])
pre << %{postscript(file="#{out}", onefile=TRUE, paper="special"%s)} % args
when "wmf"
args = check_arguments("wmf", ["width", "height", "pointsize"])
pre << %{win.metafile(filename="#{out}"%s)} % args
else
log(["Unknown suffix", sfx], :error)
raise
end
post << "dev.off()"
post << "q(runLast=FALSE)"
return (pre + accum + post).flatten
end
|