"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/progs/convert/html/tmhtml.scm" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

tmhtml.scm  (TeXmacs-1.99.4-src):tmhtml.scm  (TeXmacs-1.99.5-src)
skipping to change at line 1085 skipping to change at line 1085
(set! tmhtml-image-serial (+ tmhtml-image-serial 1)) (set! tmhtml-image-serial (+ tmhtml-image-serial 1))
(let* ((postfix (string-append (let* ((postfix (string-append
"-" (number->string tmhtml-image-serial) "." ext)) "-" (number->string tmhtml-image-serial) "." ext))
(name-url (url-glue tmhtml-image-root-url postfix)) (name-url (url-glue tmhtml-image-root-url postfix))
(name-string (string-append tmhtml-image-root-string postfix))) (name-string (string-append tmhtml-image-root-string postfix)))
(values name-url name-string))) (values name-url name-string)))
(define (tmhtml-png y) (define (tmhtml-png y)
(let* ((mag (ahash-ref tmhtml-env :mag)) (let* ((mag (ahash-ref tmhtml-env :mag))
(x (if (or (nstring? mag) (== mag "1")) y (x (if (or (nstring? mag) (== mag "1")) y
`(with "font-size" ,mag ,y))) `(with "magnification" ,mag ,y)))
(l1 (tmhtml-collect-labels y)) (l1 (tmhtml-collect-labels y))
(l2 (if (null? l1) l1 (list (car l1))))) (l2 (if (null? l1) l1 (list (car l1)))))
(with cached (ahash-ref tmhtml-image-cache x) (with cached (ahash-ref tmhtml-image-cache x)
(if (not cached) (if (not cached)
(receive (name-url name-string) (tmhtml-image-names "png") (receive (name-url name-string) (tmhtml-image-names "png")
;;(display* x " -> " name-url ", " name-string "\n") ;;(display* x " -> " name-url ", " name-string "\n")
(let* ((extents (print-snippet name-url x)) (let* ((extents (print-snippet name-url x))
;;(pixels (inexact->exact (/ (second extents) 2100))) (dpi (string->number (get-preference "printer dpi")))
(pixels (inexact->exact (/ (second extents) 2000))) (den (/ (* dpi 2200.0) 600.0))
;;(den (/ (* dpi 2000.0) 600.0))
(pixels (inexact->exact (/ (second extents) den)))
(valign (number->htmlstring pixels)) (valign (number->htmlstring pixels))
(style (string-append "vertical-align: " valign "px"))) (style (string-append "vertical-align: " valign "px")))
;;(display* x " -> " extents "\n") ;;(display* x " -> " extents "\n")
(set! cached (set! cached
`((h:img (@ (src ,name-string) (style ,style) ,@l2)))) `((h:img (@ (src ,name-string) (style ,style) ,@l2))))
(ahash-set! tmhtml-image-cache x cached))) (ahash-set! tmhtml-image-cache x cached)))
cached)))) cached))))
(define (tmhtml-graphics l) (define (tmhtml-graphics l)
(tmhtml-png (cons 'graphics l))) (tmhtml-png (cons 'graphics l)))
 End of changes. 2 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS