lilypond-devel
[Top][All Lists]
Advanced

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

Font_metric vs. Virtual_font_metric


From: Carl D. Sorensen
Subject: Font_metric vs. Virtual_font_metric
Date: Mon, 3 May 2004 22:01:23 -0600

Can someone enlighten me as to why lily uses Virtual_font_metric and
Font_metric?  It appears that if the font metric achain does not include
the name of a font, a Virtual_font_metric is created by
ly:paper-get-font, and that when the achain includes a font-name entry,
a Font_metric is created.

Why the difference?  It matters to me because I can successfully change
the size of a Virtual_font_metric stencil obtained using
ly:get-glyph-by-name, but I can't change the size of a stencil created
by fontify-text, regardless of whether it's a Virtual_font_metric (which
gives me lots of errors) or a Font_metric (which doesn't give me any
errors, but still doesn't change size).

Sample code:

#(def-markup-command (fontify-text-markup paper props size defstring)
  (number? string?)
  "Syntax: \\fontify-text-markup size defstring
   eg: \\markup \\fontify-text-string #-6 #\"mytext\"
    makes a markup of mytext at reduced size of 50 percent"
       (let* ((font (ly:paper-get-font paper `(((font-size .
,size)(font-name . "cmss8")(font-encoding . TeX-text))))))
        (fontify-text font defstring)
       ))
       
\score {
    \notes {
        a'2.^\markup \fontify-text-markup #4 #"string1"
        c'' ^\markup \fontify-text-markup #-6 #"string2"
        c' ^\markup \fontify-text-markup #-8 #"string3"
    }
  \paper{ raggedright = ##t }
}


Thanks,

Carl Sorensen




reply via email to

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