The OpenD Programming Language

FTScaledFont.lockFace

lockFace() gets the FT_Face object from a FreeType backend font and scales it appropriately for the font. You must release the face with unlockFace() when you are done using it. Since the FT_Face object can be shared between multiple ScaledFont objects, you must not lock any other font objects until you unlock this one. A count is kept of the number of times lockFace() is called. unlockFace() must be called the same number of times.

You must be careful when using this function in a library or in a threaded application, because freetype's design makes it unsafe to call freetype functions simultaneously from multiple threads, (even if using distinct FT_Face objects). Because of this, application code that acquires an FT_Face object with this call must add its own locking to protect any use of that object, (and which also must protect any other calls into cairo as almost any cairo function might result in a call into the freetype library).

class FTScaledFont
FT_Face
lockFace
()

Meta