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: Thomas Morley
Subject: Re: Usage of ly:stencil-fonts ??
Date: Mon, 22 Oct 2018 15:29:19 +0200

Hi Torsten,

I've created
https://sourceforge.net/p/testlilyissues/issues/5430/
Am So., 21. Okt. 2018 um 21:33 Uhr schrieb Torsten Hämmerle
<address@hidden>:
>
> Thomas Morley-2 wrote
> > I like to understand the numerical values.
> > The pair (-0.443862992125984 . 1.09258582677165) seems to be the
> > extent in Y-axis.
> >
> > But what about 3.865234375 and 1.1950157480315?
>
> Hi Harm,
>
> *The 3.865234375 is the font size (in millimetres!)*
> Converting this into pt (1 inch = 72.27 pt = 25.4 mm), you'll end up with
> the standard 11pt fontsize.
> These font sizes are always (!) absolute and never depend on
> global-staff-size etc.
>
> *The 1.1950157480315 is the running width of the character*

Though, I still don't get it.
Tbh, I'm more the opposite of a font-nerd, but I've tried  the code below:

#(define-markup-command (check layout props arg)(markup?)
  (let ((o-s (ly:output-def-lookup layout 'output-scale))
        (ancestor-o-s (ly:output-def-lookup $defaultlayout 'output-scale))
        (pt (ly:output-def-lookup layout 'pt))
        (ancestor-pt (ly:output-def-lookup $defaultlayout 'pt))
        ;(t-f-d (ly:output-def-lookup layout 'text-font-defaults))
        (t-f-s (ly:output-def-lookup layout 'text-font-size))
        (ancestor-t-f-s (ly:output-def-lookup $defaultlayout 'text-font-size))
        (stil (interpret-markup layout props arg))
  )
    (format #t "\noutput-scale: ~a" o-s)
    (format #t "\nancestor-output-scale: ~a" ancestor-o-s)
    (newline)
    (format #t "\npt: ~a" pt)
    (format #t "\nancestor-pt: ~a" ancestor-pt)
    (newline)
    (format #t "\ntext-font-size: ~a" t-f-s)
    (format #t "\nancestor-text-font-size: ~a" ancestor-t-f-s)
    (newline)
    (format #t "\nfont-design-size from current layout (same as
ancestor-pt): ~a"
      (ly:font-design-size (ly:paper-get-font layout props)))
    (newline)
    ;; this list selection has no security net, too lazy ...
    (format #t "\nfont and size (in mm) from stencil-expr: ~y"
      (take (drop (cdaddr (ly:stencil-expr stil)) 1) 2))

    (display (ly:output-def-lookup layout 'font-size))
    (display "\n#########################################\n")


    stil
    ))

\markup \check "g"
\markup \check \fontsize #2 "Ŏ"

It returns all sort of values, but I found no arithmetic how I can get
to the numerical number for the mm-font-size from the
stencil-expression.

Do you have some further hints?


Thanks,
  Harm



reply via email to

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