[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Time to load font with pygame.font.SysFont on Mac



On 5/04/21 9:29 am, Irv Kalb wrote:
If I load a font like the system font using None with a call to pygame.font.font, it happens almost immediately.

But if I load a font by name using pygame.font.SysFont, it's taking over 7 seconds on my Mac to load.  It doesn't seem to matter which font I try to use.

Is it slow every time you run it, or are subsequent runs faster?

I don't have an OSX 11 system handy to try it on, but I tried
it on 10.12.6 and got this:

First run:
Loading System font took 0.015527009963989258
Loading Arial font took 4.879987001419067

Second run:
Loading System font took 0.00061798095703125
Loading Arial font took 0.05048775672912598

Third run:
Loading System font took 0.0006070137023925781
Loading Arial font took 0.0516507625579834

So for me it took about 4.9 seconds the first time, but was
a lot faster once it was warmed up.

--
Greg