- (let*
- ((mapping #f) ;; (assoc-get 'char-mapping (ly:font-encoding-alist font))))
-
-
- ;; TODO: we'd better do this for PS only
- ;; LaTeX gets in the way, and we need to remap
- ;; nonprintable chars.
-
- (input-enc-name #f) ;; (assoc-get 'input-name (ly:font-encoding-alist font) ))
- )
-
- (string-append "\\hbox{\\" (tex-font-command font)
- (if (string? input-enc-name)
- (string-append "\\inputencoding{" input-enc-name "}")
- "{}")
- (sanitize-tex-string
- (if (vector? mapping)
- (reencode-string mapping s)
- s))
- "}")))
-
-(define (white-text scale s)
- (embedded-ps (list 'white-text scale s)))
-
-(define (polygon points blotdiameter)
- (embedded-ps (list 'polygon `(quote ,points) blotdiameter)))
+ (format #f
+ "\\hbox{\\~a{}~a}" (tex-font-command font)
+ (sanitize-tex-string s)))
+
+(define (setcolor r g b)
+ (string-append "\\color[rgb]{"
+ (number->string r) ", "
+ (number->string g) ", "
+ (number->string b) "}"))
+
+;; FIXME
+;; The PostScript backend saves the current color
+;; during setcolor and restores it during resetcolor.
+;; We don't do that here.
+(define (resetcolor)
+ (string-append "\\color[rgb]{0,0,0}\n"))
+
+(define (polygon points blot-diameter fill)
+ (embedded-ps (list 'polygon `(quote ,points) blot-diameter fill)))