[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
improving whiteout
From: |
Karol Majewski |
Subject: |
improving whiteout |
Date: |
Wed, 16 Oct 2013 23:44:12 +0200 |
Here's another example of an ugly output (whiteout.png)
\override DynamicText.whiteout = ##t
Something has to be done to prevent situations like this.
As a workaround I use this solution:
------begin------
#(define-public
(stencil-with-color stencil color)
(ly:make-stencil
(list 'color color
(ly:stencil-expr stencil))
(ly:stencil-extent stencil X)
(ly:stencil-extent stencil Y)))
#(define
(stencil-padded-whiteout stencil padding)
(let*
((x-ext
(ly:stencil-extent stencil X))
(y-ext
(ly:stencil-extent stencil Y)))
(ly:stencil-add
(stencil-with-color
(ly:round-filled-box
(interval-widen x-ext padding)
(interval-widen y-ext padding) 0) white) stencil)))
#(define
(text-in-white-box grob)
(stencil-padded-whiteout
(ly:text-interface::print grob) 0.2))
\layout {
\context {
\Score
\override DynamicText.stencil = #text-in-white-box
}
}
-------end-------
This code does the job, but i'm not sure if it has any drawbacks. Any thoughts?
-Karol
whiteout.png
Description: PNG image
- improving whiteout,
Karol Majewski <=