Jump to content

[Solved] Fonts on Widgtes and Change Resolution screen.


Yue
 Share

Recommended Posts

I am trying to optimize this as much as possible and all to tip to I have problems when I do a resolution change and the widgets have a custom font that is added with:

Widget:SetFont("Assets/Fonts/myFont.ttf",12)

image.thumb.png.887e42ebd0921a70a676eb49515bbd65.png

The problem here is that when I do a screen resolution change, it removes the window and thus the context is removed and I have to remove the GUI. And rebuilding it again starts the process of loading those fonts for the GUI.

image.thumb.png.354887b3936db61595a85dbb399d061b.png

Then it happens that after several successful resolution changes the application crashes. It is evident that the more fonts you use, the slower the process is when changing the screen resolution, because it has to load the fonts back into memory. 

So I have the following questions: Is it possible to leave those fonts in memory, is there any tip for this?

Obviously if I don't put custom fonts and leave the default font, this doesn't happen and the change of screen resolution is much fast

Translated with www.DeepL.com/Translator (free version)

 

 

 

Link to comment
Share on other sites

 

I think the most valid option is to leave the default font with a specific size for all buttons, in favor of a fast and efficient change of resolution in real time.  Or the other would be to ask the user for a manual reset and use a custom font for each widget with a specific size.

There are things, decisions that favor something and harm something else. 



image.thumb.png.643e0e25ebd3569b33dcd7a576416179.png

 

 

Link to comment
Share on other sites

  • Yue changed the title to [Solved] Fonts on Widgtes and Change Resolution screen.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...