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

Symbolic font sizes to percentage mappings #3187

Open
craigsapp opened this issue Dec 30, 2022 · 3 comments
Open

Symbolic font sizes to percentage mappings #3187

craigsapp opened this issue Dec 30, 2022 · 3 comments

Comments

@craigsapp
Copy link
Contributor

Here are the current symbolic fontsize to percentage mappings in include/vrv/attalternates.h

int GetPercentForTerm() const
{
switch (m_term) {
case (FONTSIZETERM_xx_large): return 200; break;
case (FONTSIZETERM_x_large): return 150; break;
case (FONTSIZETERM_large): return 110; break;
case (FONTSIZETERM_larger): return 110; break;
case (FONTSIZETERM_small): return 80; break;
case (FONTSIZETERM_smaller): return 80; break;
case (FONTSIZETERM_x_small): return 60; break;
case (FONTSIZETERM_xx_small): return 50; break;
default: return 100; break;
}
}

FONTSIZETERM_large is too small (110%) and would be better to set to either 120% or 125%.

FONTSIZETERM_large and FONTSIZETERM_larger both are set to 110%. It would be good to leave FONTSIZETERM_larger at 110% so that there is an intermediate size between normal and FONTSIZETERM_large.

Also FONTSIZETERM_small and FONTSIZETERM_smaller are both 80%. I propose changing FONTSIZETERM_smaller to 90%.

Or larger can be larger than large rather than normal, and smaller can be smaller than small rather than normal. (The intended relative sizing is not obvious from their different orderings in the list). It would be better to flip the enumeration order of small/smaller or large/larger to make this clearer.

In the MEI documentation, larger/smaller are relative units rather than absolute, but in verovio they are absolute:

https://music-encoding.org/guidelines/v4/data-types/data.fontsizeterm.html

So I would place in the order from largest to smallest: large, larger, normal, smaller, small so that they are relative to the normal size (and cannot be relative to the current size).

@lpugin
Copy link
Contributor

lpugin commented Dec 30, 2022

FONTSIZETERM_large is too small (110%) and would be better to set to either 120% or 125%.

As far as I remember the values were borrowed from a browser implementation. I will see if i can find where. If you find it two small use x-large ;-)

I agree it would be good to make larger and smaller relative.

@lpugin
Copy link
Contributor

lpugin commented Dec 30, 2022

Maybe we can change to these values https://www.w3.org/TR/css-fonts-4/#absolute-size-mapping

For the two relative size, larger would be 6/5 larger and smaller 8/9 smaller. That means that applying larger to a large font would not be the same size as x-large, but I don't think we can get around it. Any thoughts?

@craigsapp
Copy link
Contributor Author

craigsapp commented Dec 30, 2022

For the two relative size, larger would be 6/5 larger and smaller 8/9 smaller. That means that applying larger to a large font would not be the same size as x-large, but I don't think we can get around it. Any thoughts?

That sounds good. Larger is up a minor third and smaller is down a major second :-)

example.zip

Here are the relative sizes from the above link expressed in percentages of medium:

fontsize ratio percentage musical interval pitch semitones to next
xx-small 3/5 60% -M6 E♭3 4
x-small 3/4 75% -P4 G3 3
small 8/9 89% -m2 B♭3 2
medium 1 100% P1 C4 3
large 6/5 120% m3 E♭4 4
x-large 3/2 150% P5 G4 5
xx-large 2/1 200% P8 C5 12
xxx-large 3/1 300% P15 C6

So a minor-minor 7th chord in first inversion: fontsize-chord.zip

By extension, xxx-small would be 1/2 (50%): down an octave go C4 (three semitones lower than xx-small).

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

No branches or pull requests

2 participants