-
Notifications
You must be signed in to change notification settings - Fork 45
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
possibility to set interwordspacetext to the actual space dimension of the font #1036
Comments
This should already be possible. Simply use the Indeed, this was one of the primary goals of storing the dimensions as strings rather than dimensions, so that dimensions set in |
Yes, the thing is, I'm not talking about |
hint: using \showthe\numexpr((1000*\numexpr(\dimexpr(\the\fontdimen2\font)))/\numexpr(\dimexpr(1em)))\relax with various fonts, you'll see that you'll obtain different results, a space in libertine in |
Another example (I think these values would make nice defaults): \documentclass[12pt]{book}
\usepackage{geometry}
\geometry{a5paper}
\usepackage{fontspec}
\usepackage{gregoriotex}
\usepackage{libertine}
\begin{document}
\def\GreStar{*}
\gabcsnippet{(c4) Pro(d)phé(ddo>)tæ(c) pre(d)di(f)ca(e)vé(d)runt(dc~) *() na(f)sci(g) Sal(h>)va(g)tó(f_0fg)rem(f_) (,) de(f) Vír(f)gi(g)ne(e) Ma(f)rí(d.)a.(d.) <eu> (::) E(h) u(h) o(g) u(f) a(gh) e(g) </eu>(::)}
\grechangedim{interwordspacetext}{\the\fontdimen2\font plus \dimexpr((\the\fontdimen3\font)*2) minus \the\fontdimen4\font}{scalable}%
\grechangedim{interwordspacetext@euouae}{\dimexpr((\the\fontdimen2\font) * 8 / 10) plus \dimexpr((\the\fontdimen2\font) * 4 / 10) minus \the\fontdimen5\font}{scalable}%
\grechangedim{interwordspacetext@bars@notext}{\the\fontdimen2\font}{scalable}%
\grechangedim{interwordspacetext@bars@notext@euouae}{\dimexpr((\the\fontdimen2\font)*7/10)}{scalable}%
\grecreatedim{interwordspacetext@bars}{\dimexpr((\the\fontdimen2\font)*7/10)}{scalable}%
\grecreatedim{interwordspacetext@bars@euouae}{\dimexpr((\the\fontdimen2\font)*7/10)}{scalable}%
\gabcsnippet{(c4) Pro(d)phé(ddo>)tæ(c) pre(d)di(f)ca(e)vé(d)runt(dc~) *() na(f)sci(g) Sal(h>)va(g)tó(f_0fg)rem(f_) (,) de(f) Vír(f)gi(g)ne(e) Ma(f)rí(d.)a.(d.) <eu> (::) E(h) u(h) o(g) u(f) a(gh) e(g) </eu> (::)}
\noindent \hbox{Prophétæ predicavérunt * nasci Salvatórem de Vírgine María.}
\end{document} the only problem is that these values should be reevaluated if the font changes. I'm not sure about the best way to set these as default for any font... I'm not sure it's achievable easily... |
This smells like a problem of preventing premature expansion of the macros in the dimension. Any luck with |
I didn't really try... I don't have much time to spend on the issue, I'll configure this by hand for the big projects |
I did some testing and it seems that if I define a macro like so: @eroux, do you expect to need to change the staff size after defining a distance in terms of I'll do some more testing tomorrow to try and determine the current limits of what is possible here. |
Thanks a lot for the testing! I don't think it really makes sense to change the staff size in the middle of a document, but in case it doesn't work, it should be documented how to rebuild the distances (maybe just giving their definition again?). Anyway, if it already works that's great! The spaces between words are currently too large, that will make them smaller (maybe a bit too small... we'll see). |
After some further testing this is what I have discovered:
So, given this information, is there a need to make any changes to the code (apart from changing defaults)? I.e. Is there a need for a distance to be scalable with both the font size and the staff size? I have some ideas for how this could be accomplished, but making it a reality would involve totally rewriting the scaling algorithms, so if there is no need for this feature, then I'd prefer not to undertake that process. If the way things are is sufficient, then what sort of documentation of this feature is needed? Perhaps a Tips'n'Tricks page on the website? Or should there be something in GregorioRef? Further, do we want to change the default distances related to text in |
I think it's fine like this, no need to change the code, I don't think there is any case where the distance has to scale with both the staff and the font, so it's perfect that way! Changing the defaults is indeed fine, and documenting the feature in both GregorioRef (this is complex enough to have a small sub*subsection on its own), and gsp-default (in a comment above the first space on which we'll use that) is fine. Thanks a lot for your research! |
The documentation for |
It's important yes, it's linked with #923, the idea is the have the same stretching whatever the enddifference (in one case, the stretching used will be interwordspacetext, in another interwordspacenotes). At least I think so... |
Okay. After looking at bit harder at #923, I'm going to punt on that issue for now and just try to wrap this one up as tightly as possible. It means employing another work around to ensure that the stretch/shrink is the same for Assuming no unexpected test results, I should be able to create the PR for this issue later tonight or tomorrow morning. |
`interwordspacetext` distances are changed to be dependent on the font Instructions are added to GregorioRef for how the above is accomplished so that the user can do the same.
See #1058. |
It would be very useful to be able to set
interwordspacetext
to the actual space dimension of the text font. The dimension is in\fontdimen2\font
, there should be a simple way to map it oninterwordspace
, maybe at the beginning of each score... @rpspringuel would you be interested in looking into this?The text was updated successfully, but these errors were encountered: