Function: org-odt-hfy-face-to-css

org-odt-hfy-face-to-css is a byte-compiled function defined in ox-odt.el.gz.

Signature

(org-odt-hfy-face-to-css FN)

Documentation

Create custom style for face FN.

When FN is the default face, use its foreground and background properties to create "OrgSrcBlock" paragraph style. Otherwise use its color attribute to create a character style whose name is obtained from FN. Currently all attributes of FN other than color are ignored.

The style name for a face FN is derived using the following operations on the face name in that order - de-dash, CamelCase and prefix with "OrgSrc". For example, font-lock-function-name-face is associated with
"OrgSrcFontLockFunctionNameFace".

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
;;;; Src Block

(defun org-odt-hfy-face-to-css (fn)
  "Create custom style for face FN.
When FN is the default face, use its foreground and background
properties to create \"OrgSrcBlock\" paragraph style.  Otherwise
use its color attribute to create a character style whose name
is obtained from FN.  Currently all attributes of FN other than
color are ignored.

The style name for a face FN is derived using the following
operations on the face name in that order - de-dash, CamelCase
and prefix with \"OrgSrc\".  For example,
`font-lock-function-name-face' is associated with
\"OrgSrcFontLockFunctionNameFace\"."
  (let* ((css-list (hfy-face-to-style fn))
	 (style-name (concat "OrgSrc"
                             (mapconcat
                              'capitalize (split-string
                                           (hfy-face-or-def-to-name fn) "-")
                              "")))
	 (color-val (cdr (assoc "color" css-list)))
	 (background-color-val (cdr (assoc "background" css-list)))
	 (style (and org-odt-create-custom-styles-for-srcblocks
		     (cond
		      ((eq fn 'default)
		       (format org-odt-src-block-paragraph-format
			       background-color-val color-val))
		      (t
		       (format
			"
<style:style style:name=\"%s\" style:family=\"text\">
  <style:text-properties fo:color=\"%s\"/>
 </style:style>" style-name color-val))))))
    (cons style-name style)))