package stb_truetype

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type buffer = (int, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
type offset = private int
val enum : buffer -> offset list
type t
val init : buffer -> offset -> t option
type codepoint = int
type glyph = private int
val find : t -> codepoint -> glyph option
val invalid_glyph : glyph
val get : t -> codepoint -> glyph
type font_size =
  1. | Size_max of float
  2. | Size_of_M of float
val scale_for_size : t -> font_size -> float
val scale_for_pixel_height : t -> float -> float
val scale_for_mapping_em_to_pixels : t -> float -> float
type vmetrics = {
  1. ascent : int;
  2. descent : int;
  3. line_gap : int;
}
val vmetrics : t -> vmetrics
type hmetrics = {
  1. advance_width : int;
  2. left_side_bearing : int;
}
val hmetrics : t -> glyph -> hmetrics
val glyph_advance : t -> glyph -> int
val kern_advance : t -> glyph -> glyph -> int
type box = {
  1. x0 : int;
  2. y0 : int;
  3. x1 : int;
  4. y1 : int;
}
val font_box : t -> box
val glyph_box : t -> glyph -> box
type pack_context
val pack_begin : buffer -> width:int -> height:int -> stride:int -> padding:int -> pack_context option
val pack_set_oversampling : pack_context -> h:int -> v:int -> unit
type char_range = {
  1. font_size : font_size;
  2. first_codepoint : int;
  3. count : int;
}
type packed_chars
val pack_font_ranges : pack_context -> t -> char_range array -> packed_chars array option
val packed_chars_count : packed_chars -> int
val packed_chars_box : packed_chars -> int -> box
type char_metrics = {
  1. xoff : float;
  2. yoff : float;
  3. xadvance : float;
  4. xoff2 : float;
  5. yoff2 : float;
}
val packed_chars_metrics : packed_chars -> int -> char_metrics
type char_quad = {
  1. bx0 : float;
  2. by0 : float;
  3. s0 : float;
  4. t0 : float;
  5. bx1 : float;
  6. by1 : float;
  7. s1 : float;
  8. t1 : float;
}
val packed_chars_quad : packed_chars -> int -> bitmap_width:int -> bitmap_height:int -> screen_x:float -> screen_y:float -> align_on_int:bool -> float * char_quad
val string_of_packed_chars : packed_chars -> string
val packed_chars_of_string : string -> packed_chars
val make_glyph_bitmap : t -> buffer -> width:int -> height:int -> scale_x:float -> scale_y:float -> box -> glyph -> unit
val get_glyph_bitmap_box : t -> glyph -> scale_x:float -> scale_y:float -> box
val blur_glyph_bitmap : buffer -> width:int -> height:int -> box -> float -> unit