[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incorrect letter spacing in header
From: |
Thomas Morley |
Subject: |
Re: Incorrect letter spacing in header |
Date: |
Thu, 18 Jul 2019 13:37:02 +0200 |
Am Do., 18. Juli 2019 um 13:04 Uhr schrieb David Kastrup <address@hidden>:
>
> Steven Smith <address@hidden> writes:
>
> > I am working on an arrangement for band, and would like the header
> > information to be the same size on the conductor's score and the
> > instrumental parts. I put the scores in different \book block so I
> > could use the #(set-global-staff-size 12.5) for the conductor's score
> > and #(set-global-staff-size 20) for the parts.
> >
> > Then I tried to use \abs-fontsize #20 for the Title in a
> > \bookTitleMarkup block. The second book has the correct font size, but
> > the letter spacing is wrong. If the first book has the smaller staff
> > size, the second book title spacing is too wide. If the first book has
> > the larger staff size, the second book title spacing is too narrow.
> >
> > What is going on here? MWE code follows, images attached.
>
> It doesn't work but bombs out because of "unexpected \book". The reason
> (after replacing unbreakable spaces by ordinary ones) is that
>
> > { \fromproperty #'header:title}
>
> is missing a space after #'header:title . Please check your examples
> before posting them, even after "trivial" changes.
>
> > \version "2.19.80"
>
> I can reproduce your problem with Ubuntu's standard version 2.18.2
> (short of the version complaint, of course) but not with my
> self-compiled version close to master. Can you check with the most
> recent development version (2.19.83 I think)?
>
> --
> David Kastrup
Fixed with
commit 8c96f95499189e630c7936bf4194f61e7d4d3456
Author: Torsten Hämmerle <address@hidden>
Date: Mon Jun 11 14:03:05 2018 +0200
Issue 5324: \abs-fontsize and set-global-staff-size in books
Font data buffered in a hashtable will provide an outdated LilyPond
scale factor after changing global staff size between books.
The straight-forward solution is to simply apply #ly:restet-all-fonts
from within #set-global-staff-size.
2nd patch:
One-word sentence in regtest file corrected.
As far as I can tell the patch is not in stable/2.20 and not in 2.19.83
Worth cherry-picking I'd say.
For now one could replace 'set-global-staff-size' with the fixed
version, full example:
\version "2.19.82"
#(define-public (set-global-staff-size sz)
"Set the default staff size, where SZ is thought to be in PT."
(let* ((current-mod (current-module))
(pap (ly:parser-lookup '$defaultpaper))
(in-layout? (or (module-defined? current-mod 'is-paper)
(module-defined? current-mod 'is-layout)))
;; maybe not necessary.
;; but let's be paranoid. Maybe someone still refers to the
;; old one.
(new-paper (ly:output-def-clone pap))
(new-scope (ly:output-def-scope new-paper)))
(if in-layout?
(ly:warning (_ "set-global-staff-size: not in toplevel scope")))
(ly:reset-all-fonts)
(layout-set-absolute-staff-size-in-module new-scope
(* sz (eval 'pt new-scope)))
(module-define! current-mod '$defaultpaper new-paper)))
notes = \relative c' { c1 d e f g }
% Just to make the image smaller
#(set! paper-alist (cons '("my size" . (cons (* 8.5 in) (* 2 in)))
paper-alist))
\paper {
#(set-paper-size "my size")
bookTitleMarkup =
\markup {
\fill-line {
\abs-fontsize #20
{ \fromproperty #'header:title }
}
}
}
\header {
title = \markup \abs-fontsize #20 "Adios, Au Revoir, Auf Wiedersehen"
tagline = ""
}
#(set-global-staff-size 12.5)
% for conductor's score
\book {
\score {
<<
{ \notes \notes \notes }
>>
}
}
#(set-global-staff-size 20)
% for Instrumental parts
\book {
\score {
<<
{ \notes \notes \notes }
>>
}
}
Cheers,
Harm