Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change font size / Maintain screen size.
#2
Your program is doomed to fail. It's gonna crash and burn horribly after being used for a while. Just watch it's memory usage go up, up, up, up, and up more, in task manager.

You're endlessly loading resources -- fonts at various sizes, in this example -- and never freeing them. You've got a memory leak at work here that will eventually either crash your program, or else make your OS slow down to a crawl and become unstable.

My advice? Since your fontsize is going from 9 to 31, just load the font into an array at startup and use that array without having to worry about ever freeing or loading resources after that.

DIM font(9 TO 31) As Long
For I = 9 TO 31 STEP 2
font(i) = _LOADFONT(fontpath$, i, fontstyle$)
NEXT

Then just call your _FONT font(fontsize). No endless loading of resources necessary, nor any need to free them.
Reply


Messages In This Thread
RE: Change font size / Maintain screen size. - by SMcNeill - 11-11-2022, 03:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Screen fonts in SCREEN 0 BDS107 14 3,573 07-08-2025, 08:05 PM
Last Post: madscijr
  ASCII font display Helium5793 5 1,211 03-04-2025, 03:50 PM
Last Post: Steffan-68
  A clean font printing SUB I use sometimes. Dav 4 1,239 08-27-2023, 10:16 PM
Last Post: Dav
Lightbulb Fancy font names mnrvovrfc 8 1,651 05-29-2023, 07:15 PM
Last Post: bplus
  wanted: program to process Windows Font files paulel 14 3,004 10-26-2022, 07:29 PM
Last Post: SpriggsySpriggs

Forum Jump:


Users browsing this thread: 1 Guest(s)