How to find the position of a format change on a text line


bering.p
 

Hi.
Really no idea?
Best regards.
Paul.

Paul.
Le 08/04/2021 19:57, bering.p a écrit :

Hello.
I come to you to help me find a solution to find the exact position where a format or attribute change occurs on a line of text.
I did this by looping through the characters in the line and using getFormatField for each character, but it takes a long time if the line of text is too long.
Can you think of a faster solution?
How  can we know the position of a field return by getFormatField ?
Thank you.
Best regards.
Paul.
-- 

Paul.


Tony Malykh
 

On 4/11/2021 1:11 PM, bering.p wrote:
Hi.
Really no idea?
Best regards.
Paul.

Paul.
Le 08/04/2021 19:57, bering.p a écrit :
Hello.
I come to you to help me find a solution to find the exact position where a format or attribute change occurs on a line of text.
I did this by looping through the characters in the line and using getFormatField for each character, but it takes a long time if the line of text is too long.
Can you think of a faster solution?
How  can we know the position of a field return by getFormatField ?
Thank you.
Best regards.
Paul.
-- 

Paul.


bering.p
 

Hi.
Thanks Tony for your reply.
I will study this.
I really appreciate what you do and especially the way you program.
Best regards.
Paul.
Le 12/04/2021 01:21, Tony Malykh a écrit :

Look at def findFormatChange() in https://github.com/mltony/nvda-browser-nav/blob/master/addon/globalPlugins/browserNav.py


On 4/11/2021 1:11 PM, bering.p wrote:
Hi.
Really no idea?
Best regards.
Paul.

Paul.
Le 08/04/2021 19:57, bering.p a écrit :
Hello.
I come to you to help me find a solution to find the exact position where a format or attribute change occurs on a line of text.
I did this by looping through the characters in the line and using getFormatField for each character, but it takes a long time if the line of text is too long.
Can you think of a faster solution?
How  can we know the position of a field return by getFormatField ?
Thank you.
Best regards.
Paul.
-- 

Paul.