lilypond-user
[Top][All Lists]
Advanced

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

Re: Usage of ly:stencil-fonts ??


From: Torsten Hämmerle
Subject: Re: Usage of ly:stencil-fonts ??
Date: Sun, 21 Oct 2018 08:16:02 -0700 (MST)

Hi Harm,

As it looks like, this function has not been working for some time, I've
tested it back to 2.14.2

What does it do?

In lily/stencil-interpret.cc, the function find_expression_fonts gets a
scheme variable called expr with the following contents:


*(A) in your NoteHead example:*

(named-glyph #<Font_metric ("emmentaler-20" . 0.569055118110236)>
noteheads.s0)

-> Font_metric contains "Emmentaler-20"


*(B) I've changed the TextScript example to \markup \italic "italic"*

Now, the expressiong gets a bit convoluted, but there's still a
<Font_metric> information contained (but with font-name #f and dummy size
1.0), but there still are font names in the glyph-string (this time it is
"TeXGyreSchola-Italic")

(translate-stencil (0.0 . 0.0) (glyph-string #<Font_metric (#f . 1.0)>
TeXGyreSchola-Italic 3.865234375 #f (quote ((0.717009448818898
(-0.0341433070866142 . 1.4340188976378) 0.0 0.0 i) (0.785296062992126
(-0.0341433070866142 . 1.36573228346457) 0.0 0.0 t) (1.26330236220472
(-0.0341433070866142 . 1.02429921259843) 0.0 0.0 a) (0.717009448818898
(-0.0341433070866142 . 1.60473543307087) 0.0 0.0 l) (0.717009448818898
(-0.0341433070866142 . 1.4340188976378) 0.0 0.0 i) (0.990155905511811
(-0.0341433070866142 . 1.05844251968504) 0.0 0.0 c)))))


It calls function *interpret_stencil_expression* and (in our two cases),
"named-glyph" and "glyph-string" should use function *find_font_function* 

But this function just takes care of "text" and "char".

Unfortunately, we have "named-glyph" and "glyph-string" instead (I think
font handling has considerably changed in the meantime), so that the
function returns nothing.


*Experimental correction*

When implementing "named-glyph" (giving back cadr) and "glyph-string"
(giving back caddr), we actually get

(#<Font_metric ("emmentaler-20" . 0.569055118110236)>) for the NoteHead and
("TeXGyreSchola-Italic") for the TextScript in a first simple attempt.

With just your \number "1" example, TextScript will report ("Emmentaler-20")

So, basically, the information is there and it could be done.
But this looks like a tracker issue, because, as you found out, the function
currently just does nothing where it should give back a result.

All the best,
Torsten






--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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