question

Marco Baccalaro avatar image
0 Likes"
Marco Baccalaro asked Matthew Gillespie commented

drawfont() not working

Hello,
I noticed that drawfont() command works until the model is saved and closed. When trying to open a model with that command, FlexSim crashes at the opening.


FlexSim 23.1.3
bugdrawfont
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Matthew Gillespie commented

I was able to find an issue related to this but without the crash in 23.0.11 and 23.2.1.

For me the text is not show when reloading the model IF the font number is the value used in the save. If the number is changed to a different font it draws the text again. This does not 'stack' in that its seems to be just the font value when saved that will not display when model is reopened.

Thanks for drawing attention to this - I will send it in to the developers.

As for the crashing - have you tried using a later version?

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Marco Baccalaro avatar image Marco Baccalaro commented ·
Yes, I saw that with an older version is just the text that is not shown.

While the crash happens on the 23.2.1. Maybe there's also something related to my pc configuration or to the fact that I put it in an OnDraw trigger of a plane.

Anyhow, thanks for putting it on the dev list.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Marco Baccalaro commented ·

I just used a visual shape - should be the same effect as a plane.

testDrawFont.fsm

0 Likes 0 ·
testdrawfont.fsm (29.7 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ Marco Baccalaro commented ·

@Marco Baccalaro

The text not drawing is a timing issue with the initialization of the font rendering library. This is caused by calling drawfont() before anything else in the program has tried to render text.

I was unable to replicate the crashing issue.

I've pushed a fix for the timing issue in the next bugfix releases.

You can workaround the issue by calling drawtext(view, "", 0,0,0); before calling drawfont().

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Marco Baccalaro This issue is now fixed in 23.0.12 and 23.2.2

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.