0xfe/vexflow — pull request #233 by Silverwolf90 (2014-06-02 21:18:36+00:00)
Title: Implement key signature cancellation

**Previous Key is Cb**
![image](https://cloud.githubusercontent.com/assets/1631625/3153256/46275092-ea99-11e3-967a-d4b234304126.png)
**Previous Key is C#**
![image](https://cloud.githubusercontent.com/assets/1631625/3153262/542af2f2-ea99-11e3-97cc-d1d08a99345f.png)
**Previous Key is C#**
![image](https://cloud.githubusercontent.com/assets/1631625/3153268/5d607644-ea99-11e3-9d7e-9abebb7a966e.png)
**Previous Key is Cb**
![image](https://cloud.githubusercontent.com/assets/1631625/3153274/67820f98-ea99-11e3-80bd-2dba145ed6da.png)

This isn't totally complete. The main issue right now is lines 27-54 in `KeySignature.addAccToStave()`. In order to position the glyph combinations in an aesthetically pleasing way, there's some fine-tuning that has to be applied depending on the next accidental glyph and whether it's above/below the current accidental glyph. Right now it's all hard-coded but should be moved somewhere else. Where should we keep this data? Is this data worth storing in `Vex.Flow.accidentalCodes`? Or make it private data within the `KeySignature` module?

I had to make a change to `glyph.js`. Typically, the glyph width can be found via the `.getMetrics()` which would calculate the width based on `x` coordinates. This gave you an exact width of the glyph, but did not provide any spacing if you wanted it. And the combining of different glyphs in a key signature requires spacing. So I added a `setWidth()` method which essentially overrides the calculated width in `getMetrics()` and allows us to set custom widths for a glyph.

Additionally, I refactored `KeySignature` and `Vex.Flow.keySignature()` to use the accidental codes instead of glyph codes.