lilypond-auto
[Top][All Lists]
Advanced

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

[Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5430 ly:stenc


From: Auto mailings of changes to Lily Issues via Testlilyissues-auto
Subject: [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5430 ly:stencil-fonts always returns '()
Date: Mon, 22 Oct 2018 13:17:04 -0000

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>

-> 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")</font_metric>

(translate-stencil (0.0 . 0.0) (glyph-string #<font_metric 1.0)="" (#f="" .="">
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)))))</font_metric>

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.</font_metric>

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

So, basically, the information is there and it could be done.

Full discussion starting:
https://lists.gnu.org/archive/html/lilypond-user/2018-10/msg00286.html


[issues:#5430] ly:stencil-fonts always returns '()

Status: New
Created: Mon Oct 22, 2018 01:14 PM UTC by Thomas Morley
Last Updated: Mon Oct 22, 2018 01:14 PM UTC
Owner: nobody

At least since 2.12.3 ly:stencil-fonts always returns '()

\version "2.12.3"

%% old syntax and includes module to make it work
%% with old ly-versions

#(use-modules (ice-9 pretty-print))

{
  \override TextScript #'after-line-breaking =
  #(lambda (grob)
    ;(pretty-print (ly:stencil-expr (ly:grob-property grob 'stencil)))
    (format #t "\nResult of ly:stencil-fonts: ~y"
      (ly:stencil-fonts (ly:grob-property grob 'stencil))))
  s-"g"
}

Returns in terminal:
Result of ly:stencil-fonts: ()

Uncommenting the line (pretty-print ...) will print:

(translate-stencil
  (0.0 . 0.0)
  (glyph-string
    #<Font_metric (#f . 1.0)>
    "TeXGyreSchola-Regular"
    3.865234375
    #f
    '((1.1950157480315
       (-0.443862992125984 . 1.09258582677165)
       0.0
       0.0
       "g"))))

So fonts are visible in the stencil-_expression_


Sent from sourceforge.net because address@hidden is subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/testlilyissues/admin/issues/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

_______________________________________________
Testlilyissues-auto mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto

reply via email to

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