Skip to content

StringFT is suboptimal #12

Open
Open
@antst

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions