Error with fonts.

When creating text with the same font (For example Bold) after a while, the text is displayed not with the Bold font, but with Regular. Everything is fine in the code (The font is specified as follows: ‘Ubuntu-Bold.ttf’, as well as the file name itself). What could this be related to?

I’m not sure if this will solve the problem, but try to rename the file and replace “-” with “_”
and do the same in your code and check it out