]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/framework-tex.scm (font-load-command): Define proper font
authorWerner Lemberg <wl@gnu.org>
Tue, 28 Sep 2004 08:21:07 +0000 (08:21 +0000)
committerWerner Lemberg <wl@gnu.org>
Tue, 28 Sep 2004 08:21:07 +0000 (08:21 +0000)
macro which sets font encoding if available.
(define-fonts): Define \lilypondpaperinputencoding, to be taken
from the \bookpaper block.

* tex/lilyponddefs.tex (\lilypondstart): Use
\lilypondpaperinputencoding for global input encoding.

ChangeLog
scm/framework-tex.scm
tex/lilyponddefs.tex

index 68c6b130dc6d75b8e092ab12c61b345ead35ee60..3ba8dbbb63553e43b000a82ba106a66606cb1c2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-28  Werner Lemberg  <wl@gnu.org>
+
+       * scm/framework-tex.scm (font-load-command): Define proper font
+       macro which sets font encoding if available.
+       (define-fonts): Define \lilypondpaperinputencoding, to be taken
+       from the \bookpaper block.
+
+       * tex/lilyponddefs.tex (\lilypondstart): Use
+       \lilypondpaperinputencoding for global input encoding.
+
 2004-09-28  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/score.cc (Score): oops. Copy error_found_ too.
index 0cd7eab3fe28104048d74964244a00cd459d7bb7..585082c6efbcd796e7e28a9efb4e882aa81c500f 100644 (file)
     (inexact->exact (round (* 1000 (ly:font-magnification font)))))))
 
 (define (font-load-command bookpaper font)
-  (string-append
-   "\\font\\" (tex-font-command font) "="
-   (ly:font-filename font)
-   " scaled "
-   (ly:number->string (inexact->exact
-                      (round (* 1000
-                         (ly:font-magnification font)
-                         (ly:bookpaper-outputscale bookpaper)))))
-   "\n"))
+  (let* ((coding-alist (ly:font-encoding-alist font))
+        (font-encoding (assoc-get 'output-name coding-alist))
+        )
+    (string-append
+     "\\font\\lilypond" (tex-font-command font) "="
+     (ly:font-filename font)
+     " scaled "
+     (ly:number->string (inexact->exact
+                        (round (* 1000
+                                  (ly:font-magnification font)
+                                  (ly:bookpaper-outputscale bookpaper)))))
+     "\n"
+     "\\def\\" (tex-font-command font) "{%\n"
+     ;; UGH.  Should be handled via alist.
+     (if (equal? "Extended-TeX-Font-Encoding---Latin" font-encoding)
+        "  \\fontencoding{T1}\\selectfont"
+        "  ")
+     "\\lilypond" (tex-font-command font)
+     "}\n"
+     )))
 
 
 (define (define-fonts bookpaper)
@@ -68,6 +79,8 @@
                                    (ly:bookpaper-outputscale bookpaper))))
    (tex-string-def "lilypondpaper" 'papersize
                   (eval 'papersize (ly:output-def-scope bookpaper)))
+   (tex-string-def "lilypondpaper" 'inputencoding
+                  (eval 'inputencoding (ly:output-def-scope bookpaper)))
 
    (apply string-append
          (map (lambda (x) (font-load-command bookpaper x))
index 4ebd221d92704575581f477c4183d8394f27a30a..b5ba687c0b21ae6fa1db88fd381dd841614fcaba 100644 (file)
@@ -56,7 +56,7 @@
        \documentclass[a4paper]{article}
        %% safe-mode
        \nofiles
-       \usepackage{inputenc}
+       \usepackage[\lilypondpaperinputencoding]{inputenc}
        \pagestyle{empty}
        \lilypondifundefined{lilypondclassic}
          {%% Nullify [La]TeX page layout settings, page layout by LilyPond.