package camlimages

  1. Overview
  2. Docs

Almost all of the functions are just interpretation of functions of the freetype library. See the documents of the freetype library.

type library
val init : unit -> library
val close : library -> unit
type face
type face_info = {
  1. num_faces : int;
  2. num_glyphs : int;
  3. family_name : string;
  4. style_name : string;
  5. has_horizontal : bool;
  6. has_vertical : bool;
  7. has_kerning : bool;
  8. is_scalable : bool;
  9. is_sfnt : bool;
  10. is_fixed_width : bool;
  11. has_fixed_sizes : bool;
  12. has_fast_glyphs : bool;
  13. has_glyph_names : bool;
  14. has_multiple_masters : bool;
}
val new_face : library -> string -> int -> face
val face_info : face -> face_info
val done_face : face -> unit
val get_num_glyphs : face -> int
val set_char_size : face -> int -> int -> int -> int -> unit
val set_pixel_sizes : face -> int -> int -> unit
type charmap = {
  1. platform_id : int;
  2. encoding_id : int;
}
val get_charmaps : face -> charmap list
val set_charmap : face -> charmap -> unit
val get_char_index : face -> int -> int
type render_mode =
  1. | Render_Normal
    (*

    default

    *)
  2. | Render_Mono
type load_flag =
  1. | Load_no_scale
  2. | Load_no_hinting
val load_glyph : face -> int -> load_flag list -> int * int
val load_char : face -> int -> load_flag list -> int * int
val render_glyph_of_face : face -> render_mode -> unit
val render_glyph : face -> int -> load_flag list -> render_mode -> int * int
val render_char : face -> int -> load_flag list -> render_mode -> int * int
val set_transform : face -> (int * int * int * int) -> (int * int) -> unit
type bitmap_info = {
  1. bitmap_left : int;
  2. bitmap_top : int;
  3. bitmap_width : int;
  4. bitmap_height : int;
}
val get_bitmap_info : face -> bitmap_info
val read_bitmap : face -> int -> int -> int
type bbox = {
  1. xmin : int;
    (*

    26.6

    *)
  2. ymin : int;
    (*

    26.6

    *)
  3. xmax : int;
    (*

    26.6

    *)
  4. ymax : int;
    (*

    26.6

    *)
}

glyph metrics

type bearing_advance = {
  1. bearingx : int;
    (*

    26.6

    *)
  2. bearingy : int;
    (*

    26.6

    *)
  3. advance : int;
    (*

    26.6

    *)
}
type glyph_metrics = {
  1. gm_width : int;
    (*

    26.6

    *)
  2. gm_height : int;
    (*

    26.6

    *)
  3. gm_hori : bearing_advance;
  4. gm_vert : bearing_advance;
}
val get_glyph_metrics : face -> glyph_metrics
type size_metrics = {
  1. x_ppem : int;
  2. y_ppem : int;
  3. x_scale : int;
    (*

    16.16

    *)
  4. y_scale : int;
    (*

    16.16

    *)
}

size metrics

val get_size_metrics : face -> size_metrics
type outline_tag =
  1. | On_point
  2. | Off_point_conic
  3. | Off_point_cubic

outline info

type outline_contents = {
  1. n_contours : int;
  2. n_points : int;
  3. points : (int * int) array;
  4. tags : outline_tag array;
  5. contours : int array;
}
val get_outline_contents : face -> outline_contents
OCaml

Innovation. Community. Security.