diff options
29 files changed, 21 insertions, 1376 deletions
diff --git a/lily/font-select.cc b/lily/font-select.cc index 81ba1115ce..5db047fc26 100644 --- a/lily/font-select.cc +++ b/lily/font-select.cc @@ -109,8 +109,7 @@ select_encoded_font (Output_def *layout, SCM chain) } #if HAVE_PANGO_FT2 - if (scm_is_string (name) - && is_pango_format_global) + if (scm_is_string (name)) return select_pango_font (layout, chain); else #endif diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 2efea228e2..f194dee35e 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -77,8 +77,6 @@ public: DECLARE_UNSMOB (Font_metric, metrics); -Box lookup_tex_text_dimension (Font_metric *font, SCM text); - char *pfb2pfa (Byte const *pfb, int length); #endif /* FONT_METRIC_HH */ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index cabb84843f..bc4f4c4c03 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -170,7 +170,6 @@ class Swallow_engraver; class Swallow_performer; class System; class Tempo_performer; -class Tex_font_metric; class Tie; class Tie_details; class Tie_configuration; diff --git a/lily/include/main.hh b/lily/include/main.hh index 1ddf2f41c8..fbd2aa3da9 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -33,8 +33,6 @@ extern string output_name_global; extern bool be_safe_global; extern bool be_verbose_global; extern bool do_internal_type_checking_global; -extern bool is_pango_format_global; -extern bool is_TeX_format_global; extern bool point_and_click_global; extern string lilypond_datadir; extern bool use_object_keys; diff --git a/lily/include/modified-font-metric.hh b/lily/include/modified-font-metric.hh index ada0060970..85882e86e8 100644 --- a/lily/include/modified-font-metric.hh +++ b/lily/include/modified-font-metric.hh @@ -39,7 +39,6 @@ protected: Box get_indexed_char (size_t) const; size_t index_to_ascii (size_t) const; Box get_ascii_char (size_t) const; - Box tex_kludge (string) const; }; #endif /* MODIFIED_FONT_METRIC_HH */ diff --git a/lily/include/text-metrics.hh b/lily/include/text-metrics.hh deleted file mode 100644 index 710cf5d755..0000000000 --- a/lily/include/text-metrics.hh +++ /dev/null @@ -1,21 +0,0 @@ -/* - text-metrics.hh -- declare text metric lookup functions - - source file of the GNU LilyPond music typesetter - - (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> -*/ - -#ifndef TEXT_METRICS_HH -#define TEXT_METRICS_HH - -#include "lily-guile.hh" -#include "box.hh" - -void try_load_text_metrics (string); -SCM ly_load_text_dimensions (SCM); -Box lookup_tex_text_dimension (Font_metric *font, - SCM text); - -#endif /* TEXT_METRICS_HH */ - diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 16af0c3cdf..21e2946d19 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -22,7 +22,6 @@ #include "parser.hh" #include "score.hh" #include "sources.hh" -#include "text-metrics.hh" #include "warn.hh" #include "program-option.hh" @@ -87,9 +86,6 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state*) void Lily_parser::parse_file (string init, string name, string out_name) { - if (get_output_backend_name () == "tex") - try_load_text_metrics (out_name); - // TODO: use $parser lexer_->set_identifier (ly_symbol2scm ("parser"), self_scm ()); output_basename_ = out_name; diff --git a/lily/main.cc b/lily/main.cc index ba8c3acbbc..29f3e685b3 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -57,9 +57,6 @@ string init_name_global; /* Output formats to generate. */ string output_format_global = ""; -bool is_pango_format_global; -bool is_TeX_format_global; - /* Current output name. */ string output_name_global; @@ -142,11 +139,9 @@ static Long_option_init options_static[] /* Bug in option parser: --output =foe is taken as an abbreviation for --output-format. */ {_i ("FORMATs"), "formats", 'f', _i ("dump FORMAT,... Also as separate options:")}, - {0, "dvi", 0, _i ("generate DVI (tex backend only)")}, {0, "pdf", 0, _i ("generate PDF (default)")}, {0, "png", 0, _i ("generate PNG")}, {0, "ps", 0, _i ("generate PostScript")}, - {0, "tex", 0, _i ("generate TeX (tex backend only)")}, {0, "help", 'h', _i ("show this help and exit")}, {_i ("FIELD"), "header", 'H', _i ("dump header field FIELD to file\n" "named BASENAME.FIELD")}, @@ -388,7 +383,6 @@ main_with_guile (void *, int, char **) if (be_verbose_global) dir_info (stderr); - is_pango_format_global = !is_TeX_format_global; init_scheme_variables_global = "(list " + init_scheme_variables_global + ")"; init_scheme_code_global = "(begin " + init_scheme_code_global + ")"; @@ -399,10 +393,6 @@ main_with_guile (void *, int, char **) init_freetype (); ly_reset_all_fonts (); - is_TeX_format_global = (get_output_backend_name () == "tex" - || get_output_backend_name () == "texstr"); - - /* We accept multiple independent music files on the command line to reduce compile time when processing lots of small files. Starting the GUILE engine is very time consuming. */ @@ -438,7 +428,7 @@ setup_localisation () setlocale (LC_ALL, ""); /* FIXME: check if this is still true. - Disable localisation of float values. This breaks TeX output. */ + Disable localisation of float values. */ setlocale (LC_NUMERIC, "C"); string localedir = LOCALEDIR; @@ -468,11 +458,9 @@ parse_argv (int argc, char **argv) switch (opt->shortname_char_) { case 0: - if (string (opt->longname_str0_) == "dvi" - || string (opt->longname_str0_) == "pdf" + if (string (opt->longname_str0_) == "pdf" || string (opt->longname_str0_) == "png" - || string (opt->longname_str0_) == "ps" - || string (opt->longname_str0_) == "tex") + || string (opt->longname_str0_) == "ps") add_output_format (opt->longname_str0_); else if (string (opt->longname_str0_) == "relocate") relocate_binary = true; diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 114b8e3824..ac2c88c68c 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -10,7 +10,6 @@ using namespace std; #include "modified-font-metric.hh" #include "pango-font.hh" -#include "text-metrics.hh" #include "warn.hh" #include "stencil.hh" #include "main.hh" @@ -102,62 +101,6 @@ Modified_font_metric::derived_mark () const { } -/* TODO: put this klutchness behind ly:option switch. */ -Box -Modified_font_metric::tex_kludge (string text) const -{ - Interval ydims; - Real w = 0; - for (ssize i = 0; i < text.length (); i++) - { - switch (text[i]) - { - case '\\': - /* Accent marks use width of base letter */ - if (i < text.length () - 1) - { - if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i + 1]=='"' - || text[i + 1]=='^') - { - i++; - break; - } - /* For string width \\ is a \ and \_ is a _. */ - if (text[i + 1]=='\\' || text[i + 1]=='_') - break; - } - - for (i++; (i < text.length ()) && !isspace (text[i]) - && text[i]!='{' && text[i]!='}'; i++) - ; - - /* Compensate for the auto-increment in the outer loop. */ - i--; - break; - - case '{': // Skip '{' and '}' - case '}': - break; - - default: - Box b = get_ascii_char ((unsigned char)text[i]); - - /* Use the width of 'x' for unknown characters */ - if (b[X_AXIS].length () == 0) - b = get_ascii_char ((unsigned char)'x'); - - w += b[X_AXIS].length (); - ydims.unite (b[Y_AXIS]); - break; - } - } - - if (ydims.is_empty ()) - ydims = Interval (0, 0); - - return Box (Interval (0, w), ydims); -} - Stencil Modified_font_metric::text_stencil (string text) const { @@ -179,25 +122,8 @@ Modified_font_metric::text_stencil (string text) const Box Modified_font_metric::text_dimension (string text) const { - SCM stext = ly_string2scm (text); - Box b; - if (get_output_backend_name () == "tex") - { - b = lookup_tex_text_dimension (orig_, stext); - - if (!b[Y_AXIS].is_empty ()) - { - b.scale (magnification_); - return b; - } - - b = tex_kludge (text); - return b; - } - Interval ydims; - Real w = 0.0; for (ssize i = 0; i < text.length (); i++) diff --git a/lily/text-metrics.cc b/lily/text-metrics.cc deleted file mode 100644 index b4ebd82b76..0000000000 --- a/lily/text-metrics.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* - text-metrics.cc -- implement text metric lookup functions - - source file of the GNU LilyPond music typesetter - - (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> -*/ - -#include "dimensions.hh" -#include "font-metric.hh" -#include "main.hh" -#include "file-path.hh" - -static SCM text_dimension_hash_tab; - -Box -lookup_tex_text_dimension (Font_metric *font, SCM text) -{ - Box b; - - /* - Actually, it's defined in framework-texstr, but let's see how long - it takes before we get a bugreport. HWN 13/2/2006. - */ - SCM limit = ly_lily_module_constant ("TEX_STRING_HASHLIMIT"); - string key_str = ly_scm2string (font->font_file_name ()); - int hash_code = scm_to_int (scm_hash (text, limit)); - key_str = to_string (hash_code) + key_str; - - SCM val = SCM_BOOL_F; - if (text_dimension_hash_tab) - { - scm_hash_ref (text_dimension_hash_tab, - ly_string2scm (key_str), - SCM_BOOL_F); - } - if (scm_is_pair (val)) - { - b[X_AXIS][LEFT] = 0.0; - b[X_AXIS][RIGHT] = scm_to_double (scm_car (val)) * point_constant; - val = scm_cdr (val); - b[Y_AXIS][UP] = scm_to_double (scm_car (val)) * point_constant; - val = scm_cdr (val); - b[Y_AXIS][DOWN] = scm_to_double (scm_car (val)) * point_constant; - } - - return b; -} - -LY_DEFINE (ly_load_text_dimensions, "ly:load-text-dimensions", - 1, 0, 0, - (SCM dimension_alist), - "Load dimensions from @TeX{} in a @code{(KEY . (W H D))} format" - " alist.") -{ - if (!text_dimension_hash_tab) - { - text_dimension_hash_tab - = scm_gc_protect_object (scm_c_make_hash_table (113)); - } - - for (SCM s = dimension_alist; - scm_is_pair (s); - s = scm_cdr (s)) - { - SCM key = scm_caar (s); - SCM val = scm_cdar (s); - - if (scm_hash_ref (text_dimension_hash_tab, key, SCM_BOOL_F) - == SCM_BOOL_F) - scm_hash_set_x (text_dimension_hash_tab, key, val); - } - - return SCM_UNSPECIFIED; -} - -void -try_load_text_metrics (string basename) -{ - string path = global_path.find (basename + ".textmetrics"); - if (path != "") - { - string contents (gulp_file_to_string (path, true, -1)); - contents = "(quote (" + contents + "))"; - - SCM lst = scm_c_eval_string (contents.c_str ()); - ly_load_text_dimensions (lst); - } -} diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly index 67839f9c6c..cac75ecb73 100644 --- a/ly/paper-defaults-init.ly +++ b/ly/paper-defaults-init.ly @@ -2,21 +2,17 @@ #(use-modules (scm layout-page-layout)) \paper { - %%%% WARNING - - %%% if you add any new dimensions, don't forget to update - %%% the dimension-variables variable. see paper.scm + %%% WARNING + %%% + %%% If you add any new dimensions, don't forget to update + %%% the dimension-variables variable. See paper.scm. unit = #(ly:unit) mm = 1.0 in = 25.4 - pt = #(/ in 72.27) + pt = #(/ in 72.27) cm = #(* 10 mm) - %% This is weird; `everyone' uses LATIN1? How does I select TeX - %% input encoding in EMACS? -- jcn - %%%%input-encoding = #"TeX" - input-encoding = #"latin1" print-page-number = ##t %% @@ -92,14 +88,11 @@ #(define font-defaults '((font-encoding . fetaMusic))) - %% use lmodern in latin1 (cork) flavour if EC is not available. + %% + %% the font encoding `latin1' is a dummy value for Pango fonts + %% #(define text-font-defaults - `((font-encoding . - ,(cond - (tex-backend? 'Extended-TeX-Font-Encoding---Latin) - (else 'latin1))) - ;; add to taste here. - + `((font-encoding . latin1) (baseline-skip . 3) (word-space . 0.6))) diff --git a/mf/feta-autometric.mf b/mf/feta-autometric.mf index 9679d3050a..fe7467aca2 100644 --- a/mf/feta-autometric.mf +++ b/mf/feta-autometric.mf @@ -7,9 +7,9 @@ % (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> % Jan Nieuwenhuizen <janneke@gnu.org> % -% these macros help create ascii logging output -% to automate generation of lily tables and tex backend -% The output should be parsed by the mf-to-table script +% These macros help create ascii logging output +% to automate generation of the lily tables. +% The output should be parsed by the mf-to-table script. message "******************************************************"; diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index c6f4423615..7626575084 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -59,11 +59,6 @@ bind def b4_Inc_state restore } bind def -/set_tex_dimen -{ - cvr def -} bind def - /stroke_and_fill { gsave stroke diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 0785386f45..67f6659830 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -156,7 +156,7 @@ (set! formats (cons "ps" formats))) (for-each (lambda (x) (if (member x formats) (set! new-fmts (cons x new-fmts)))) - '("tex" "dvi" "ps" "pdf" "png")) + '("ps" "pdf" "png")) (uniq-list (reverse new-fmts))) (define (header-to-file file-name key value) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 3961e16670..311faf463e 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -466,30 +466,8 @@ Inline an EPS image. The image is scaled along @var{axis} to () " @cindex inserting PostScript directly into text - This inserts @var{str} directly into the output as a PostScript -command string. Due to technicalities of the output backends, -different scales should be used for the @TeX{} and PostScript backend, -selected with @code{-f}. - -For the @TeX{} backend, the following string prints a rotated text - -@example -0 0 moveto /ecrm10 findfont -1.75 scalefont setfont 90 rotate (hello) show -@end example - -@noindent -The magical constant 1.75 scales from LilyPond units (staff spaces) to -@TeX{} dimensions. - -For the postscript backend, use the following - -@example -gsave /ecrm10 findfont - 10.0 output-scale div - scalefont setfont 90 rotate (hello) show grestore -@end example +command string. @lilypond[verbatim,quote] eyeglassesps = #\" diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index 39733c37ce..66659a902d 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -46,7 +46,7 @@ ;; TODO: ;; - generate this list by registering the output-backend-commands ;; output-backend-commands should have docstrings. -;; - remove hard copies in output-ps output-tex +;; - remove hard copies in output-ps (define-public (ly:all-output-backend-commands) "Return list of output backend commands." diff --git a/scm/framework-eps.scm b/scm/framework-eps.scm index cff610e8d3..4983874048 100644 --- a/scm/framework-eps.scm +++ b/scm/framework-eps.scm @@ -163,7 +163,3 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment." (define convert-to-pdf convert-to-pdf) (define convert-to-ps convert-to-ps) (define convert-to-png convert-to-png) -(define convert-to-tex convert-to-tex) -(define convert-to-dvi convert-to-dvi) - - diff --git a/scm/framework-null.scm b/scm/framework-null.scm index a035dc9b92..a552b5e707 100644 --- a/scm/framework-null.scm +++ b/scm/framework-null.scm @@ -23,5 +23,3 @@ (define-public (convert-to-ps . args) #t) (define-public (convert-to-pdf . args) #t) (define-public (convert-to-png . args) #t) -(define-public (convert-to-dvi . args) #t) -(define-public (convert-to-tex . args) #t) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index d6bf44eff2..58026ff726 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -38,11 +38,6 @@ "%" "_" name))) "m" (string-encode-integer (inexact->exact (round (* 1000 magnify))))))) -(define (tex-font? fontname) - (or - (equal? (substring fontname 0 2) "cm") - (equal? (substring fontname 0 2) "ec"))) - (define (define-fonts paper) (define font-list (ly:paper-fonts paper)) (define (define-font command fontname scaling) @@ -768,12 +763,6 @@ (* paper-height output-scale (/ (ly:bp 1))) name))) -(define-public (convert-to-dvi book name) - (ly:warning (_ "cannot generate ~S using the postscript back-end") "DVI")) - -(define-public (convert-to-tex book name) - (ly:warning (_ "cannot generate ~S using the postscript back-end") "TeX")) - (define-public (convert-to-ps book name) #t) diff --git a/scm/framework-scm.scm b/scm/framework-scm.scm index 53905e087d..5cb3a67490 100644 --- a/scm/framework-scm.scm +++ b/scm/framework-scm.scm @@ -34,5 +34,3 @@ (define-public (convert-to-ps . args) #t) (define-public (convert-to-pdf . args) #t) (define-public (convert-to-png . args) #t) -(define-public (convert-to-dvi . args) #t) -(define-public (convert-to-tex . args) #t) diff --git a/scm/framework-socket.scm b/scm/framework-socket.scm index 45cbfb9639..69b48db8a1 100644 --- a/scm/framework-socket.scm +++ b/scm/framework-socket.scm @@ -33,5 +33,3 @@ (define-public (convert-to-ps . args) #t) (define-public (convert-to-pdf . args) #t) (define-public (convert-to-png . args) #t) -(define-public (convert-to-dvi . args) #t) -(define-public (convert-to-tex . args) #t) diff --git a/scm/framework-tex.scm b/scm/framework-tex.scm deleted file mode 100644 index 5a602e4e48..0000000000 --- a/scm/framework-tex.scm +++ /dev/null @@ -1,380 +0,0 @@ -;;;; framework-tex.scm -- structure for TeX output -;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> - -(define-module (scm framework-tex) - #:export (output-framework-tex - output-classic-framework-tex)) - -(use-modules (ice-9 regex) - (ice-9 string-fun) - (scm page) - (scm paper-system) - (guile) - (srfi srfi-1) - (srfi srfi-13) - (srfi srfi-14) - (scm kpathsea) - (lily)) - -(define format ergonomic-simple-format) - -(define (output-formats) - (define formats (ly:output-formats)) - (set! formats (completize-formats formats)) - (if (member "ps" formats) - (set! formats (cons "dvi" formats))) - (if (member "dvi" formats) - (set! formats (cons "tex" formats))) - - (uniq-list formats)) - -(define framework-tex-module (current-module)) -(define-public (sanitize-tex-string s) - (if (ly:get-option 'safe) - (regexp-substitute/global - #f "\\\\" - (regexp-substitute/global #f "([{}])" s 'pre "\\" 1 'post) - 'pre "$\\backslash$" 'post) - s)) - -(define (symbol->tex-key sym) - (regexp-substitute/global - #f "_" (sanitize-tex-string (symbol->string sym)) 'pre "X" 'post)) - -(define (tex-number-def prefix key number) - (string-append - "\\def\\" prefix (symbol->tex-key key) "{" number "}%\n")) - -(define-public (digits->letters str) - (regexp-substitute/global - #f "[-\\._]" - (regexp-substitute/global - #f "([0-9])" str - 'pre - (lambda (match) - (make-string - 1 - (integer->char - (+ (char->integer #\A) - (- (char->integer #\0)) - (char->integer (string-ref (match:substring match 1) 0))) - ))) - 'post) - 'pre "" - 'post)) - -(define-public (tex-font-command-raw name magnification) - (string-append - "magfont" - (digits->letters (format "~a" name)) - "m" - (string-encode-integer - (inexact->exact (round (* 1000 magnification)))))) - -(define-public (tex-font-command font) - (tex-font-command-raw - (ly:font-file-name font) (ly:font-magnification font))) - -(define (otf-font-load-command paper font) - (let* ((sub-fonts (ly:font-sub-fonts font))) - (string-append - (apply string-append - (map - (lambda (sub-name) - (format "\\font\\~a=~a scaled ~a%\n" - (tex-font-command-raw - sub-name (ly:font-magnification font)) - sub-name - (ly:number->string - (inexact->exact - (round (* 1000 - (ly:font-magnification font) - (ly:paper-output-scale paper))))))) - sub-fonts))))) - -(define (simple-font-load-command paper font) - (format - "\\font\\~a=~a scaled ~a%\n" - (tex-font-command font) - (ly:font-file-name font) - (inexact->exact - (round (* 1000 - (ly:font-magnification font) - (ly:paper-output-scale paper)))))) - -(define (font-load-command paper font) - (if (pair? (ly:font-sub-fonts font)) - (otf-font-load-command paper font) - (simple-font-load-command paper font))) - -(define (define-fonts paper) - (string-append - ;; UGH. FIXME. - "\\def\\lilypondpaperunit{mm}%\n" - (tex-number-def "lilypondpaper" 'output-scale - (number->string (exact->inexact - (ly:paper-output-scale paper)))) - (tex-string-def "lilypondpaper" 'papersize - (eval 'papersizename (ly:output-def-scope paper))) - ;; paper/layout? - (tex-string-def "lilypondpaper" 'input-encoding - (eval 'input-encoding (ly:output-def-scope paper))) - - (apply string-append - (map (lambda (x) (font-load-command paper x)) - (ly:paper-fonts paper))))) - -(define (tex-string-def prefix key str) - (if (equal? "" (sans-surrounding-whitespace (sanitize-tex-string str))) - (string-append "\\let\\" prefix (symbol->tex-key key) "\\undefined%\n") - (string-append "\\def\\" prefix (symbol->tex-key key) - "{" (sanitize-tex-string str) "}%\n"))) - -(define (header paper page-count classic?) - (let ((scale (ly:output-def-lookup paper 'output-scale)) - (texpaper (string-append - (ly:output-def-lookup paper 'papersizename) - "paper")) - (landscape? (eq? #t (ly:output-def-lookup paper 'landscape)))) - (string-append - "% Generated by LilyPond " - (lilypond-version) "\n" - "% at " "time-stamp,FIXME" "\n" - (if classic? - (tex-string-def "lilypond" 'classic "1") - "") - - (if (ly:get-option 'safe) - "\\nofiles\n" - "") - - (tex-string-def - "lilypondpaper" 'line-width - (ly:number->string (* scale (ly:output-def-lookup paper 'line-width)))) - "\\def\\lilyponddocumentclassoptions{" - (sanitize-tex-string texpaper) - (if landscape? ",landscape" "") - "}%\n" - ))) - -(define (header-end) - (string-append - "\\def\\scaletounit{ " - (number->string lily-unit->bigpoint-factor) - " mul }%\n" - "\\ifx\\lilypondstart\\undefined\n" - " \\input lilyponddefs\n" - "\\fi\n" - "\\lilypondstart\n" - "\\lilypondspecial\n" - "\\lilypondpostscript\n")) - -(define (dump-page putter page last? with-extents?) - (ly:outputter-dump-string - putter - (format "\\lybox{~a}{~a}{%\n" - (if with-extents? - (interval-start (ly:stencil-extent page X)) - 0.0) - (if with-extents? - (- (interval-start (ly:stencil-extent page Y))) - 0.0))) - (ly:outputter-dump-stencil putter page) - (ly:outputter-dump-string - putter - (if last? - "}%\n\\vfill\n" - "}%\n\\vfill\n\\lilypondpagebreak\n"))) - -(define-public (output-framework basename book scopes fields) - (let* ((filename (format "~a.tex" basename)) - (outputter (ly:make-paper-outputter (open-file filename "wb") 'tex)) - (paper (ly:paper-book-paper book)) - (page-stencils (map page-stencil (ly:paper-book-pages book))) - (last-page (car (last-pair pages))) - (with-extents - (eq? #t (ly:output-def-lookup paper 'dump-extents)))) - (for-each - (lambda (x) - (ly:outputter-dump-string outputter x)) - (list - (header paper (length page-stencils) #f) - (define-fonts paper) - (header-end))) - (ly:outputter-dump-string outputter "\\lilypondnopagebreak\n") - (for-each - (lambda (page) - (dump-page outputter page (eq? last-page page) with-extents)) - page-stencils) - (ly:outputter-dump-string outputter "\\lilypondend\n") - (ly:outputter-close outputter) - (postprocess-output book framework-tex-module filename - (output-formats)))) - -(define (dump-line putter line last?) - (ly:outputter-dump-string - putter - (format "\\lybox{~a}{~a}{%\n" - (ly:number->string - (max 0 (interval-end (paper-system-extent line X)))) - (ly:number->string - (interval-length (paper-system-extent line Y))))) - - (ly:outputter-dump-stencil putter (paper-system-stencil line)) - (ly:outputter-dump-string - putter - (if last? - "}%\n" - "}\\interscoreline\n"))) - -(define-public (output-classic-framework - basename book scopes fields) - (let* ((filename (format "~a.tex" basename)) - (outputter (ly:make-paper-outputter - (open-file filename "w") 'tex)) - (paper (ly:paper-book-paper book)) - (lines (ly:paper-book-systems book)) - (last-line (car (last-pair lines)))) - (for-each - (lambda (x) - (ly:outputter-dump-string outputter x)) - (list - ;;FIXME - (header paper (length lines) #f) - "\\def\\lilypondclassic{1}%\n" - (output-scopes scopes fields basename) - (define-fonts paper) - (header-end))) - - (for-each - (lambda (line) (dump-line outputter line (eq? line last-line))) lines) - (ly:outputter-dump-string outputter "\\lilypondend\n") - (ly:outputter-close outputter) - (postprocess-output book framework-tex-module filename - (output-formats)) - )) - -(define-public (output-preview-framework - basename book scopes fields) - (let* ((filename (format "~a.tex" basename)) - (outputter (ly:make-paper-outputter (open-file filename "wb") - 'tex)) - (paper (ly:paper-book-paper book)) - (lines (ly:paper-book-systems book)) - (first-notes-index (list-index - (lambda (s) (not (ly:paper-system-title? s))) - lines))) - - (for-each - (lambda (x) - (ly:outputter-dump-string outputter x)) - (list - - ;;FIXME - (header paper (length lines) #f) - "\\def\\lilypondclassic{1}%\n" - (output-scopes scopes fields basename) - (define-fonts paper) - (header-end))) - - (for-each - (lambda (lst) - (dump-line outputter lst (not (ly:paper-system-title? lst)))) - (take lines (1+ first-notes-index))) - (ly:outputter-dump-string outputter "\\lilypondend\n") - (ly:outputter-close outputter) - (postprocess-output book framework-tex-module filename - (output-formats)))) - -(define-public (convert-to-pdf book name) - (let* ((defs (ly:paper-book-paper book)) - (paper-width (ly:output-def-lookup defs 'paper-width)) - (paper-height (ly:output-def-lookup defs 'paper-height)) - (output-scale (ly:output-def-lookup defs 'output-scale))) - (postscript->pdf (* paper-width output-scale (/ (ly:bp 1))) - (* paper-height output-scale (/ (ly:bp 1))) - (string-append (dir-basename name ".tex") ".ps")))) - -(define-public (convert-to-png book name) - (let* ((defs (ly:paper-book-paper book)) - (resolution (ly:output-def-lookup defs 'pngresolution)) - (paper-width (ly:output-def-lookup defs 'paper-width)) - (paper-height (ly:output-def-lookup defs 'paper-height)) - (output-scale (ly:output-def-lookup defs 'output-scale))) - (postscript->png - (if (number? resolution) - resolution - (ly:get-option 'resolution)) - - (* paper-width output-scale (/ (ly:bp 1))) - (* paper-height output-scale (/ (ly:bp 1))) - - (string-append (dir-basename name ".tex") ".ps")))) - -(define-public (convert-to-ps book name) - (let* ((paper (ly:paper-book-paper book)) - (preview? (string-contains name ".preview")) - (papersizename (ly:output-def-lookup paper 'papersizename)) - (landscape? (eq? #t (ly:output-def-lookup paper 'landscape))) - (base (dir-basename name ".tex")) - (ps-name (format "~a.ps" base ".ps")) - (cmd (string-append "dvips" - (if preview? - " -E" - (string-append - " -t" - ;; careful: papersizename is user-set. - (sanitize-command-option papersizename) - "")) - (if landscape? " -tlandscape" "") - (if (ly:kpathsea-find-file "lm.map") - " -u+lm.map" "") - (if (ly:kpathsea-find-file "ecrm10.pfa") - " -u+ec-mftrace.map" "") - " -u+lilypond.map -Ppdf" "" - " -o" ps-name - " " base))) - (if (access? ps-name W_OK) - (delete-file ps-name)) - (if (not (ly:get-option 'verbose)) - (begin - (ly:message (_ "Converting to `~a'...") (string-append base ".ps")) - (ly:progress "\n"))) - (ly:system cmd))) - -(define-public (convert-to-dvi book name) - (let* ((curr-extra-mem - (string->number - (regexp-substitute/global - #f " *%.*\n?" - (ly:kpathsea-expand-variable "extra_mem_top") - 'pre "" 'post))) - (base (dir-basename name ".tex")) - (cmd (format - #f "latex \\\\nonstopmode \\\\input '~a'" name))) - - ;; FIXME: latex 'foo bar' works, but \input 'foe bar' does not? - (if (string-index name (char-set #\space #\ht #\newline #\cr)) - (ly:error (_"TeX file name must not contain whitespace: `~a'") name)) - - (setenv "extra_mem_top" (number->string (max curr-extra-mem 1024000))) - (let ((dvi-name (string-append base ".dvi"))) - (if (access? dvi-name W_OK) - (delete-file dvi-name))) - (if (not (ly:get-option 'verbose)) - (begin - (ly:message (_ "Converting to `~a'...") (string-append base ".dvi")) - (ly:progress "\n"))) - - ;; FIXME: set in environment? - (if (ly:get-option 'safe) - (set! cmd (string-append "openout_any=p " cmd))) - - (ly:system cmd))) - -(define-public (convert-to-tex book name) - #t) - diff --git a/scm/framework-texstr.scm b/scm/framework-texstr.scm deleted file mode 100644 index 0fec9f94fb..0000000000 --- a/scm/framework-texstr.scm +++ /dev/null @@ -1,68 +0,0 @@ -;;;; framework-tex.scm -- -;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> - -(define-module (scm framework-texstr) - #:export (output-framework-tex - output-classic-framework-tex)) - -(use-modules (ice-9 regex) - (scm paper-system) - (ice-9 string-fun) - (guile) - (srfi srfi-1) - (srfi srfi-13) - (lily)) - -(define format ergonomic-simple-format) - -(define (header filename) - (format "% header -\\input{lilypond-tex-metrics} -\\documentclass{article} -\\lilyglobalscale{1.0} -\\lilymetricsfile{~a.textmetrics} -\\begin{document} -" filename)) - -(define (footer) - " -\\end{document} -") - -(define-public (output-classic-framework basename book scopes fields) - (let* ((filename (format #f "~a.texstr" basename)) - (outputter (ly:make-paper-outputter - (open-file filename "wb") - (ly:get-option 'backend))) - (paper (ly:paper-book-paper book)) - (lines (ly:paper-book-systems book))) - (ly:outputter-dump-string outputter (header basename)) - (for-each - (lambda (system) - (ly:outputter-dump-stencil outputter (paper-system-stencil system))) - lines) - (ly:outputter-dump-string outputter (footer)))) - -(define-public (output-framework basename book scopes fields ) - (let* ((filename (format #f "~a.texstr" basename)) - (outputter - (ly:make-paper-outputter - (open-file filename "wb") - (ly:get-option 'backend))) - (paper (ly:paper-book-paper book)) - (pages (ly:paper-book-pages book))) - (ly:outputter-dump-string outputter (header basename)) - (for-each - (lambda (page) - (ly:outputter-dump-stencil outputter page)) - pages) - (ly:outputter-dump-string outputter (footer)))) - -(define-public (convert-to-ps . args) #t) -(define-public (convert-to-pdf . args) #t) -(define-public (convert-to-png . args) #t) -(define-public (convert-to-dvi . args) #t) -(define-public (convert-to-tex . args) #t) diff --git a/scm/lily.scm b/scm/lily.scm index c9914981a8..7122ac3694 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -31,7 +31,7 @@ ;; - [subject-]-verb-object-object (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG") - (backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)") + (backend ps "which backend to use by default; Options: eps, ps [default], scm, svg)") (check-internal-types #f "check every property assignment for types") (clip-systems #f "Generate cut-out snippets of a score") (datadir #f "LilyPond prefix for data files (Readonly).") @@ -163,17 +163,9 @@ on errors, and print a stack trace.") (if (ly:get-option 'trace-scheme-coverage) (coverage:enable)) -(define-public tex-backend? - (member (ly:get-option 'backend) '(texstr tex))) - (define-public parser #f) -;; TeX C++ code actually hooks into TEX_STRING_HASHLIMIT -(define-public TEX_STRING_HASHLIMIT 10000000) - - - ;; gettext wrapper for guile < 1.7.2 (if (defined? 'gettext) (define-public _ gettext) @@ -251,8 +243,6 @@ predicates. Print a message at LOCATION if any predicate failed." ;;(define-public (output-framework) (write "hello\n")) -(define output-tex-module - (make-module 1021 (list (resolve-interface '(scm output-tex))))) (define output-ps-module (make-module 1021 (list (resolve-interface '(scm output-ps))))) diff --git a/scm/output-tex.scm b/scm/output-tex.scm deleted file mode 100644 index dc53b5a932..0000000000 --- a/scm/output-tex.scm +++ /dev/null @@ -1,178 +0,0 @@ -;;;; tex.scm -- implement Scheme output routines for TeX -;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 1998--2008 Jan Nieuwenhuizen <janneke@gnu.org> -;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> - - -;; The public interface is tight. -;; It has to be, because user-code is evalled with this module. - -;; ***It should also be clean, well defined, documented and reviewed*** - -;; To be reasonably safe, you probably do not want to use the TeX -;; backend anyway, but rather the PostScript backend. You may want -;; to run gs in a uml sandbox too. - - -(define-module (scm output-tex) - #:re-export (quote) - - ;; JUNK this -- see lily.scm: ly:all-output-backend-commands - #:export (unknown - blank - circle - dot - dashed-slur - named-glyph - dashed-line - comment - repeat-slash - placebox - bezier-sandwich - round-filled-box - text - setcolor - resetcolor - polygon - draw-line - no-origin - grob-cause)) - -(use-modules (ice-9 regex) - (ice-9 string-fun) - (guile) - (srfi srfi-13) - (scm framework-tex) - (lily)) - - - -;;;;;;;; -;;;;;;;; DOCUMENT ME! -;;;;;;;; - - -(define (char font i) - (string-append "\\" (tex-font-command font) - "\\char" (ly:inexact->string i 10) " ")) - -(define (unknown) - "%\n\\unknown\n") - -(define (url-link url x y) - "") - -(define (blank) - "") - -(define (circle radius thick) - (embedded-ps (list 'circle radius thick))) - -(define (dot x y radius) - (embedded-ps (list 'dot x y radius))) - -(define (embedded-ps string) - (embedded-ps (list 'embedded-ps string))) - -(define (dashed-slur thick on off lst) - (embedded-ps (list 'dashed-slur thick on off `(quote ,lst)))) - -(define (named-glyph font name) - (let* ((info (ly:otf-font-glyph-info font name)) - (subfont (assoc-get 'subfont info)) - (subidx (assoc-get 'subfont-index info))) - - ;;(stderr "INFO: ~S\n" info) - ;;(stderr "FONT: ~S\n" font) - (if (and subfont subidx) - (string-append "\\" (tex-font-command-raw - subfont - (ly:font-magnification font)) - "\\char" (number->string subidx)) - - (begin - (ly:warning (_ "cannot find ~a in ~a" name font)) - "")))) - -(define (dashed-line thick on off dx dy phase) - (embedded-ps (list 'dashed-line thick on off dx dy phase))) - -(define (embedded-ps expr) - (let ((ps-string - (with-output-to-string - (lambda () (ps-output-expression expr (current-output-port)))))) - (string-append "\\embeddedps{" ps-string "}"))) - -(define (repeat-slash w a t) - (embedded-ps (list 'repeat-slash w a t))) - -(define (number->dim x) - (string-append - ;;ugh ly:* in backend needs compatibility func for standalone output - (ly:number->string x) " \\output-scale ")) - -(define (placebox x y s) - (string-append - "\\lyitem{" (ly:number->string x) "}{" (ly:number->string y) "}{" s "}%\n")) - -(define (bezier-sandwich lst thick) - (embedded-ps (list 'bezier-sandwich `(quote ,lst) thick))) - - -(define (round-filled-box x y width height blotdiam) - (embedded-ps (list 'round-filled-box x y width height blotdiam))) - -(define (text font s) - (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))) - -(define (draw-line thick fx fy tx ty) - (embedded-ps (list 'draw-line thick fx fy tx ty))) - -;; no-origin not yet supported by Xdvi -(define (no-origin) "") - - -(define-public (line-location file line col) - "Print an input location, without column number ." - (string-append (number->string line) " " file)) - -(define-public point-and-click #f) - -(define (grob-cause offset grob) - (define (line-column-location file line col) - "Print an input location, including column number ." - (string-append (number->string line) ":" - (number->string col) " " file)) - - (if (procedure? point-and-click) - (let* ((cause (ly:grob-property grob 'cause)) - (music-origin (if (ly:stream-event? cause) - (ly:event-property cause 'origin))) - (location (if (ly:input-location? music-origin) - (ly:input-file-line-column music-origin)))) - (if (pair? location) - ;;; \\string ? - (string-append "\\special{src:" - (line-column-location location) "}") - "")) - "")) diff --git a/scm/output-texstr.scm b/scm/output-texstr.scm deleted file mode 100644 index 324b5b1fe1..0000000000 --- a/scm/output-texstr.scm +++ /dev/null @@ -1,41 +0,0 @@ -;;;; texstr.scm -- implement Scheme output routines for TeX strings -;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl> - -(define-module (scm output-texstr)) -(define this-module (current-module)) - -(use-modules - (guile) - (ice-9 regex) - (srfi srfi-13) - (scm framework-tex) - (lily)) - -(define (dummy . foo) #f) - -(map (lambda (x) (module-define! this-module x dummy)) - (ly:all-stencil-expressions)) - -(define-public (grob-cause . x) "") -(define-public (no-origin . x) "") -(define-public (placebox - x y what) - (if (string? what) - what - "")) - - -(define-public (text font str) - (call-with-output-string - (lambda (port) - (display (format "\\lilygetmetrics{~a~a}{~a}{1.0}{~a}\n" - - (hash str TEX_STRING_HASHLIMIT) - (ly:font-file-name font) - (ly:font-file-name font) - (sanitize-tex-string str)) - port) - ))) diff --git a/scm/paper.scm b/scm/paper.scm index 1879732834..81f1fa78ce 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -61,10 +61,7 @@ (setm! 'text-font-size (* 12 factor)) (setm! 'output-scale ss) - (setm! 'fonts - (if tex-backend? - (make-cmr-tree factor) - (make-century-schoolbook-tree factor))) + (setm! 'fonts (make-century-schoolbook-tree factor)) (setm! 'staff-height staff-height) (setm! 'staff-space ss) diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex deleted file mode 100644 index 4a05f9d46f..0000000000 --- a/tex/lily-ps-defs.tex +++ /dev/null @@ -1,43 +0,0 @@ -%% lily-ps-defs.tex -%% -\edef\lilypsdefsELC{\the\endlinechar}% -\endlinechar -1\relax - -%% Header info (macros/defs, etc) should go into a \special{! ... }; -%% note the ! sign. See dvips.info for details. -%% -%% We protect punctuation characters with \string to avoid problems with -%% language specific shorthands (e.g. `:' for French, `"' for German, etc.). - -\gdef\lilypondsetdimen#1{ - \expandafter\gdef\csname #1ps\endcsname{} - \special{ - \string! - /#1 (\csname #1\endcsname) set_tex_dimen}} - -\gdef\lilypondspace{ } - -\gdef\lilypondpostscript{ - %% A document processed with lilypond-book can contain music fragments in - %% different sizes. To reduce overhead, we define `lyscaleXXX' PS macros - %% only once. - \lilypondifundefined{lyscale\lilypondpaperoutputscale} - {\expandafter\gdef\csname lyscale\lilypondpaperoutputscale\endcsname{} - %% This sets CTM so that you get to the currentpoint - %% by executing a 0 0 moveto - \special{ - \string! - /lyscale\lilypondpaperoutputscale - {\lilypondpaperoutputscale\lilypondspace\scaletounit % - dup scale} def}} - {} - - \def\embeddedps##1{ - \special{ - \string" - lyscale\lilypondpaperoutputscale\lilypondspace ##1}}} - -\endlinechar \lilypsdefsELC -\endinput - -%% end lily-ps-defs.tex diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex deleted file mode 100644 index a7b5a2bf2d..0000000000 --- a/tex/lilyponddefs.tex +++ /dev/null @@ -1,370 +0,0 @@ -%%% lilyponddefs.tex -- TeX macros for LilyPond output. -%%% -%%% source file of the GNU LilyPond music typesetter -%%% -%%% (c) 1998--2008 Jan Nieuwenhuizen <janneke@gnu.org> -%%% Han-Wen Nienhuys <hanwen@cs.uu.nl> -%%% Mats Bengtsson <mats.bengtsson@s3.kth.se> -%%% -%% -%% Avoid \par while reading this file. -%% -\edef\lilyponddefsELC{\the\endlinechar}% -\endlinechar -1\relax - -%% This runs with plain TeX, LaTeX, pdftex, and texinfo. -%% -%% To avoid interferences, lilyponddefs.tex must be loaded within a group. -%% It is loaded only once, so the definitions must be global. -%% -%% The overall structure of a file created by LilyPond is as follows: -%% -%% <lilypond parameter definitions> -%% <font setup> -%% \ifx\lilypondstart \undefined -%% \input lilyponddefs -%% \fi -%% \lilypondstart -%% <note output> -%% \lilypondend - -%% A temporary variable. -%% -\newdimen\lytempdim - -%% The scaling factor for all dimensions. -%% -\newdimen\outputscale - -\long\gdef\lilypondfirst#1#2{#1} -\long\gdef\lilypondsecond#1#2{#2} - -%% \lilypondundefined{xxx}{foo}{bar} -%% -%% If `xxx' (without the leading backslash) is an undefined macro, -%% execute block `foo'. Otherwise, execute block `bar'. Based on -%% a similar macro from the LaTeX kernel. -%% -\gdef\lilypondifundefined#1{ - \expandafter\ifx\csname#1\endcsname\relax - \expandafter\lilypondfirst - \else - \expandafter\lilypondsecond - \fi -} - -%% Urgh. LilyPond uses EC fonts, but texinfo is based on CM. We thus -%% have to handle T1 font encoding by ourselves; all manipulations are -%% collected in the macro \lilypondECencoding. Note that the following -%% code only provides the texinfo interface, not complete access to all -%% EC glyphs. -%% -%% All definitions are taken from texinfo or LaTeX (with modifications -%% if necessary). -%% -\begingroup -\catcode `\@=11\relax -\gdef\lilypondECencoding{ - \def\"##1{ - {\accent4 ##1}} - \def\'##1{ - {\accent1 ##1}} - \def\,##1{ - {\leavevmode - \setbox\z@\hbox{##1} - \ifdim\ht\z@=1ex - \accent11 ##1 - \else - {\ooalign{ - \unhbox\z@ - \crcr - \hidewidth - \char11 - \hidewidth}} - \fi}} - \def\=##1{ - {\accent9 ##1}} - \def\^##1{ - {\accent2 ##1}} - \def\`##1{ - {\accent0 ##1}} - \def\~##1{ - {\accent3 ##1}} - \def\dotaccent##1{ - {\accent10 ##1}} - \def\H##1{ - {\accent5 ##1}} - \def\ringaccent##1{ - {\accent6 ##1}} -% \def\tieaccent##1{} % unsupported: this is TS1 - \def\u##1{ - {\accent8 ##1}} - \def\ubaraccent##1{ - {\o@lign{ - \relax - ##1 - \crcr - \hidewidth - \sh@ft{29}\vbox to.2ex{ - \hbox{\char9} - \vss} - \hidewidth}}} - \def\udotaccent##1{ - {\o@lign{ - \relax - ##1 - \crcr - \hidewidth - \sh@ft{10}. - \hidewidth}}} - \def\v##1{ - {\accent7 ##1}} - - \chardef\exclamdown=189 - \chardef\questiondown=190 - - \def\aa{ - \ringaccent{a}} - \def\AA{ - \ringaccent{A}} - \chardef\AE=198 - \chardef\ae=230 - \chardef\ptexi=25 - \chardef\j=26 - \chardef\L=138 - \chardef\l=170 - \chardef\O=216 - \chardef\o=248 - \chardef\OE=215 - \chardef\oe=247 - \chardef\ss=255 -} -\endgroup - -%% This macro provides the necessary setup to make the lilypond data -%% work with plain TeX, LaTeX, and texinfo. -%% -%% The reason of using \begingroup and \endgroup is to make the macro \x -%% immediately disappear after it has been executed. Since we have \def -%% within \def within \gdef, four hash signs (`#') are needed for -%% parameters. -%% -%% \lilypondfontencoding is emitted by LilyPond to set the encoding of -%% text strings. -%% -\gdef\lilypondstart{ - \frenchspacing - \outputscale \lilypondpaperoutputscale\lilypondpaperunit - - \begingroup - \catcode `\@=11\relax - - %% \@nodocument is defined as \relax after `\begin{document}' - \lilypondifundefined{@nodocument} - {%% Either plain TeX or texinfo or not at the beginning of LaTeX input. - \def\x{ - \endgroup - - \def\lilypondfontencoding####1{ - \lilypondECencoding} - \def\lilypondpagebreak{ - \eject} - \def\lilypondnopagebreak{ - \ifvmode - \penalty 10000\relax - \fi}}} - - {%% LaTeX mode: Provide a complete preamble. - \def\x{ - \endgroup - - %% Indicate that we shall emit `\end{document}' while executing - %% \lilypondend. - \def\lilyponddocument{} - - \def\lilypondfontencoding####1{ - \fontencoding{####1} - \selectfont} - \def\lilypondpagebreak{ - \newpage} - \def\lilypondnopagebreak{ - \nopagebreak} - - \documentclass[\lilyponddocumentclassoptions]{article} - - %% As a safety guard, don't produce auxiliary files. - \nofiles - - %% FIXME: workaround non-existent TeX.def. - \def\TeXdef{TeX}\ifx\TeXdef\lilypondpaperinputencoding - \usepackage[latin1]{inputenc} - \else - \usepackage[\lilypondpaperinputencoding]{inputenc} - \fi - \pagestyle{empty} - - \usepackage{color} - - \lilypondifundefined{lilypondclassic} - {%% If not in `classic' mode, undo LaTeX's page layout settings - %% since LilyPond does the layout by itself. - \topmargin-1in - \headheight0pt\headsep0pt - \oddsidemargin-1in - \evensidemargin\oddsidemargin} - - {%% Otherwise center output horizontally, without changing the - %% vertical positioning. - \hsize\lilypondpaperlinewidth\lilypondpaperunit - \lytempdim \paperwidth - \advance\lytempdim -\the\hsize - \lytempdim 0.5\lytempdim - \advance\lytempdim -1in - \oddsidemargin \lytempdim - \evensidemargin \lytempdim} - - \parindent 0pt - - %% We can't directly say `\begin{document}' in this macro since - %% older versions of texinfo.tex define \begin as \outer; this - %% means that it causes an error if \begin is found within another - %% macro (even if the corresponding code will never be executed). - %% As a workaround we use \csname to call \begin. - \csname begin\endcsname{document}}} - \x} - -%% The opposite of \lilypondstart. -%% -\gdef\lilypondend{ - %% Handle the `lastpagefill' parameter from the \layout block. - %% Ignore it if \lilypondbook is defined. - \lilypondifundefined{lilypondbook} - {\lilypondifundefined{lilypondpaperlastpagefill} - {\vskip 0pt plus\lilypondpaperinterscorelinefill00 fill} - {}} - {} - - \begingroup - \lilypondifundefined{lilyponddocument} - {\def\x{ - \endgroup}} - {\def\x{ - \endgroup - \csname end\endcsname{document}}} - \x} - -%% Load the PostScript drawing routines. This is done using \special. -%% To avoid multiple inclusions, redefine \lilypondspecial to a no-op -%% afterwards. -%% -\gdef\lilypondspecial{ - \special{header=music-drawing-routines.ps} - \gdef\lilypondspecial{}} - -%% The most used macro in LilyPond output. Put #3 into a zero-width box -%% which is moved to the right by #1 (scaled by \outputscale) and moved -%% up by #2 (also scaled by \outputscale). -%% -\gdef\lyitem#1#2#3{ - \raise #2\outputscale \hbox to 0pt { - \kern #1\outputscale - #3 - \hss}} - -%% All LilyPond music data is enclosed in this macro (as third argument). -%% The data (which consists of boxes with zero width) gets an artificial -%% width of #1 and a height of #2. The resulting box is then centered -%% vertically along the x-height of the current font. -%% -%% Parameters #1 and #2 are scaled by \outputscale. -%% -\gdef\lybox#1#2#3{ - \lytempdim #2\outputscale - \lytempdim -0.5\lytempdim - \advance\lytempdim 1ex - \leavevmode - \raise \lytempdim \hbox to #1\outputscale { - %% Convert depth of #3 into height only. - \vbox to #2\outputscale {\hbox{#3}\vss} - \hss}} - -%% Produce a black bar (width #2, depth #3, height #4) with a vertical -%% offset #1. Everything is scaled by \outputscale. -%% -\gdef\lyvrule#1#2#3#4{ - \kern#1\outputscale - \vrule width #2\outputscale depth #3\outputscale height #4\outputscale} - -%% FIXME: 'interscoreline' and 'lilypondPAPERinterscoreline -%% -\lilypondifundefined{lilypondpaperinterscorelinefill} - {\gdef\lilypondpaperinterscorelinefill{0}} - {\gdef\lilypondpaperinterscorelinefill{1}} - -%% Allow overriding of interscoreline, e.g., for LilyPond's --preview -%% -\lilypondifundefined{interscoreline} - {\lilypondifundefined{lilypondclassic} - {\gdef\interscoreline{}} - {\gdef\interscoreline{ - \vskip\lilypondpaperinterscoreline\lilypondpaperunit - plus \lilypondpaperinterscorelinefill fill}}} - {} - -%% Include PostScript definitions (which are differently defined for -%% TeX and pdfTeX). This is loaded once only because the inputted files -%% define \lilypondpostscript. -%% -%% (Don't remove the spaces after the arguments to \input!) -%% -% -%% In teTeX-3.0, latex is actually pdfetex, and we need -%% ifpdf.sty to determinine if we are really *tex or pdf*tex. -% -%% \input ifpdf.sty -% -%% However, ifpfd.sty is too smart for LilyPond, so we copy the -%% logic here. Using \input ifpdf.sty is a no-op when using latex, -%% and the \ifpdf switch is needed before \documentclass, using -%% \usepackage{ifpdf} is not an option. -% -\input lily-ps-defs - -% barfs with texi -% Runaway argument? -%{ -%! Forbidden control sequence found while scanning use of \lilypondfirst. -%<inserted text> -% \par -%<to be read again> -% \newif -%l.330 {\newif -% \ifpdf -%? -% -%% -%\lilypondifundefined{lilypondpostscript} -% {\newif\ifpdf -% \ifx\pdfoutput\undefined -% \else -% \ifx\pdfoutput\relax -% \else -% \ifcase\pdfoutput -% \else -% \pdftrue -% \fi -% \fi -% \fi -% \ifpdf -% {\input lily-pdf-defs } -% \else -% {\input lily-ps-defs } -% \fi} -% {} -% -%% Restore newline functionality (disabled to avoid \par). -%% -\endlinechar \lilyponddefsELC -\endinput - -%% end lilyponddefs.tex |