Is it possible to get bounds for tempo and time signature? #1127
-
I'm trying to highlight tempo and time signature on the score. I didn't find anything in bounds lookup that would help. Right now I am just checking the HTML elements to find if there is a pattern of tempo and time signature elements, so I can work with them. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, this is unfortunately currently not possible out of the box. There is no API which would allow you to request the bounding box of certain elements. Technically it would be possible to add such an API (e.g. for highlighting or annotation purposes). I added an item to the roadmap as potential future feature: https://github.com/orgs/CoderLine/projects/12?pane=issue&itemId=23947500 If you are using SVG output, you could rely on certain patterns to get the bounding box. alphaTab is using https://www.smufl.org/ for rendering which means all symbols have this this pattern with the SMuFL character codes as text: https://github.com/CoderLine/alphaTab/blob/develop/src/platform/svg/CssFontSvgCanvas.ts#L42-L62 Tempo glyphs have a single Time Signatures might be a bit more tricky because it can consist of multiple items. https://github.com/CoderLine/alphaTab/blob/develop/src/rendering/glyphs/TimeSignatureGlyph.ts You would need to group them accordingly which can be tricky. The tricky part about such a feature would be to be explicit enough on what items you are actually interested into. A single item in the data model (e.g. tempo change or vibrato) can be represented by multiple elements on the displayed music sheet across different staves and additional annotations. |
Beta Was this translation helpful? Give feedback.
No, this is unfortunately currently not possible out of the box. There is no API which would allow you to request the bounding box of certain elements. Technically it would be possible to add such an API (e.g. for highlighting or annotation purposes). I added an item to the roadmap as potential future feature: https://github.com/orgs/CoderLine/projects/12?pane=issue&itemId=23947500
If you are using SVG output, you could rely on certain patterns to get the bounding box. alphaTab is using https://www.smufl.org/ for rendering which means all symbols have this this pattern with the SMuFL character codes as text:
https://github.com/CoderLine/alphaTab/blob/develop/src/platform/svg/CssFontSvgCan…