lilypond-user
[Top][All Lists]
Advanced

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

Re: Problem with a font


From: Torsten Hämmerle
Subject: Re: Problem with a font
Date: Thu, 5 Apr 2018 10:20:30 -0700 (MST)

Walter Garcia-Fontes wrote
> I get an error in your code for "slanting" the font: [...]

Hi Walter,

The ly:stencil-outline command did not exist in 2.18.2 yet.
Here's a downgraded version of \slanted:

%%%%% BEGIN OF SNIPPET
#(define-markup-command
  (slanted layout props arg)
  (markup?)
  #:category font
  #:properties ((slant-angle 12))
  "Fake a slanted font"
  (let* ((alpha-rad (* 0.5 (acos (tan (* (/ PI -180) slant-angle)))))
         (alpha-deg (* (/ 180 PI) alpha-rad))
         (stencil
          (if (markup? arg)
              (interpret-markup layout props arg)
              empty-stencil))
         (x-ext (ly:stencil-extent stencil X))
         (y-ext (ly:stencil-extent stencil Y)))
    (ly:make-stencil
     (ly:stencil-expr
      (ly:stencil-scale
       (ly:stencil-rotate
        (ly:stencil-scale
         (ly:stencil-rotate
          (ly:make-stencil (ly:stencil-expr stencil) (cons 0 0) (cons 0 0))
          45 0 0)
         1
         (* (tan alpha-rad)))
        (* (- alpha-deg)) 0 0)
       (* (sqrt 2) (cos alpha-rad)) (/ 0.5 (sqrt 0.5) (sin alpha-rad))))
     x-ext y-ext)))
%%%%% END OF SNIPPET

HTH,
Torsten




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



reply via email to

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