frmatthew / exsurge

A JavaScript library for rendering Gregorian Chant in square note notation
MIT License
54 stars 13 forks source link

Fix SVG text measuring system #4

Open frmatthew opened 8 years ago

frmatthew commented 8 years ago

The ChantContext currently inserts a node into the DOM to use for measuring SVG text. This is awkward since multiple contexts would create the same DOM node; also since it might mess with presentation. Need to create a better process for measuring text. Could explore:

bbloomf commented 8 years ago

Just noticed a project called Font.js, and then one called OpenType.js (which was referenced by Font.js as being a newer and better alternative). It looks like OpenType.js can measure text without using an SVG node, so it may be useful for this. It may also replace the need for the canvas text measuring strategy if it matches the speed.