Re: box-stencil (was: Drawing boxes around grobs)

2020-02-24 Thread Paolo Prete
On Mon, Feb 24, 2020 at 5:47 PM Paolo Prete wrote: > > >> >> This is pretty weird. It happens if I produce a SVG output and open it >> with Chrome/Chromium-browser... >> (no problem with Firefox) >> >> > It seems something associated with chrome/chromium's default font, which > is smaller than

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-24 Thread Paolo Prete
> > This is pretty weird. It happens if I produce a SVG output and open it > with Chrome/Chromium-browser... > (no problem with Firefox) > > It seems something associated with chrome/chromium's default font, which is smaller than the Firefox default one (while the box dimensions remain the same)

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-24 Thread Paolo Prete
On Mon, Feb 24, 2020 at 5:07 PM Thomas Morley wrote: Can't see any other padding than the specified 0.3 ... > > This is pretty weird. It happens if I produce a SVG output and open it with Chrome/Chromium-browser... (no problem with Firefox) Best, P

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-24 Thread Thomas Morley
Am Mo., 24. Feb. 2020 um 16:20 Uhr schrieb Paolo Prete : > > Thanks to Torsten and Harm > > Another issue seems to be in TextScript: > > { > > \override TextScript.stencil = > #(make-stencil-boxer 0.1 0.3 ly:text-interface::print) > > c'4_"foo bar bar" > > } > > In 2.19.84, the box adds

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-24 Thread Paolo Prete
Thanks to Torsten and Harm Another issue seems to be in TextScript: { \override TextScript.stencil = #(make-stencil-boxer 0.1 0.3 ly:text-interface::print) c'4_"foo bar bar" } In 2.19.84, the box adds unwanted right padding, while 2.19.45 (Lilybin) doesn't. Any feedback/fix/workaround?

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-23 Thread Torsten Hämmerle
Hello Paolo, Yes, indeed, this is the crux with italic fonts… It's hard (to say the least) to automatically determine whether or not the additional space inserted after "mf" is needed. Even in hot-metal typesetting the typesetter has to decide when to insert such an "italic correction". The only

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-23 Thread Thomas Morley
Am So., 23. Feb. 2020 um 18:13 Uhr schrieb Paolo Prete : > > > > On Sun, Feb 23, 2020 at 12:54 PM Torsten Hämmerle > wrote: >> >> >> A *pragmatic solution* to your problem would be to re-define the dynamics >> definitions concerned, simply adding a wee bit of space to the left and to >> the

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-23 Thread Paolo Prete
On Sun, Feb 23, 2020 at 12:54 PM Torsten Hämmerle wrote: > > A *pragmatic solution* to your problem would be to re-define the dynamics > definitions concerned, simply adding a wee bit of space to the left and to > the right, as in > > mf = #(make-dynamic-script (markup #:line (#:hspace 0.2

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-23 Thread Torsten Hämmerle
Paolo Prete-3 wrote > I just checked that this unwanted behavior happens in the > default make-stencil-boxer function too. Ciao Paolo, Unfortunately, this is a common problem with (mostly) italic fonts: When looking at the dynamic f in FontForge, you'll see that the glyph is sticking out of its

Re: box-stencil (was: Drawing boxes around grobs)

2020-02-22 Thread Paolo Prete
I just checked that this unwanted behavior happens in the default make-stencil-boxer function too. Is there a fix for this? Thanks { \override DynamicText.stencil = #(make-stencil-boxer 0.4 0 ly:text-interface::print) c'_\mf } On Sun, Feb 23, 2020 at

box-stencil (was: Drawing boxes around grobs)

2020-02-22 Thread Paolo Prete
(This is for Aaron (and anyone who shows interest...) Hi Aaron, I need a little fix on the wonderful function you implemented. As you can see, in case of dynamic, the box has a little unwanted overlay. How we could avoid this? Thanks, Best P \version "2.19.83" #(define (box-stencil

Re: Drawing boxes around grobs

2020-02-10 Thread Aaron Hill
On 2020-02-09 6:54 am, Paolo Prete wrote: At this point, is there a way to extend the box by setting four parameters separately: top, bottom, left, right ..., instead of the "padding" one ? Something like: #(make-stencil-boxer 0.1 #paddingLeft #paddingRight #paddingTop #paddingBottom

Re: Drawing boxes around grobs

2020-02-09 Thread Paolo Prete
On Sat, Feb 8, 2020 at 10:36 PM Thomas Morley wrote: > Am Sa., 8. Feb. 2020 um 22:20 Uhr schrieb Paolo Prete < > paolopr...@gmail.com>: > > > > > > > You could redefine box-stencil to take an additional color-argument. > Also stencil-boxer to take an optional color-argument: > > #(define

Re: Drawing boxes around grobs

2020-02-08 Thread Aaron Hill
On 2020-02-08 1:36 pm, Thomas Morley wrote: #(define (box-stencil stencil thickness padding color) "Add a box around @var{stencil}, producing a new stencil." (let* ((x-ext (interval-widen (ly:stencil-extent stencil 0) padding)) (y-ext (interval-widen (ly:stencil-extent stencil 1)

Re: Drawing boxes around grobs

2020-02-08 Thread Thomas Morley
Am Sa., 8. Feb. 2020 um 22:20 Uhr schrieb Paolo Prete : > > > > On Sat, Feb 8, 2020 at 9:06 PM Thomas Morley wrote: >> >> Am Sa., 8. Feb. 2020 um 19:26 Uhr schrieb Paolo Prete : >> > > > > > > >> >> { >> \override TextScript.stencil = >> #(make-stencil-boxer 0.1 0.3 ly:text-interface::print) >>

Re: Drawing boxes around grobs

2020-02-08 Thread Paolo Prete
On Sat, Feb 8, 2020 at 9:06 PM Thomas Morley wrote: > Am Sa., 8. Feb. 2020 um 19:26 Uhr schrieb Paolo Prete < > paolopr...@gmail.com>: > > > > { > \override TextScript.stencil = > #(make-stencil-boxer 0.1 0.3 ly:text-interface::print) > > \override Script.stencil = >

Re: Drawing boxes around grobs

2020-02-08 Thread Thomas Morley
Am Sa., 8. Feb. 2020 um 19:26 Uhr schrieb Paolo Prete : > > Hello, > > The documentation shows this example: > > \override TextScript.stencil = #(make-stencil-boxer 0.1 0.3 > ly:text-interface::print) c'4^"foo" > > (http://lilypond.org/doc/v2.19/Documentation/snippets/tweaks-and-overrides) > > Is

Drawing boxes around grobs

2020-02-08 Thread Paolo Prete
Hello, The documentation shows this example: \override TextScript.stencil = #(make-stencil-boxer 0.1 0.3 ly:text-interface::print) c'4^"foo" (http://lilypond.org/doc/v2.19/Documentation/snippets/tweaks-and-overrides) Is it possible to adapt it for other grobs too? I would like to use it for