lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

determining which font is selected by \bold, 'font-series 'bold, etc


From: Wilbert Berendsen
Subject: determining which font is selected by \bold, 'font-series 'bold, etc
Date: Tue, 6 Jan 2015 12:44:31 +0100

Hi,

I have a font (Lexicon No1) that comes in 4 weight variants (A, B, C,
D). Roman font selects A. But \bold and '(font-series . bold) do select
the D variant. How can I make LilyPond choose C instead?

A solution is write a markup function:

#(define-markup-command (bold layout props arg)
  (markup?)
  #:category font
  "Switch to Lexicon No1 C when we are in roman mode"
  (interpret-markup layout
    (if (eq? (chain-assoc-get 'font-family props 'roman) 'roman)
      (prepend-alist-chain 'font-name "Lexicon No1 C" props)
      (prepend-alist-chain 'font-series 'bold props))
    arg))

This works. But the font name is hard coded, and it does not work for
texts that are printed with the 'font-series 'bold layout property set.

So I guess there is a place where LilyPond determines the weight to use
for 'bold and consecutively, the font to load. I guess that it is
possible to edit ~/.fonts.conf to have fontconfig then select the "C"
font instead of "D", based on the weight.

But where can I find how LilyPond selects the font weight and/or font
for the bold font series?


Thanks for any pointers.

-- 
Wilbert Berendsen
(http://www.wilbertberendsen.nl)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]