|
From: | Jan-Peter Voigt |
Subject: | Re: feature request: abs-fontsize available for all text grobs |
Date: | Mon, 22 Jul 2013 10:57:16 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
Hi Kieren,now I am looking at this feature request and maybe have an idea ... later more on that. Your snippet here fails, because the InstrumentName grob has two properties 'long-text and 'text, which may or may not be set. The 'text property is only set, when you define a shortInstrumentName, in this case only 'long-text is set (-> instrumentName), so (ly:grob-property grob 'text) returns '(), which is not a string or markup.
The example compiles, if you check for existance of the properties: --snip-- #(define ((set-abs-fontsize n) grob) (let ((text (ly:grob-property grob 'text)) (long-text (ly:grob-property grob 'long-text))) (ly:message "~A" (ly:grob-properties grob)) (cond ((markup? text) (grob-interpret-markup grob (markup #:abs-fontsize n text))) ((markup? long-text) (grob-interpret-markup grob (markup #:abs-fontsize n long-text))) (else empty-stencil) ))) absFontSizeStencil = #(define-scheme-function (parser location n)(number?) (set-abs-fontsize n)) \layout { \context { \Score \override InstrumentName #'stencil = \absFontSizeStencil 30 \override TextScript #'stencil = \absFontSizeStencil 30 } } --snip-- ... but now the long-text is printed on every line - not only the first. Best, Jan-Peter Am 16.07.2013 18:30, schrieb Kieren MacMillan:
I don't mind Mike's function per se, but I would love for Lilypond to allow us to set absolute fontsizes for every text object — maybe every grob (text or not) — in a consistent way. For example, this fails \version "2.17" #(define ((set-abs-fontsize n) grob) (grob-interpret-markup grob (markup #:abs-fontsize n (ly:grob-property grob 'text)))) \layout { \context { \Score \override InstrumentName #'stencil = #(set-abs-fontsize 30) \override TextScript #'stencil = #(set-abs-fontsize 30) } } \new Staff \with { instrumentName = "Test" } \relative c' { e4^\markup "Test" e e e }
[Prev in Thread] | Current Thread | [Next in Thread] |