[html-style-info] remove font-face/size/color from style-info

These were unused in real code.
This commit is contained in:
Christopher Lam 2019-11-25 20:38:16 +08:00
parent ea9d5fb197
commit 6c3b24a9b6
3 changed files with 3 additions and 117 deletions

View File

@ -225,10 +225,7 @@
(extra-attrib (and (pair? rest) rest)))
;; now generate the start tag
(let ((tag (gnc:html-markup-style-info-tag childinfo))
(attr (gnc:html-markup-style-info-attributes childinfo))
(face (gnc:html-markup-style-info-font-face childinfo))
(size (gnc:html-markup-style-info-font-size childinfo))
(color (gnc:html-markup-style-info-font-color childinfo)))
(attr (gnc:html-markup-style-info-attributes childinfo)))
;; "" tags mean "show no tag"; #f tags means use default.
(cond ((not tag)
@ -263,33 +260,12 @@
(build-first-tag (car tag))
(for-each add-internal-tag (cdr tag)))
(build-first-tag tag)))
;; XXX Font styling should be done through CSS, NOT html code
;; XXX Also, why is this even here? 'Font' is an html tag just like anything else,
;; so why does it have it's own custom pseudo code here? It should be built
;; as a call to this function just like any other tag, passing face/size/color as attributes.
(if (or face size color)
(begin
(issue-deprecation-warning
"this section is unreachable in code")
(push "<font ")
(if face
(begin
(push "face=\"") (push face) (push "\" ")))
(if size
(begin
(push "size=\"") (push size) (push "\" ")))
(if color
(begin
(push "color=\"") (push color) (push "\" ")))
(push ">")))
retval))))
(define (gnc:html-document-markup-end doc markup)
(let ((childinfo (gnc:html-document-fetch-markup-style doc markup)))
;; now generate the end tag
(let ((tag (gnc:html-markup-style-info-tag childinfo))
(closing-font-tag
(gnc:html-markup-style-info-closing-font-tag childinfo)))
(let ((tag (gnc:html-markup-style-info-tag childinfo)))
;; "" tags mean "show no tag"; #f tags means use default.
(cond ((not tag)
(set! tag markup))
@ -297,8 +273,6 @@
(set! tag #f)))
(let* ((retval '())
(push (lambda (l) (set! retval (cons l retval)))))
(if closing-font-tag
(push "</font>\n"))
(if tag
(let ((addtag (lambda (t)
(push "</")

View File

@ -36,12 +36,6 @@
;; tag : string for start tag
;; attributes : hash of attribute to value (unsafe!)
;; attribute : single attribute-value pair in a list
;; font-face : string for <font face=""> (deprecate)
;; font-size : string for <font size=""> (deprecate)
;; font-color : color (a valid HTML color spec) (deprecate)
;; closing-font-tag: private data (computed from font-face,
;; font-size, font-color)
;; don't set directly, please! (deprecate)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -49,10 +43,6 @@
(make-record-type "<html-markup-style-info>"
'(tag
attributes
font-face
font-size
font-color
closing-font-tag?
inheritable?)))
(define gnc:html-markup-style-info?
@ -63,7 +53,7 @@
(define (gnc:make-html-markup-style-info . rest)
(let ((retval (gnc:make-html-markup-style-info-internal
#f (make-hash-table) #f #f #f #f #t)))
#f (make-hash-table) #t)))
(apply gnc:html-markup-style-info-set! retval rest)
retval))
@ -76,9 +66,6 @@
(loop rest))
((field value . rest)
(when (memq field '(font-size font-face font-color))
(issue-deprecation-warning "font-face/size/color deprecated.")
(gnc:html-markup-style-info-set-closing-font-tag! style (and value #t)))
((record-modifier <html-markup-style-info> field) style value)
(loop rest))
@ -96,58 +83,6 @@
(define gnc:html-markup-style-info-set-attributes!
(record-modifier <html-markup-style-info> 'attributes))
(define gnc:html-markup-style-info-font-face
;; deprecated
(record-accessor <html-markup-style-info> 'font-face))
(define gnc:html-markup-style-info-set-font-face-internal!
;; deprecated
(record-modifier <html-markup-style-info> 'font-face))
(define (gnc:html-markup-style-info-set-font-face! record value)
(issue-deprecation-warning
"gnc:html-markup-style-info-set-font-face! is unused")
(gnc:html-markup-style-info-set-closing-font-tag! record value)
(gnc:html-markup-style-info-set-font-face-internal! record value))
(define gnc:html-markup-style-info-font-size
;; deprecated
(record-accessor <html-markup-style-info> 'font-size))
(define gnc:html-markup-style-info-set-font-size-internal!
;; deprecated
(record-modifier <html-markup-style-info> 'font-size))
(define (gnc:html-markup-style-info-set-font-size! record value)
(issue-deprecation-warning
"gnc:html-markup-style-info-set-font-size! is unused")
(gnc:html-markup-style-info-set-closing-font-tag! record value)
(gnc:html-markup-style-info-set-font-size-internal! record value))
(define gnc:html-markup-style-info-font-color
;; deprecated
(record-accessor <html-markup-style-info> 'font-color))
(define gnc:html-markup-style-info-set-font-color-internal!
;; deprecated
(record-modifier <html-markup-style-info> 'font-color))
(define (gnc:html-markup-style-info-set-font-color! record value)
(issue-deprecation-warning
"gnc:html-markup-style-info-set-font-color! is unused")
(begin
(gnc:html-markup-style-info-set-closing-font-tag!
record (not (eq? value #f)))
(gnc:html-markup-style-info-set-font-color-internal! record value)))
(define gnc:html-markup-style-info-closing-font-tag
;; deprecated
(record-accessor <html-markup-style-info> 'closing-font-tag?))
(define gnc:html-markup-style-info-set-closing-font-tag!
;; deprecated
(record-modifier <html-markup-style-info> 'closing-font-tag?))
(define gnc:html-markup-style-info-inheritable?
(record-accessor <html-markup-style-info> 'inheritable?))
@ -180,18 +115,6 @@
(lambda (k v) (hash-set! ht k v))
(gnc:html-markup-style-info-attributes s1))
ht)
;; font face
(or (gnc:html-markup-style-info-font-face s1)
(gnc:html-markup-style-info-font-face s2))
;; font size
(or (gnc:html-markup-style-info-font-size s1)
(gnc:html-markup-style-info-font-size s2))
;; color
(or (gnc:html-markup-style-info-font-color s1)
(gnc:html-markup-style-info-font-color s2))
;; closing font tag
(or (gnc:html-markup-style-info-closing-font-tag s1)
(gnc:html-markup-style-info-closing-font-tag s2))
;; inheritable (get this always from child)
(gnc:html-markup-style-info-inheritable? s1)))))

View File

@ -415,17 +415,6 @@
(export gnc:html-markup-style-info-set-tag!)
(export gnc:html-markup-style-info-attributes)
(export gnc:html-markup-style-info-set-attributes!)
(export gnc:html-markup-style-info-font-face) ;deprecated
(export gnc:html-markup-style-info-set-font-face-internal!) ;deprecated
(export gnc:html-markup-style-info-set-font-face!) ;deprecated
(export gnc:html-markup-style-info-font-size) ;deprecated
(export gnc:html-markup-style-info-set-font-size-internal!) ;deprecated
(export gnc:html-markup-style-info-set-font-size!) ;deprecated
(export gnc:html-markup-style-info-font-color) ;deprecated
(export gnc:html-markup-style-info-set-font-color-internal!) ;deprecated
(export gnc:html-markup-style-info-set-font-color!) ;deprecated
(export gnc:html-markup-style-info-closing-font-tag) ;deprecated
(export gnc:html-markup-style-info-set-closing-font-tag!) ;deprecated
(export gnc:html-markup-style-info-inheritable?)
(export gnc:html-markup-style-info-set-inheritable?!)
(export gnc:html-markup-style-info-set-attribute!)