neanes / neanes

Neanes is a free and open source scorewriter for notating Byzantine chant in Byzantine notation.
https://neanes.github.io/neanes/
GNU General Public License v3.0
35 stars 9 forks source link

Issue with melisma in certain fonts #643

Closed PsaltyDog closed 3 weeks ago

PsaltyDog commented 3 weeks ago

I was looking through my font library today to see if I could find a font that gelled well with the newly-compatible Stathis neume font, and I noticed that many fonts have a stylised underscore, which effectively prevents them from being used for setting english-language texts in Neanes, since a line of underscores in these fonts results in a broken or uneven line.

For example, here's Alegreya —

Screenshot 2024-04-21 at 13 35 06

And a more extreme example, Andada Pro —

Screenshot 2024-04-21 at 13 36 26

Is there an alternative method to accomplish this? Perhaps by taking the underscore character from the default Source Serif regardless of the font selected?

basil commented 3 weeks ago

Underscore is the wrong character here, as it is too low—lyric extender lines should be drawn at the font's baseline, while underscores are drawn below the baseline.

danielgarthur commented 3 weeks ago

Yes, this is more complicated than it sounds. The baseline and ascent/descent of the underscore of Source Serif will often not match that of other fonts, so simply switching the font of the underscore to Source Serif will often result in an unacceptably bad alignment.

Two options that I see:

  1. Switch to using CSS border-bottom instead of underscores. I think it would be easier to align, but I seem to recall issues in the past with this. But I'll look into it again.
  2. Use TextMetrics to calculate the offset needed to align the Source Serif underscore with the baseline of the lyrics text. I'm not sure the correct math or whether it's actually possible. But I believe I used underscores because they look better than border-bottom, so this would be the preferred option.
basil commented 3 weeks ago

I used underscores because they look better

I fail to see how underscores look better. On the contrary, they have two problems: they are too low (below the baseline of the font), violating established notational conventions; and they are of a width that does not enable accurate measurement (prompting Papa Ephraim to develop a half-width underscore in his EZ Omega font).

basil commented 3 weeks ago

Many thanks; this is a huge improvement to the typesetting quality of the software. On my Linux system, the lyric extender lines look a bit too high in the GUI (slightly above the alphabetic baseline), but when rendered to PDF or printed everything looks perfect, with the lyric extender lines beginning right at the alphabetic baseline.