Skip to content
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

Long chordnames are cut off #4

Closed
rluetzner opened this issue Mar 30, 2023 · 1 comment
Closed

Long chordnames are cut off #4

rluetzner opened this issue Mar 30, 2023 · 1 comment
Assignees

Comments

@rluetzner
Copy link
Owner

Here's an example for F#13b9 (on size 2):
image

It's even worse on size 1:
image

I think ideally, size should refer to the fretboard and give an upper limit for the font size. If the text is too long however, it should shrink to fit neatly on top of the fretboard.

@rluetzner rluetzner self-assigned this Mar 30, 2023
@rluetzner
Copy link
Owner Author

I've noticed a few things.

  1. Neither the chord name, nor the chord box are centered within the image.
  2. The image width is calculated without taking the length of the chord name into account.
  3. Size '1' behaves differently compared to 2-10. While the latter only scale up the image, the font sizes are arbitrarily increased for size '1'. Most likely, because the text would otherwise be really hard to read, but that explains why the behavior is amplified for size '1'.

rluetzner added a commit that referenced this issue Apr 1, 2023
The issue reported by Kendall is caused by multiple interferring
calculations.

First of all, the image width is mainly determined by the chord box and
**not** by the chord name, even though the latter can be much longer /
wider. This is solved by resizing the image. The solution is not ideal
and produces some redundant code. The main issue is that we have to
initialize a Graphics instance first to measure the string. But to
initialize the Graphics, we need a Bitmap instance of a certain width.

Another problem I noticed is that neither the chord box, nor the chord
name were properly centered. The widths of both are calculated, but
until now they weren't used to place the elements properly. This is now
fixed so that no matter the final width of the image, the chord box and
name stay nicely centered. I'll run this by Kendall to make sure that
centering the text is what he would expect as well.

This relates to #4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant