-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re-introduce font-specific formatting to chord symbol metrics #1569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronDavidNewman is it working? don't you need the following change in chordsymbol?
- const glyphPoints = 20;
- symbolBlock.glyph = new Glyph(glyphArgs.code, glyphPoints, { category: 'chordSymbol' });
+ const glyphPoints = 20 * metrics.scale;
+ symbolBlock.glyph = new Glyph(glyphArgs.code, glyphPoints,);
Wow, you're right. But it does seem to be working, weirdly. The key difference is the size of the sharp. If I add my changes to the master branch, and remove them, the size follows the change. It is not working in the sense that change the scale does not actually change the rendered glyph. But the scale of some glyphs is definitely changing. I don't really understand it, I'll have to dig in. There seems to be some type of side-effect going on. |
@AaronDavidNewman I think that the scale is not working. The differences come from the other parameters. The size is the same. |
I've changed my mind about scaling the individual glyphs. I think the music fonts were made with the glyphs sized relative to each other intentionally, either for readability or effect. So if the left and right parens aren't the same size (like they aren't in Petaluma), it's something we should just accept when we're using that font. The other metrics are different though, because they are needed for formatting. The common metrics only work because most of the fonts are similar enough to Bravura, but they won't work for Petaluma. Also they could be embedded in the fonts themselves so in theory we wouldn't need font-specific formatting, it would just be part of the font package. So anyway, long winded way of saying this is ready for review. |
const petalumaChordMetrics: Record<string, ChordSymbolGlyphMetrics> = { | ||
csymDiminished: { | ||
leftSideBearing: -95, | ||
advanceWidth: 506, | ||
yOffset: 0, | ||
}, | ||
csymHalfDiminished: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvilarl is this approach OK with you?
Before, we had a separate metrics file for the petaluma font.
With this PR, it is hard-coded into the load_petaluma.ts file.
I guess this can serve as a way to illustrate how we can customize metrics even though those files no longer exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine with me for vexflow4.
Only one comment. If we do not use the scales why do we leave them? |
FYI in Vexflow5 I found specific glyphs for the accidental |
It was an oversight. I removed it from common metrics. |
These are the minimal changes to add chord symbol metrics and have custom for Petaluma.