From: Werner Lemberg Date: Tue, 28 Sep 2004 08:21:07 +0000 (+0000) Subject: * scm/framework-tex.scm (font-load-command): Define proper font X-Git-Tag: release/2.3.20~20 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=671e33beec5bdfa62e8d9330131eb83ebc54bbd8;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 68c6b130dc..3ba8dbbb63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-09-28 Werner Lemberg + + * 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 * lily/score.cc (Score): oops. Copy error_found_ too. diff --git a/scm/framework-tex.scm b/scm/framework-tex.scm index 0cd7eab3fe..585082c6ef 100644 --- a/scm/framework-tex.scm +++ b/scm/framework-tex.scm @@ -48,15 +48,26 @@ (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)) diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 4ebd221d92..b5ba687c0b 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -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.