grame-cncm / guidolib

Guido project - music score layout engine - music description language
http://guido.grame.fr
Mozilla Public License 2.0
155 stars 35 forks source link

8va cause text overlap #44

Open yurivict opened 7 years ago

yurivict commented 7 years ago

This code [ h2/4 \oct<+2> c2 e/2 \oct<0> e1/2] renders with overlap:

8va

arshiacont commented 7 years ago

+1

yurivict commented 7 years ago

Also, maybe I am mistaken, but isn't is supposed to also print 8va?

arshiacont commented 7 years ago

No since you are asking for \oct<2>. 8va would be oct<1>

yurivict commented 7 years ago

\oct<1> prints 8, not 8va.

arshiacont commented 7 years ago

8 or 8va is fine and equivalent to oct<1>. I am not an expert! Just know that '8' is fine but 8va is more common. Oct<2> should give 15va. In this link, the three measures are thus equivalent: https://en.m.wikipedia.org/wiki/File:Ottava_Ex.png

This said, the rendering overlap you mention should be avoided! I think it's a minor bug that Dominique can get rid of quickly... .

dfober commented 7 years ago

The problem is that I can't reproduce. Please, give details about the OS and guidolib version. Regarding the 8 or 8va display, that is easy to change and could be also an option (i.e. a tag parameter).

yurivict commented 7 years ago

OS is FreeBSD 11.1-STABLE. guidolib 76489e5

dfober commented 7 years ago

Sorry but I can't reproduce (tested on MacOS, Windows 10 and Debian 8). I don't have any station installed with FreeBSD. Regarding the 8 and/or 8va, I'll check what the notation gurus say about that (notably Gould) but for the moment I'm away from my desktop. Next week...

yurivict commented 7 years ago

Sorry but I can't reproduce (tested on MacOS, Windows 10 and Debian 8). I don't have any station installed with FreeBSD.

Might be because of font differences?

dfober commented 7 years ago

might be ! I'll check how the metrics are collected.

dfober commented 7 years ago

I've changed the metrics. Tell me if it solves the problem on your side.

yurivict commented 7 years ago

I've changed the metrics. Tell me if it solves the problem on your side.

Still a problem, it overlaps even more.

dfober commented 7 years ago

strange (that it overlaps more), actually the text height is collected by the GROctava constructor: GROctava::GROctava fTextHeight: 83 could you check what you get?

yurivict commented 7 years ago

I added this line in the end of GROctava::GROctava: printf("fTextHeight=%f (fText=%s)\n", fTextHeight, fText.c_str());

It printed:

fTextHeight=51.000000 (fText=8)
fTextHeight=0.000000 (fText=)
dfober commented 7 years ago

The first line should correspond to \oct<1> and the second one to \oct<0> and all that looks normal. Could you manually force the fTextHeight value (e.g. to 100). If that solves the issue, it means that the problem comes from the font management (I guess you're using the Cairo device).

yurivict commented 7 years ago

With fTextHeight=100., the leftmost hyphen is over "15". I use guido2svg.

dfober commented 7 years ago

ok, I didn't checked with the svg device. Now I can reproduce.

dfober commented 7 years ago

First point: you can set the INDEPENDENTSVG cmake option to yes: it solves the problem. The default is no and in this case, the svg device uses Cairo to compute font extents and it looks like something is going wrong in this context. I'm investigating...