Open
Description
In current implementation (which I believe partially follows PHP extension) StringFT initialize and destroy font cache on every call, which is OK if this function is used infrequently. But if StringFT is heavily used, then init/deinit of cache on every call is a waste. Moreover, cache is global in libgd, so init/deint of the cache in StringFT makes StringFT thread-unsafe.
I think, it would be handy to have option to control font cache manually, and provide another interface to the gdImageStringFT, which works with pre-initialized cache.
As a simpler option, according to the libgd docs, gdFontCacheSetup/gdFontCacheShutdown can be just omitted from StringFT, as gdImageStringFT will setup font cache if it is not yet initialized.
Metadata
Assignees
Labels
No labels
Activity