MakeMusic
SmartMusic Finale Garritan MusicXML

SVG vs. CSS

Moderator: Michael Good

SVG vs. CSS

Postby Paul Mindrup » Fri Aug 23, 2002 11:04 am

I never learned CSS very well - could someone summarize what SVG has that CSS doesn't that makes it a compelling choice for music notation?



Paul
Paul Mindrup
 
Posts: 16
Joined: March, 2014
Reputation: 0

RE: SVG vs. CSS

Postby Michael Good » Fri Aug 23, 2002 7:55 pm

Hi Paul,

SVG is a vector graphics format that includes text. So in theory it should be sufficient for rendering music notation.

CSS is a text-oriented stylesheet. I suspect one could do some notation using CSS and music fonts, but it doesn't seem so appropriate for slurs, crescendos, and other types of graphics that appear in music notation. But I'd be happy to hear different points of view!

Regards, Michael
Michael Good
VP of MusicXML Technologies
MakeMusic, Inc.
User avatar
Michael Good
 
Posts: 2197
Joined: March, 2014
Reputation: 0

RE: SVG vs. CSS

Postby Brian Grainger » Fri Aug 23, 2002 9:33 pm

Michael Good wrote:CSS is a text-oriented stylesheet. I suspect one could do some notation using CSS and music fonts, but it doesn't seem so appropriate for slurs, crescendos, and other types of graphics that appear in music notation. But I'd be happy to hear different points of view!

CSS applies style attributes to HTML or XML elements which have either a defined class, or a defined class plus id. So, in SVG you could have a <text class="myText">foo</text> and your stylesheet would refer to this piece of text like

text.myText
{ font-family: Maestro;
}

You couldn't however indicate specific musical glyphs with a stylesheet, only the font package which contained them, because the XML parser in the SVG renderer interprets 'foo' not as a series of actual characters, but as a series of indexes into the current font.

Regards, Brian
Brian Grainger
 
Posts: 111
Joined: March, 2014
Reputation: 0

RE: SVG vs. CSS

Postby Paul Mindrup » Mon Aug 26, 2002 5:30 pm

Well, you could use XSLT to transform the input and output the glyphs you want...

The only reason I'm bringing this up is that everyone's got a browser and not everyone has an SVG viewer.


Paul


Brian Grainger wrote:
Michael Good wrote:CSS is a text-oriented stylesheet. I suspect one could do some notation using CSS and music fonts, but it doesn't seem so appropriate for slurs, crescendos, and other types of graphics that appear in music notation. But I'd be happy to hear different points of view!

CSS applies style attributes to HTML or XML elements which have either a defined class, or a defined class plus id. So, in SVG you could have a <text class="myText">foo</text> and your stylesheet would refer to this piece of text like

text.myText
{ font-family: Maestro;
}

You couldn't however indicate specific musical glyphs with a stylesheet, only the font package which contained them, because the XML parser in the SVG renderer interprets 'foo' not as a series of actual characters, but as a series of indexes into the current font.

Regards, Brian
Paul Mindrup
 
Posts: 16
Joined: March, 2014
Reputation: 0

RE: SVG vs. CSS

Postby Brian Grainger » Mon Aug 26, 2002 8:23 pm

Paul Mindrup wrote:The only reason I'm bringing this up is that everyone's got a browser and not everyone has an SVG viewer.

True enough, but you're still faced with the problem of having to create different sets of character entity references in your stylesheet, depending on whichever musical font the user happens to have installed on their system.

There is no browser property which can be accessed by client scripts to determine the installed fonts, so before the web server sent a page to someone, there would have to be a question and answer page asking the user to indicate which musical font they were using as the default. Then you would have to hope that you had a stylesheet to match that font so that your XSLT processor could emit the correct glyph indexes for symbols you wanted to use.

For example, if a quarter note was at index 25 in font A, but at index 29 in font B, your stylesheet would have to account for this, so you end up with two different stylesheets, and hoping that the user replies accurately as to whether they're using A or B.

It's a whole lot of headache which could be solved with fonts which followed the Unicode 3.1 standard. I'm not holding my breath.

Regards, Brian
Brian Grainger
 
Posts: 111
Joined: March, 2014
Reputation: 0

Who is online

Users browsing this forum: No registered users and 2 guests