573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
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
|
# File 'lib/deplate/regions.rb', line 573
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
|