[smufl-discuss] Re: Notehead Metrics

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[smufl-discuss] Re: Notehead Metrics

Joseph Berkovitz
Hi Glenn,

> If it is that sort of thing, it may explain some of the problems with other scalable font and vector drawings that I have seen, both in music and other complex diagramming... it looks good at one size, but when scaled significantly, it falls apart... lines separate or overlap or protrude, and similar effects.  Perhaps stroke width is a bad simplifying assumption... perhaps lines should be filled rectangles, rather than strokes. This would, of course, approximately double the work to draw a line, as it would need twice the control points. Similarly for other curves. But it would force people to be more concerned about the edges than the central part of a line/curve.

I strongly recommend that developers use filled rectangles to draw stems, not stroked lines. Stroked lines are not so predictable in the way the line ends are drawn, or in the exact position of their bounding boxes. Also, the actual stem width in a notation application could depart from the metadata-given value if the user chooses to customize this value. Using an SW anchor would not accommodate this flexibility.

Taking this approach I see no visible problem with using the SE anchor and calculating the other points. Here’s the code I’m using in my tests (3.5 is just a hardcoded arbitrary stem height):

          case 'stemUpSE':
            anchor = createElement('rect');
            anchor.setAttribute('class', 'anchor');
            anchor.setAttribute('x', ax - v(metadata.engravingDefaults.stemThickness));
            anchor.setAttribute('y', ay - v(3.5));
            anchor.setAttribute('width', v(metadata.engravingDefaults.stemThickness));
            anchor.setAttribute('height', v(3.5));
            glyphs.append(anchor);
            break;

I wouldn’t say that it takes “twice the work” to draw a rectangle as opposed to the line — it takes a few more lines of code, but you’ll get more exact results in return, and the computer’s doing the same work underneath.

.            .       .    .  . ...Joe

Joe Berkovitz
President

Noteflight LLC
Boston, Mass.
phone: +1 978 314 6271
www.noteflight.com
"Your music, everywhere"


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>