What is wrong with this code?

sure! give me your email

mathias.westerdahl@king.com

okay!!! everything you need is in the main collection. The two relevant scripts are in text interpret and label circle script (ā€¦and I think text interpret is fine. It just turns key presses into a table to send to the label circle script). There are a few fonts to try in imagesfontslabels. Remember that this bug only occurs with non-mono spaced fonts.

Sorry, no email yet. Perhaps send it via PM?

i added you as a collaborator

1 Like

Videoart.zip (3.7 MB)

anyway hereā€™s the file

1 Like

Ok, so there was one bug in your code, and that was that you applied the advance of the glyph before positioning the glyph. If you instead do:

go.set(myobj, "position.x", (self.accumulateddistance))
self.accumulateddistance = self.accumulateddistance + metrics.width

After that it looks better, but still weird. But now I think itā€™s related to the other issue of getting correct width of a glyph.

label # Width x pos
DEBUG:SCRIPT: mylabel 1 W small object1#label 1 83 0
DEBUG:SCRIPT: mylabel 2 i small object2#label 2 21 83
DEBUG:SCRIPT: mylabel 3 l small object3#label 3 20 104
DEBUG:SCRIPT: mylabel 4 d small object4#label 4 48 124

I think the W is way to large in this case, for instance.

2 Likes

damn, that was me trying to neaten things up before i sent you the project (one bug is still pretty good for me i have to say).

okay, so i will use a monospaced font for now and hope this gets fixed soon.

2 Likes

I canā€™t believe i uncovered two bugs in this one little thing. I have to start having more confidence in my coding ability

3 Likes