Right aligning text

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Right aligning text

SimonNathan
Hi all,

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

Thanks hugely!

Simon



_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

rightalignSS.png (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Dave Foster
Hi Simon,

I've written a page turn warning plugin in the past, so encounter the same problem. The solution (bodge?) is to cheat and use a factory text style that is right aligned to start with, such as "Figured Bass". This avoids the need for a dedicated text style, that you would otherwise have to grab from another file if it's not guaranteed to be available in the current one. I guess this means that it's likely to work on the majority of systems and within most house styles? You can then use the text formatting tokens to get it to the font and size that you need. Below is the line from my plugin that creates the text:

open = Chr(123);
close = Chr(125);
multi = 8; // You need to work out what this number is!
text = processbar.AddText(processbar.Length, "\\fOpusText\\\\s180\\" & open & "\\fITC Century{Bold Condensed}\\" & multi & "\\fOpusText\\" & close, "text.staff.space.figuredbass");

where 'open' and 'close' are the text characters for the left and right multirest symbols in OpusText, so this creates a false multirest at the end of the page.

Hope this helps!

Cheers,

Dave

 
On 25 Jul 2018, at 23:11, Simon Nathan <[hidden email]> wrote:

Hi all,

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

Thanks hugely!

Simon


<rightalignSS.png>_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Bob Zawalich-3
In reply to this post by SimonNathan

There is really no good way to do this in a plugin.

 

For text, a user, but not a plugin,  can create  right aligned text styles, and from then right aligned text objects.

 

If you have access to a right aligned text style, either from a  House Style or from another score where such styles are defined, then you can create a text object in that style at your location of choice. Getting the style is the tricky part.

 

What I did recently for someone who wanted right aligned text objects aligned to the barline was to write the plugin Paste to End of Bar, and had the user create a right-aligned text style and create a text object with that style, then cut the object to the clipboard and run my plugin, which calls PasteToPosition to paste to the (bar.Length – 1).

 

I could have written a plugin to write a text object to the end of a bar but it would have needed to get access to the right-aligned text styles, which is possible but messy (see, for example, Colored Notehead Styles).

 

I included a Sib score that included text objects with right-aligned styles that would be installed as a Manuscript Paper, so you could new a score, copy a text into your score, then delete the text object, which you leave it text style defined.

 

This all because you can’t create a text style in a plugin and Import House Style often has many undesired side effects.

 

A plugin cannot do this without a right-aligned text style. It cannot determine the actual width of an object like Text or Lines. You can make a weak guess for text by using the number of characters. You can use a rhythmic position to start an object, then change the Dx values to shift it to the left, but you will likely never get it right because the width of a bar is known only in rhythmic units and all we have to work with is units of spaces. Bars can change width after formatting, and your carefully placed objects will shift.

 

If someone has a better way to do this I would love to know it, but I have never gotten any kind of good general results by doing this sort of thing.

 

Bob

 

From: Plugin-dev <[hidden email]> On Behalf Of Simon Nathan
Sent: Wednesday, July 25, 2018 3:12 PM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: [Plugin-dev] Right aligning text

 

Hi all,

 

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

 

Thanks hugely!

 

Simon

 

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

SimonNathan
Thank you Bob and Dave for the insight and suggestions! I think it's a nice idea to use figured bass - that seems to be the best bodge at the moment! Thanks for your help both!

Simon

On Thu, Jul 26, 2018 at 12:11 AM, Bob Zawalich <[hidden email]> wrote:

There is really no good way to do this in a plugin.

 

For text, a user, but not a plugin,  can create  right aligned text styles, and from then right aligned text objects.

 

If you have access to a right aligned text style, either from a  House Style or from another score where such styles are defined, then you can create a text object in that style at your location of choice. Getting the style is the tricky part.

 

What I did recently for someone who wanted right aligned text objects aligned to the barline was to write the plugin Paste to End of Bar, and had the user create a right-aligned text style and create a text object with that style, then cut the object to the clipboard and run my plugin, which calls PasteToPosition to paste to the (bar.Length – 1).

 

I could have written a plugin to write a text object to the end of a bar but it would have needed to get access to the right-aligned text styles, which is possible but messy (see, for example, Colored Notehead Styles).

 

I included a Sib score that included text objects with right-aligned styles that would be installed as a Manuscript Paper, so you could new a score, copy a text into your score, then delete the text object, which you leave it text style defined.

 

This all because you can’t create a text style in a plugin and Import House Style often has many undesired side effects.

 

A plugin cannot do this without a right-aligned text style. It cannot determine the actual width of an object like Text or Lines. You can make a weak guess for text by using the number of characters. You can use a rhythmic position to start an object, then change the Dx values to shift it to the left, but you will likely never get it right because the width of a bar is known only in rhythmic units and all we have to work with is units of spaces. Bars can change width after formatting, and your carefully placed objects will shift.

 

If someone has a better way to do this I would love to know it, but I have never gotten any kind of good general results by doing this sort of thing.

 

Bob

 

From: Plugin-dev <[hidden email]> On Behalf Of Simon Nathan
Sent: Wednesday, July 25, 2018 3:12 PM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: [Plugin-dev] Right aligning text

 

Hi all,

 

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

 

Thanks hugely!

 

Simon

 

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com



_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Bob Zawalich-3
I did not see the suggestion about using Figured Bass. Was it sent to the list? If not could you please explain how it is used?

Bob

On Jul 26, 2018, at 12:47 AM, Simon Nathan <[hidden email]> wrote:

Thank you Bob and Dave for the insight and suggestions! I think it's a nice idea to use figured bass - that seems to be the best bodge at the moment! Thanks for your help both!

Simon

On Thu, Jul 26, 2018 at 12:11 AM, Bob Zawalich <[hidden email]> wrote:

There is really no good way to do this in a plugin.

 

For text, a user, but not a plugin,  can create  right aligned text styles, and from then right aligned text objects.

 

If you have access to a right aligned text style, either from a  House Style or from another score where such styles are defined, then you can create a text object in that style at your location of choice. Getting the style is the tricky part.

 

What I did recently for someone who wanted right aligned text objects aligned to the barline was to write the plugin Paste to End of Bar, and had the user create a right-aligned text style and create a text object with that style, then cut the object to the clipboard and run my plugin, which calls PasteToPosition to paste to the (bar.Length – 1).

 

I could have written a plugin to write a text object to the end of a bar but it would have needed to get access to the right-aligned text styles, which is possible but messy (see, for example, Colored Notehead Styles).

 

I included a Sib score that included text objects with right-aligned styles that would be installed as a Manuscript Paper, so you could new a score, copy a text into your score, then delete the text object, which you leave it text style defined.

 

This all because you can’t create a text style in a plugin and Import House Style often has many undesired side effects.

 

A plugin cannot do this without a right-aligned text style. It cannot determine the actual width of an object like Text or Lines. You can make a weak guess for text by using the number of characters. You can use a rhythmic position to start an object, then change the Dx values to shift it to the left, but you will likely never get it right because the width of a bar is known only in rhythmic units and all we have to work with is units of spaces. Bars can change width after formatting, and your carefully placed objects will shift.

 

If someone has a better way to do this I would love to know it, but I have never gotten any kind of good general results by doing this sort of thing.

 

Bob

 

From: Plugin-dev <[hidden email]> On Behalf Of Simon Nathan
Sent: Wednesday, July 25, 2018 3:12 PM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: [Plugin-dev] Right aligning text

 

Hi all,

 

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

 

Thanks hugely!

 

Simon

 

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Bob Zawalich-3
In reply to this post by Dave Foster
Thanks Dave,
I have been looking for built-in staff text styles that are that right aligned and had not found any. Repeat text is a right-aligned System Text style. Do you know any others?  I started going through the styles one by one but that was too tedious.

If you change the font and dy/ XX values be aware that if anyone does reset design or reset position later those changes can be lost. This is not such a problem if you are using it in house only but I was trying to be general purpose and avoid those issues. Still, I will recommend using figured bass with Paste to End of Bar as a quick workaround. It is hard to find good built in styles for things like right aligned or below the staff. Sometimes all you can do is fake it. 


Bob

On Jul 26, 2018, at 9:47 AM, Dave Foster <[hidden email]> wrote:

Hi Bob,

Not sure why the message didn't make it to you - I know I've missed a few things on this list over the last few months, maybe it's the heat?!

Anyway, here was my response, which was along the same lines as what you came back with, but not nearly as well put or complete!

Cheers,

Dave

On 25 Jul 2018, at 23:33, Dave Foster <[hidden email]> wrote:

Hi Simon,

I've written a page turn warning plugin in the past, so encountered the same problem. The solution (bodge?) is to cheat and use a factory text style that is right aligned to start with, such as "Figured Bass". This avoids the need for a dedicated text style, that you would otherwise have to grab from another file if it's not guaranteed to be available in the current one. I guess this means that it's likely to work on the majority of systems and within most house styles? You can then use the text formatting tokens to get it to the font and size that you need. Below is the line from my plugin that creates the text:

open = Chr(123);
close = Chr(125);
multi = 8; // You need to work out what this number is!
text = processbar.AddText(processbar.Length, "\\fOpusText\\\\s180\\" & open & "\\fITC Century{Bold Condensed}\\" & multi & "\\fOpusText\\" & close, "text.staff.space.figuredbass");

where 'open' and 'close' are the text characters for the left and right multirest symbols in OpusText, so this creates a false multirest at the end of the page.

Hope this helps!

Cheers,

Dave

 
On 25 Jul 2018, at 23:11, Simon Nathan <[hidden email]> wrote:

Hi all,

Is there any way to reliably create a text object in ManuScript that is right-aligned to its anchor? 

I'd like to be able to create a text object that behaves like in the attached picture (note the position of the anchor)

Thanks hugely!

Simon


<rightalignSS.png>_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com



_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Bob Zawalich-3
In reply to this post by SimonNathan

And just for completeness,

 

I just went through all the shipping text styles, and the only Staff text style that is right aligned is Figured Bass.

 

These system text styles are right aligned:

 

* Duration at End of Score

*Instrument Name

* Repeat (DS/DC...)

 

By default Figured Bass uses the font Opus Figured Bass Std, so you will likely always need to change the font and font size, as Dave does in his example, to use this for general-purpose right-aligned text.

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

SimonNathan
You are amazing Bob. At least there is one!!

On Thu, Jul 26, 2018 at 10:34 PM, Bob Zawalich <[hidden email]> wrote:

And just for completeness,

 

I just went through all the shipping text styles, and the only Staff text style that is right aligned is Figured Bass.

 

These system text styles are right aligned:

 

* Duration at End of Score

*Instrument Name

* Repeat (DS/DC...)

 

By default Figured Bass uses the font Opus Figured Bass Std, so you will likely always need to change the font and font size, as Dave does in his example, to use this for general-purpose right-aligned text.

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com



_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Right aligning text

Bob Zawalich-3
In this case not amazing, just persistent. A lot of times you can spend an hour digging through boring stuff and then you have the answer so it is an hour well spent!

Bob

On Jul 27, 2018, at 12:59 AM, Simon Nathan <[hidden email]> wrote:

You are amazing Bob. At least there is one!!

On Thu, Jul 26, 2018 at 10:34 PM, Bob Zawalich <[hidden email]> wrote:

And just for completeness,

 

I just went through all the shipping text styles, and the only Staff text style that is right aligned is Figured Bass.

 

These system text styles are right aligned:

 

* Duration at End of Score

*Instrument Name

* Repeat (DS/DC...)

 

By default Figured Bass uses the font Opus Figured Bass Std, so you will likely always need to change the font and font size, as Dave does in his example, to use this for general-purpose right-aligned text.

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com