coloring of a chunk - strange stutter

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

coloring of a chunk - strange stutter

Post by okk » Thu Jan 28, 2016 5:45 pm

Hi, I am working on a karaoke software for speeches. When coloring chars of a word from black to red - to indicate the speed of the original speaker - the text shows some strange stutter. I made a screen recording to demonstrate the effect: https://vimeo.com/153386437 Look around 4 seconds into the video: "HURLBUT: Yes, I am."

The code that does the coloring looks like this:

Code: Select all

set the foregroundcolor of char charcounter of word wordcounter of line 1+lineshift of cd fld "subtitles" to "red"
This effect was introduced when moving from LC6.1. to 6.5. and I see it in the LC versions above 6.5. Any hints what could be the cause of this behavior?

Best
Oliver

(And sorry for the profanity. It's a speech that I am subtitling at the moment. Christian Bale freaks out at the set of Terminator.)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: coloring of a chunk - strange stutter

Post by bn » Fri Jan 29, 2016 12:16 am

Hi Oliver,

I tried to replicate the problem but can not see the "stutter".

Of course I used a different calculation for the chunking.

Could you make a small stack that shows the effect? That way it is easier to determine whether it is the text or the chunking.
Just as in the movie but just that one part at 4 secs. Not the whole stack but just enough to replicate the problem.

Kind regards
Bernd

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: coloring of a chunk - strange stutter

Post by okk » Fri Jan 29, 2016 3:07 pm

Hi Bernd, attached a sample stack. On my machines (Macbook Pro, iMac with OS 10.10.5) with LC7.1. I have the same effect than what is shown in the video.

Best
Oliver
Attachments
colouring_test.livecode.zip
(2.83 KiB) Downloaded 255 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: coloring of a chunk - strange stutter

Post by bn » Fri Jan 29, 2016 4:02 pm

Hi Oliver,

I tested your stack on my MacBook Pro MacOSX 10.9.5 in 7.0.3, 7.1, 7.1.1, 8 DP13 and it all went smooth. No "stuttering" except for the small pauses you introduce by wait. But the text itself is not changed by coloring the slightest bit, just the color changes to red.

I am baffled, could be that it is specific to MacOSX 10.10.5 (and up?)?

maybe someone with a Mac and those higher systems can try your stack to see if coloring of text changes the spacing of text as one can see in Oliver's video. The link is in the top post.

Kind regards
Bernd

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: coloring of a chunk - strange stutter

Post by Fermin » Mon Feb 15, 2016 9:16 pm

Some years ago I made a program (with Macromedia Director) to coloring text for karaoke purposes and I remember I ran into a similar problem. I'm not sure but I remember that the issue had to do with the properties of the text or the area where it was displyed. (Align, TextFont)... mmm ... Or maybe it needed a return after each line ?.

As I say I do not remember well and now I can not prove it.

Anyway I sent your code to a friend who has a Mac with Captain installed and, as soon he say me something, I will comment.

Regards

Fermin

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: coloring of a chunk - strange stutter

Post by okk » Thu Feb 18, 2016 10:04 pm

Hi,
I found a partial explanation/workaround. It seems the stutter is related to certain fonts. I tested with LC 8 DP14 on a Macbookpro with MacOS 10.10.5. The stutter was very explicit when I used the official LC system font. When I switched to VERDANA as my stack-wide font the stutter disappeared. You can see it in this video: https://vimeo.com/155883799 This is of course not an explanation, but I thought I share my observation.

Best
Oliver

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: coloring of a chunk - strange stutter

Post by bn » Fri Feb 19, 2016 10:46 am

Hi Oliver,

I tested your stack with different fonts and I see the stutter with a lot of fonts.

Helvetica, Helvetica Neue, Arial, Avenir, American Typewriter, and a lot more. The degree of stutter depends on the font, some more, some less. Chalkboard is stuttering pretty badly.

MacOSX 10.9.5 uses Lucida Grande as default for LC and that font does not stutter. Hence I could not reproduce before.

Fonts that don't stutter:

Lucida Grande, Verdana, Courier, Monaco, (those latter two are monospaced, apparently monospaced Fonts don't stutter) This may have to do with the kerning of a font.

Kind regards
Bernd

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: coloring of a chunk - strange stutter

Post by Fermin » Sat Feb 20, 2016 7:49 pm

The problem is obviously the kerning of proportional types.

Can the treatment of types in 10.10 and higher be different? Maybe, but I''ve seen this problem for years in other authoring applications, like Adobe Director, so I do not think there's any difference between an operating system or another ... simply the LiveCode ignores these "eccentricities" of the system fonts...

Or changing colors involves inserting codes between letters and this disrupts the kerning or something...

best regards.

Fermin (with the help of my friend David)

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: coloring of a chunk - strange stutter

Post by okk » Sat Feb 27, 2016 9:52 pm

Hi and thanks for testing. Do you think this is a bug in Livecode or something that has to do with the OS and how it handles fonts? This is beyond my knowledge horizon. Still, it looks strange and I don't like it. It makes my software look kind of buggy.

Best
Oliver

Post Reply

Return to “Multimedia”