Module Claudius.Font

Provides the font rendering for Claudius.

Doesn't render to screen - used mostly by the framebuffer draw char/string mechanisms.

type t

Type for a font

module Glyph : sig ... end

Initializations

val of_file : string -> (t, string) Stdlib.result

of_file filepath Loads a bitmap font from a PSF file, or a description of why the load failed.

val of_bytes : Stdlib.Bytes.t -> (t, string) Stdlib.result

of_bytes fontdata Loads a bitmap font from a PSF file loaded into bytes, or a description of why the load failed.

Using

val glyph_count : t -> int

glyph_count font Returns a count of how many glyphs are in the font.

val glyph_of_char : t -> Stdlib.Uchar.t -> Glyph.t option

glyph_of_char font char Gets the glyph that maps to a given character in the font, or None if that character doesn't have an entry.

Debug

val print_header : t -> unit

print_header font A utility method to dump the font's header information to stdout.