diff options
| author | Phillip Lord | 2016-01-17 22:03:10 +0000 |
|---|---|---|
| committer | Phillip Lord | 2016-01-19 12:47:45 +0000 |
| commit | ef768c790ed83c8fa5c7efb24dc8e94967b5a778 (patch) | |
| tree | 4424db18ac2321a039d9e930f61206276eb5c477 | |
| parent | 66ff8bac8ba389bdabca34e70d08743dae4ecda1 (diff) | |
| download | emacs-ef768c790ed83c8fa5c7efb24dc8e94967b5a778.tar.gz emacs-ef768c790ed83c8fa5c7efb24dc8e94967b5a778.zip | |
Cope with multiple overlapping faces.
* lisp/htmlfontify.el (hfy-face-to-style-i): Treat inheritance right to
left.
(hfy-face-resolve-face): Handle font specification as well as font
name. Documentation update. (Bug#21990)
| -rw-r--r-- | lisp/htmlfontify.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 178f3a00133..fc309bd62ee 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -999,7 +999,7 @@ merged by the user - `hfy-flatten-style' should do this." | |||
| 999 | (append | 999 | (append |
| 1000 | parent | 1000 | parent |
| 1001 | (hfy-face-to-style-i | 1001 | (hfy-face-to-style-i |
| 1002 | (hfy-face-attr-for-class v hfy-display-class)) )))) | 1002 | (hfy-face-attr-for-class v hfy-display-class)))))) |
| 1003 | (setq this | 1003 | (setq this |
| 1004 | (if val (case key | 1004 | (if val (case key |
| 1005 | (:family (hfy-family val)) | 1005 | (:family (hfy-family val)) |
| @@ -1018,7 +1018,7 @@ merged by the user - `hfy-flatten-style' should do this." | |||
| 1018 | (:italic (hfy-slant 'italic)))))) | 1018 | (:italic (hfy-slant 'italic)))))) |
| 1019 | (setq that (hfy-face-to-style-i next)) | 1019 | (setq that (hfy-face-to-style-i next)) |
| 1020 | ;;(lwarn t :warning "%S => %S" fn (nconc this that parent)) | 1020 | ;;(lwarn t :warning "%S => %S" fn (nconc this that parent)) |
| 1021 | (nconc this that parent))) ) | 1021 | (nconc this parent that))) ) |
| 1022 | 1022 | ||
| 1023 | (defun hfy-size-to-int (spec) | 1023 | (defun hfy-size-to-int (spec) |
| 1024 | "Convert SPEC, a CSS font-size specifier, to an Emacs :height attribute value. | 1024 | "Convert SPEC, a CSS font-size specifier, to an Emacs :height attribute value. |
| @@ -1056,13 +1056,19 @@ haven't encountered them yet. Returns a `hfy-style-assoc'." | |||
| 1056 | (nconc r (hfy-size (if x (round n) (* n 1.0)))) )) | 1056 | (nconc r (hfy-size (if x (round n) (* n 1.0)))) )) |
| 1057 | 1057 | ||
| 1058 | (defun hfy-face-resolve-face (fn) | 1058 | (defun hfy-face-resolve-face (fn) |
| 1059 | "For FN return a face specification. | ||
| 1060 | FN may be either a face or a face specification. If the latter, | ||
| 1061 | then the specification is returned unchanged." | ||
| 1059 | (cond | 1062 | (cond |
| 1060 | ((facep fn) | 1063 | ((facep fn) |
| 1061 | (hfy-face-attr-for-class fn hfy-display-class)) | 1064 | (hfy-face-attr-for-class fn hfy-display-class)) |
| 1065 | ;; FIXME: is this necessary? Faces can be symbols, but | ||
| 1066 | ;; not symbols refering to other symbols? | ||
| 1062 | ((and (symbolp fn) | 1067 | ((and (symbolp fn) |
| 1063 | (facep (symbol-value fn))) | 1068 | (facep (symbol-value fn))) |
| 1064 | (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) | 1069 | (hfy-face-attr-for-class |
| 1065 | (t nil))) | 1070 | (symbol-value fn) hfy-display-class)) |
| 1071 | (t fn))) | ||
| 1066 | 1072 | ||
| 1067 | 1073 | ||
| 1068 | (defun hfy-face-to-style (fn) | 1074 | (defun hfy-face-to-style (fn) |