Text vert. alignment 3: Access to SimpleText internal pos data

• Oct 20, 2012 - 11:03

Recent changes to SimpleText class have introduced the concept of individual TLine's (text lines) making up the whole text; this looks like a noticeable increase in flexibility, which is of course good.

However, each SimpleText TLine is individually positioned (TLine has its own pos member) according to a variety of factors.

These individual TLine positions are not accessible from outside SimpleText and any other element which has to be positioned in a given relationship with them has no way to know their actual position.

The most obvious examples are melisma lines and inter-syllable dashes for lyrics; there is no way the parent element (in this case, Chord IIRC) can position the lines correctly in a general case if it does not know where SimpleText text snippets are actually positioned.

So, what about adding to SimpleText functions to get (if not set) SimpleText:_text[n].pos data?

Thanks,

M.


Comments

If possible i would like to see the SimpleText() class as an implementation detail of Text() . So no internal information should be used outside of Text. The class is an optimization to overcome some problems of the use of QDocument for even small text snippets.
The right way would be to extend the Text class itself to get needed information and not rely on SimpleText.
The current implementation assumes that all text can be unstyled and then uses the Text() implementation. Styled text is simpler (cannot contain font changes for example) and uses SimpleText.

In reply to by [DELETED] 3

Thanks for the reply.

I think I understand your point. In fact, currently, the position info about individual SimpleText::_text items, being private, is not available even to Text. Possibly they should be promoted to protected.
____________________

As a more general note, I think the improvements on styled texts are one of strong points of the new version (ver 1.2 had styles, but its texts were not really styled in most cases), and the usage of styled texts should be promoted, for the gains in consistency and usability.

Of course, un-styled texts should work as much as possible, but I believe the emphasis should be on styles. Just my two cents, sure, but I presume two somehow grounded cents...

Thanks,

M.

Do you still have an unanswered question? Please log in first to post your question.