From ae365037be183fdb083e34c82fb2334105404ced Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 6 Feb 2005 22:58:01 +0000 Subject: [PATCH] * scm/framework-ps.scm (output-preview-framework): bugfix. * ly/chord-modifiers-init.ly (ignatzekExceptionMusic): use unicode o/ for chord modifier.. * lily/general-scheme.cc (LY_DEFINE): new function ly:wide-char->utf-8. --- ChangeLog | 7 +++++++ lily/general-scheme.cc | 19 +++++++++++++++++++ lily/lily-guile.cc | 1 + ly/chord-modifiers-init.ly | 28 +++++++++++++++++++++++++--- scm/framework-ps.scm | 10 +++++----- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ed348e2e2..97dc6df48a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-02-06 Han-Wen Nienhuys + * scm/framework-ps.scm (output-preview-framework): bugfix. + + * ly/chord-modifiers-init.ly (ignatzekExceptionMusic): use unicode + o/ for chord modifier.. + + * lily/general-scheme.cc (LY_DEFINE): new function ly:wide-char->utf-8. + * lily/drum-note-performer.cc: remove unused (thanks Michael Welsh Duggan). diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 58a608c683..b9fcf2540c 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -201,3 +201,22 @@ LY_DEFINE (ly_output_formats, "ly:output-formats", return lst; } + +LY_DEFINE(ly_wchar_to_utf_8, "ly:wide-char->utf-8", + 1, 0, 0, (SCM wc), + "Encode the Unicode codepoint @var{wc} as UTF-8") +{ + char buf[100]; + + SCM_ASSERT_TYPE(scm_is_integer (wc), wc, SCM_ARG1, __FUNCTION__, "integer"); + wchar_t wide_char = (wchar_t) scm_to_int (wc); + + mbstate_t state; + memset (&state, '\0', sizeof (state)); + memset (buf, '\0', sizeof (buf)); + + wcrtomb (buf, wide_char, &state); + + return scm_makfrom0str (buf); +} + diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 50bb49e841..c8692d0a74 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -742,3 +742,4 @@ ly_hash2alist (SCM tab) SCM func = ly_lily_module_constant ("hash-table->alist"); return scm_call_1 (func, tab); } + diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index 863d4a996f..4054f532d3 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -2,14 +2,36 @@ chordmodifiers = #default-chord-modifier-list -whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #77 } -blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #78 } +whiteTriangleMarkup = \markup { + %% 394 capital delta + %% #(ly:export (ly:wide-char->utf-8 #x0394)) + + %% up pointing triangle + %% #(ly:export (ly:wide-char->utf-8 #x25B3)) + + FIXME + + %% \override #'(font-encoding . TeX-math) \char #77 + +} + +blackTriangleMarkup = \markup { + + %% black up pointing triangle + %% #(ly:export (ly:wide-char->utf-8 #x25B2)) + FIXME + + %% \override #'(font-encoding . TeX-math) \char #78 } +} ignatzekExceptionMusic = { 1-\markup { "+" } -\markup { \super "o" } % should be $\circ$ ? - -\markup { \super \combine "o" "/" } + -\markup { + %% f8 o with slash. + #(ly:export (ly:wide-char->utf-8 #x00f8)) + } -\markup { \super "o7" } } diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index ed57823b43..1c26d8a863 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -320,11 +320,9 @@ (define-public (output-preview-framework basename book scopes fields ) - (let* ((outputter (ly:make-paper-outputter filename - "ps")) - (paper (ly:paper-book-paper book)) + (let* ((paper (ly:paper-book-paper book)) (systems (ly:paper-book-systems book)) - (scale (ly:output-def-lookup paper 'outputscale )) + (scale (ly:output-def-lookup paper 'outputscale)) (titles (take-while ly:paper-system-title? systems)) (non-title (find (lambda (x) (not (ly:paper-system-title? x))) systems)) @@ -332,7 +330,9 @@ (stack-stencils Y DOWN 0.0 (map ly:paper-system-stencil (append titles (list non-title)))))) - (dump-stencil-as-EPS paper dump-me basename #t))) + (dump-stencil-as-EPS paper dump-me + (format "~a.preview" basename) + #t))) -- 2.39.2