From d5cfcb9fbc38bbb8ccccdf1123dcf46743b6540b Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 27 Dec 2004 22:55:50 +0000 Subject: [PATCH] * scm/output-texstr.scm (text): use \lilygetmetrics * scm/framework-texstr.scm (header): dump in new format. --- ChangeLog | 15 +++++++++ input/paddy.abc | 61 +++++++++++++++++++++++++++--------- lily/main.cc | 2 +- lily/text-item.cc | 3 +- make/lilypond.fedora.spec.in | 2 +- scm/framework-texstr.scm | 21 ++++++++++--- scm/output-texstr.scm | 15 ++++----- 7 files changed, 90 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e67c8a718..06157dc7a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-27 Han-Wen Nienhuys + + * scm/output-texstr.scm (text): use \lilygetmetrics + + * scm/framework-texstr.scm (header): dump in new format. + + * tex/lilypond-tex-metrics: new file. + 2004-12-27 Jan Nieuwenhuizen * lily/pango-font.cc (text_stencil): Quick try at glyph->charcode @@ -23,6 +31,13 @@ 2004-12-25 Han-Wen Nienhuys + * lily/main.cc: use TeX as default output format. + + * flower/file-path.cc (find): try to open directly as well, so we + find absolute path files. + + * lily/pango-select.cc: new file. + * scm/framework-ps.scm: remove all encoding code. load pfb/pfa for PangoFont too. diff --git a/input/paddy.abc b/input/paddy.abc index 0aadebc63c..7650c41768 100644 --- a/input/paddy.abc +++ b/input/paddy.abc @@ -1,16 +1,49 @@ -% -% This is NOT a lilypond input file. It is an ABC file, see -% http://www.gre.ac.uk/~c.walshaw/abc/ -% -% LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX -% -X:1 -T:Paddy O'Rafferty -C:Trad. -M:6/8 -K:D -dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB|| -~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA|| -fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:| +\version "2.3.25" +\header { + composer = "Trad." + crossRefNumber = "1" + footnotes = "" + tagline = "Lily was here (unknown version) -- automatically converted from ABC" + title = "Paddy O'Rafferty" +} +voicedefault = { +\set Score.defaultBarType = "empty" +% This is NOT a lilypond input file. It is an ABC file, see + % http://www.gre.ac.uk/~c.walshaw/abc/ + % + % LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX + \time 6/8 d''8 f''8 f''8 c''8 e''8 e''8 \bar "|" d''8 +e''8 f''8 g''8 f''8 e''8 \bar "|" d''8 f''8 f''8 c''8 + e''8 e''8 \bar "|" d''8 f''8 e''8 d''8 b'8 a'8 \bar "|" + d''8 f''8 f''8 c''8 e''8 e''8 \bar "|" d''8 e''8 f''8 + g''8 f''8 e''8 \bar "|" f''8 a''8 f''8 g''8 f''8 e''8 + \bar "|" d''8 f''8 e''8 d''8 b'8 a'8 \bar ":|" d''8 +f''8 e''8 d''8 c''8 b'8 \bar "||" a'4. ^"~" b'4. \bar "|" + g''8 f''8 e''8 f''8 d''8 b'8 \bar "|" a'8 f'8 a'8 +b'4 c''8 \bar "|" d''8 f''8 e''8 d''8 c''8 b'8 \bar "|" +a'4. ^"~" b'4. ^"~" \bar "|" e''8 f''8 e''8 e''8 f''8 g''8 + \bar "|" f''8 a''8 f''8 g''8 f''8 e''8 \bar "|" d''8 +f''8 e''8 d''8 c''8 b'8 \bar ":|" d''8 f''8 e''8 d''8 + b'8 a'8 \bar "||" f''8 a'8 a'8 e''8 a'8 a'8 \bar "|" +d''8 e''8 f''8 g''8 f''8 e''8 \bar "|" f''8 a'8 a'8 +e''8 a'8 a'8 \bar "|" d''8 f''8 e''8 d''8 b'8 a'8 +\bar "|" f''8 a'8 a'8 e''8 a'8 a'8 \bar "|" d''8 e''8 +f''8 g''8 f''8 e''8 \bar "|" f''8 a''8 f''8 g''8 f''8 + e''8 \bar "|" d''8 f''8 e''8 d''8 b'8 a'8 \bar ":|" + +} +\score{ + << + + \context Staff="default" + { + \voicedefault + } + + >> + \layout { + } + \midi {} +} diff --git a/lily/main.cc b/lily/main.cc index be54c91bba..918faa08c9 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -46,7 +46,7 @@ bool no_layout_global_b = false; /* Selected output format. One of tex, ps, scm, as. */ -String output_format_global = "ps"; +String output_format_global = "tex"; /* Current output name. */ String output_name_global; diff --git a/lily/text-item.cc b/lily/text-item.cc index 7203d7b8e0..31274c804a 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -37,7 +37,8 @@ Text_interface::interpret_string (SCM layout_smob, String str = ly_scm2string (markup); #if HAVE_PANGO_FT2 - if (output_format_global != "tex") + if (output_format_global != "tex" + && output_format_global != "texstr") { Font_metric *fm = select_pango_font (layout, props); return fm->text_stencil (str).smobbed_copy (); diff --git a/make/lilypond.fedora.spec.in b/make/lilypond.fedora.spec.in index f88b312b30..57708061ed 100644 --- a/make/lilypond.fedora.spec.in +++ b/make/lilypond.fedora.spec.in @@ -18,7 +18,7 @@ Buildrequires: t1utils bison flex mftrace ImageMagick Buildrequires: texinfo >= 4.7 Buildrequires: guile-devel >= 1.6.4-8 Buildrequires: freetype-devel >= 2.1 -Buildrequires: fontforge >= 20041211 +#Buildrequires: fontforge >= 20041211 Requires: tetex tetex-latex libstdc++ python tetex-dvips tetex-latex Requires: guile >= 1.6.4-8 ec-fonts-mftraced >= 1.0.5 diff --git a/scm/framework-texstr.scm b/scm/framework-texstr.scm index 834df7d309..1b6f4c14d7 100644 --- a/scm/framework-texstr.scm +++ b/scm/framework-texstr.scm @@ -17,20 +17,31 @@ (lily)) -(define (define-fonts paper) - ;; UGH. FIXME. - (format "(globalscale ~a)\n" (ly:paper-outputscale paper))) +(define (header filename) + (format "% header +\\input{lilypond-tex-metrics} +\\documentclass{article} +\\lilyglobalscale{1.0} +\\lilymetricsfile{~a.lpm} +\\begin{document} +" filename)) + +(define (footer) + " +\\end{document} +") (define-public (output-framework outputter book scopes fields basename ) (let* ((paper (ly:paper-book-paper book)) (pages (ly:paper-book-pages book)) ) - (ly:outputter-dump-string outputter (define-fonts paper)) + (ly:outputter-dump-string outputter (header basename)) (for-each (lambda (page) (ly:outputter-dump-stencil outputter page)) - pages))) + pages) + (ly:outputter-dump-string outputter (footer)))) diff --git a/scm/output-texstr.scm b/scm/output-texstr.scm index 854ae3a48b..b7e0ef4fa0 100644 --- a/scm/output-texstr.scm +++ b/scm/output-texstr.scm @@ -25,12 +25,13 @@ (if (string? what) what "")) - -(define-public (text font s) + +(define-public (text font str) (call-with-output-string (lambda (port) - (write (list - (ly:font-file-name font) - (ly:font-magnification font) - s) port) - (newline port)))) + (display (format "\\lilygetmetrics{~a~a}{~a}{1.0}{~a}\n" + (hash str 10000000) + (ly:font-file-name font) + (ly:font-file-name font) + str) port) + ))) -- 2.39.2