Openfl is slow when just using big font

hello people,

this is something strange that i have ran into. but when making a simple menu class which holds fonts, would also be for the menu itself - have found its boots up the game slowly when fonts get to a certain size.

i thought this may have been something such as the type of font. i was using OTF, then changed to TTF, but its the same. know it would be the same, but had to check :wink:
but say if i give the size value of a font say 100, it is very slow to start up from if it was set to 30. im quite suprised, since its just font loading and not loads of images.

why is this? and can this be fixed at all?

thanks :wink:

I think we should set a threshold where fonts of a certain (large) size are renderered on the fly, and smaller ones are rendered to a tilesheet and cached. Caching is not as good for big glyphs I think :wink:

I think that current implementation is slow because

  1. It will render most of ASCII characters at first even when you don’t need all of them.
  2. Rendered glyphs are copied in main memory twice before they are finally uploaded to VRAM with glTexImage2D.

@singmajesty, I didn’t know that current implementation is NOT rendering glyphs on the fly (and doesn’t support non-ASCII characters).

aye it would be good to see some improvement. because there is a huge difference in it taking about 1 second for 30 size to a over 4 seconds for a 100 size text with a loaded font.

luckily im not shipping anything, but would be great to look at it further for better rendering times :wink: