Skip to content

has_glyph

Mojo function 🡭

has_glyph

fn def has_glyph(mut face: TTFFace, codepoint: Int) -> Bool

Whether face has a real glyph for codepoint. Glyph index 0 is TrueType’s “.notdef”, what cmap returns for an unmapped codepoint. A plain cmap lookup with no outline decode, which is all render.mojo’s fallback logic needs.

Args:

  • face (TTFFace): Face to check.
  • codepoint (Int): Unicode codepoint to look up.

Returns:

Bool: True if face maps codepoint to a real glyph.

Raises: