702 |
preview-gs-init-string |
preview-gs-init-string |
703 |
(format "{DELAYSAFER{.setsafe}if}stopped pop\ |
(format "{DELAYSAFER{.setsafe}if}stopped pop\ |
704 |
/.preview-BP currentpagedevice/BeginPage get dup \ |
/.preview-BP currentpagedevice/BeginPage get dup \ |
705 |
null eq {pop{pop}bind}if def \ |
null eq {pop{pop}bind}if def\ |
706 |
<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or\ |
<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or\ |
707 |
{.preview-BP %s}{pop}ifelse}bind/PageSize[1 1]>>setpagedevice\ |
{.preview-BP %s}{pop}ifelse}bind/PageSize[1 1]>>setpagedevice\ |
708 |
/preview-do{[count 3 roll save]3 1 roll dup length 0 eq\ |
/preview-do{[count 3 roll save]3 1 roll dup length 0 eq\ |
721 |
to Ghostscript floats." |
to Ghostscript floats." |
722 |
(format "%g" (/ value 65535.0))) |
(format "%g" (/ value 65535.0))) |
723 |
|
|
724 |
|
(defun preview-pdf-color-string (colors) |
725 |
|
"Return a string that patches PDF foreground color to work properly." |
726 |
|
;; Actually, this is rather brutal. It will only be invoked in |
727 |
|
;; cases, however, where previously it was not expected that |
728 |
|
;; anything readable turned up, anyway. |
729 |
|
(let ((fg (aref colors 1))) |
730 |
|
(if fg |
731 |
|
(concat |
732 |
|
"/GS_PDF_ProcSet GS_PDF_ProcSet dup maxlength dict copy dup begin\ |
733 |
|
/graphicsbeginpage{//graphicsbeginpage exec " |
734 |
|
(mapconcat #'preview-gs-color-value fg " ") |
735 |
|
" 3 copy rg RG}bind store end readonly store ")))) |
736 |
|
|
737 |
(defun preview-gs-color-string (colors) |
(defun preview-gs-color-string (colors) |
738 |
"Return a string setting up colors" |
"Return a string setting up colors" |
739 |
(let ((bg (aref colors 0)) |
(let ((bg (aref colors 0)) |
887 |
(cond ((eq status 'exit) |
(cond ((eq status 'exit) |
888 |
(delete-process process) |
(delete-process process) |
889 |
(setq TeX-sentinel-function nil) |
(setq TeX-sentinel-function nil) |
890 |
|
(setq preview-gs-init-string |
891 |
|
(concat preview-gs-init-string |
892 |
|
(preview-pdf-color-string preview-colors))) |
893 |
(preview-prepare-fast-conversion) |
(preview-prepare-fast-conversion) |
894 |
(when gsstart |
(when gsstart |
895 |
(if preview-gs-queue |
(if preview-gs-queue |