This patch gives better control on lyrics dash management and it is intended to supersede https://github.com/musescore/MuseScore/pull/2213 which did not suit the taste of several forum users; for a discussion, see https://musescore.org/en/node/76021 .
Adds 3 new score style parameters:
- `lyricsDashMinLength` to control the minimum dash length (default: 0.4sp)
- `lyricsDashMaxLength` to control the maximum dash length (default: 0.8sp)
- `lyricsDashForce`: if set to __true__, a dash is always generated between two syllables of a word and, if there is not enough space for the min dash length, more space is added between the syllables to accommodate it; if set to __false__, no extra space is added and the two syllables are joined together (default: true)
The effect of the last parameter is exemplified by the following screen-shots:
Current situation (before this patch); if there is no room for the min dash length, the dash is skipped and some blank is left between syllables:
Patch with `lyricsDashForce = true`; chords are further spaced and a min-length dash is inserted:
Patch with `lyricsDashForce = false`: the second syllable is moved (slightly) to the left to reclaim the blank:
If a section break occurs on a non-measure MeasureBase object such as a vertical or horizontal frame, then the courtesy key or time signature should still not be displayed in the final actual measure of the section.
Previously, during Score::layoutSystem() the very first measure was not actually added to the system until after minWidth2() performed its calculation, resulting in Clef::layout() incorrectly determining that a courtesy clef should be added to all single-measure systems ending with a section break. This is because teh showClef calculation in Clef::layout would evaluate (meas->system() && meas != meas->system()->lastMeasure()) to be true since meas->system()->lastMeasure() would be null at the time of executing minWidth2() for the first measure to be added to the system.
This fix first appends the initial measure of a system during Score::layoutSystem() before performing the minWidth2() calculation. This ensures that Clef::layout() doesn't have an empty meas->system().
In order to accommodate the appending of the first measure earlier in the code, I first make sure to grab the state of system->measures().isEmpty() at the top of the loop, before possibly appending the first measure. This ensures that will not break out of loop when performing calculation if (systemWasNotEmpty && (minWidth + ww > systemWidth)).
Also need to keep track of the value of isFirstMeasure until lower in the loop so can only append measure if did not already append measure
added test clef_courtesy03.mscx which has a single measure section m1. When add clef to m2, should not display courtesy clef at end of m1, because courtesy clefs should not be displayed at end of a section.