Re: how to get markup formatting to survive a font-name change
On 20 April 2017 at 05:42, Abraham Lee wrote: > > > Oh, boy. My phone's auto-correct... That should read "Pango". > > Anyway, I realized I didn't give you a very complete (or correct) solution. So, let's try again. The \paper block should look like this (and this should be below any #(set-global-staff-size ...) because that resets the "fonts" variable and you need to add to it): > > % > > \paper { > #(add-pango-fonts fonts 'minion "Minion Pro" (/ staff-height pt 20)) > bookTitleMarkup = ##f > scoreTitleMarkup = \markup { > \override #'(font-family . 'minion) > \fromproperty #'header:title > } > } > > % > > Now, the font choice should propagate through to the \italic command. Ooh, this is so nice! I often encounter this problem that \override #'(font-name . "My font") \italic does not produce the italic variant version of my font but \override #'(font-name . "My font Italic") works!!! I will try your "proper way" to add a font and all its variants!! Could you add this to the documentation, NR 1.8.3 Fonts ? Cheers, Xavier -- Xavier Scheuer ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to get markup formatting to survive a font-name change
On Wed, Apr 19, 2017 at 9:50 PM, Kieren MacMillan < kieren_macmil...@sympatico.ca> wrote: > Abraham, > > > The \paper block should look like this (and this should be below any > #(set-global-staff-size ...) because that resets the "fonts" variable and > you need to add to it): > > > > % > > > > \paper { > > #(add-pango-fonts fonts 'minion "Minion Pro" (/ staff-height pt 20)) > > bookTitleMarkup = ##f > > scoreTitleMarkup = \markup { > > \override #'(font-family . 'minion) > > \fromproperty #'header:title > > } > > } > > > > % > > > > Now, the font choice should propagate through to the \italic command. > > This is fabulous! Thanks. It also propagates through \bold, with is > wonderful. > But my family (Crimson Text) has bold and semibold variants — can I have > access to both? > Yes and no. By default, no. When you run add-pango-fonts, it only creates entries for the following weight-style combinations: 1. normal-upright 2. normal-caps 3. bold-upright 4. normal-italic 5. bold-italic If there isn't one of those variants, pango seems to fall-back to a closest relative in the family. So, you have three options: 1. do nothing and live with the above combinations 2. create a new font family that has the desired semibold as the "normal", which would also grab the semibold italic as well 3. modify the add-pango-fonts function to create more nodes, but I'm not sure if Pango knows how to grab variants outside of those listed above. The nice thing is that you can modify font.scm without needing to re-compile everything from source. I'll try adding a couple of combinations to see what happens and report back. Otherwise, it might be a more involved re-write to get convenient access to less common font variants without specifying the exact font name. I know that there was some work a while back by Alexander Kobel on extending this to a larger family of weights/styles/widths/etc., but I don't think it ever got finished, or did it? Perhaps Alexander can comment. This would be a great feature, IMO. Best, Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: how to get markup formatting to survive a font-name change
Hi Abraham, I have wanted to know how to do this for the longest time! Thanks. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to get markup formatting to survive a font-name change
Abraham, > The \paper block should look like this (and this should be below any > #(set-global-staff-size ...) because that resets the "fonts" variable and you > need to add to it): > > % > > \paper { > #(add-pango-fonts fonts 'minion "Minion Pro" (/ staff-height pt 20)) > bookTitleMarkup = ##f > scoreTitleMarkup = \markup { > \override #'(font-family . 'minion) > \fromproperty #'header:title > } > } > > % > > Now, the font choice should propagate through to the \italic command. This is fabulous! Thanks. It also propagates through \bold, with is wonderful. But my family (Crimson Text) has bold and semibold variants — can I have access to both? Thanks, Kieren. Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to get markup formatting to survive a font-name change
On Wed, Apr 19, 2017 at 9:16 PM, Abraham Lee wrote: > > On Wed, Apr 19, 2017 at 8:03 PM Kieren MacMillan < > kieren_macmil...@sympatico.ca> wrote: > >> Hello all, >> >> In the snippet, below, the font-name override kills the \italic as set in >> the \header. >> Is there any way to avoid that [without having to hack the title into two >> separate functions/parameters]? >> >> Thanks, >> Kieren. >> >> %%% SNIPPET BEGINS >> \version "2.19.59" >> >> \paper { >> bookTitleMarkup = ##f >> scoreTitleMarkup = \markup { >> \override #'(font-name . "Minion Pro") >> \fromproperty #'header:title >> } >> } >> >> \header { >> title = \markup { "SATB chorus" \italic "a cappella" } >> } >> >> \new Devnull s1 >> %%% SNIPPET ENDS > > > The reason it breaks the \italic is because you don't tell LilyPond that > there _is_ an italic variant when all you do is override the font-name like > that. > > The better way would be to add a text font to the "fonts" tree because it > looks for the four standard family members (regular, italic, bold, and > bold-italic). I think the scheme function is "add-text-fonts". You can find > how it's used in the file [LILYDIR]/scm/font.scm. > > With the font family added (let's say it's the 'minion family), you the > change to it with > > \markup { > \override #'(font-family . 'minion) > ... > } > > And if Pangolin found the italic variant, you shouldn't need to do > anything else other than \italic like normal. > Oh, boy. My phone's auto-correct... That should read "Pango". Anyway, I realized I didn't give you a very complete (or correct) solution. So, let's try again. The \paper block should look like this (and this should be below any #(set-global-staff-size ...) because that resets the "fonts" variable and you need to add to it): % \paper { #(add-pango-fonts fonts 'minion "Minion Pro" (/ staff-height pt 20)) bookTitleMarkup = ##f scoreTitleMarkup = \markup { \override #'(font-family . 'minion) \fromproperty #'header:title } } % Now, the font choice should propagate through to the \italic command. HTH, Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to get markup formatting to survive a font-name change
On Wed, Apr 19, 2017 at 8:03 PM Kieren MacMillan < kieren_macmil...@sympatico.ca> wrote: > Hello all, > > In the snippet, below, the font-name override kills the \italic as set in > the \header. > Is there any way to avoid that [without having to hack the title into two > separate functions/parameters]? > > Thanks, > Kieren. > > %%% SNIPPET BEGINS > \version "2.19.59" > > \paper { > bookTitleMarkup = ##f > scoreTitleMarkup = \markup { > \override #'(font-name . "Minion Pro") > \fromproperty #'header:title > } > } > > \header { > title = \markup { "SATB chorus" \italic "a cappella" } > } > > \new Devnull s1 > %%% SNIPPET ENDS The reason it breaks the \italic is because you don't tell LilyPond that there _is_ an italic variant when all you do is override the font-name like that. The better way would be to add a text font to the "fonts" tree because it looks for the four standard family members (regular, italic, bold, and bold-italic). I think the scheme function is "add-text-fonts". You can find how it's used in the file [LILYDIR]/scm/font.scm. With the font family added (let's say it's the 'minion family), you the change to it with \markup { \override #'(font-family . 'minion) ... } And if Pangolin found the italic variant, you shouldn't need to do anything else other than \italic like normal. Best, Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
how to get markup formatting to survive a font-name change
Hello all, In the snippet, below, the font-name override kills the \italic as set in the \header. Is there any way to avoid that [without having to hack the title into two separate functions/parameters]? Thanks, Kieren. %%% SNIPPET BEGINS \version "2.19.59" \paper { bookTitleMarkup = ##f scoreTitleMarkup = \markup { \override #'(font-name . "Minion Pro") \fromproperty #'header:title } } \header { title = \markup { "SATB chorus" \italic "a cappella" } } \new Devnull s1 %%% SNIPPET ENDS Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user