daegun

The five rules

Every function in the header obeys all five, so there is nothing to remember per call.

  1. A fallible call returns daegun_status. Results come back through out parameters.
  2. Passing NULL where a pointer is required returns DAEGUN_NULL. It is never dereferenced.
  3. daegun allocates and daegun frees. Never call free() on a pointer daegun gave you.
  4. A borrowed view is a const pointer plus a count, valid until the handle it came from is freed.
  5. Handles are thread safe: one handle may be used from several threads at once.

A crash from breaking these is a bug in the calling code. A crash from following them is a vulnerability, and worth reporting.

Status codes

CodeMeaning
DAEGUN_OKThe call did what it says.
DAEGUN_NULLA required pointer was NULL. Always the caller's bug.
DAEGUN_PARSEThe font could not be read.
DAEGUN_RANGEAn argument was outside what the call accepts.
DAEGUN_ABSENTNo such glyph, table or axis. An answer, not a failure.
DAEGUN_UNSUPPORTEDNot available here, such as a GPU backend the machine lacks.

Type to search.