package cairo

  1. Overview
  2. Docs
type status =
  1. | INVALID_RESTORE
  2. | INVALID_POP_GROUP
  3. | NO_CURRENT_POINT
  4. | INVALID_MATRIX
  5. | INVALID_STATUS
  6. | NULL_POINTER
  7. | INVALID_STRING
  8. | INVALID_PATH_DATA
  9. | READ_ERROR
  10. | WRITE_ERROR
  11. | SURFACE_FINISHED
  12. | SURFACE_TYPE_MISMATCH
  13. | PATTERN_TYPE_MISMATCH
  14. | INVALID_CONTENT
  15. | INVALID_FORMAT
  16. | INVALID_VISUAL
  17. | FILE_NOT_FOUND
  18. | INVALID_DASH
  19. | INVALID_DSC_COMMENT
  20. | INVALID_INDEX
  21. | CLIP_NOT_REPRESENTABLE
  22. | TEMP_FILE_ERROR
  23. | INVALID_STRIDE
  24. | FONT_TYPE_MISMATCH
  25. | USER_FONT_IMMUTABLE
  26. | USER_FONT_ERROR
  27. | NEGATIVE_COUNT
  28. | INVALID_CLUSTERS
  29. | INVALID_SLANT
  30. | INVALID_WEIGHT
exception Error of status
val status_to_string : status -> string
exception Unavailable
type context
type matrix = {
  1. mutable xx : float;
  2. mutable yx : float;
  3. mutable xy : float;
  4. mutable yy : float;
  5. mutable x0 : float;
  6. mutable y0 : float;
}
module Matrix : sig ... end
type text_extents = {
  1. x_bearing : float;
  2. y_bearing : float;
  3. width : float;
  4. height : float;
  5. x_advance : float;
  6. y_advance : float;
}
module Glyph : sig ... end
type antialias =
  1. | ANTIALIAS_DEFAULT
  2. | ANTIALIAS_NONE
  3. | ANTIALIAS_GRAY
  4. | ANTIALIAS_SUBPIXEL
type subpixel_order =
  1. | SUBPIXEL_ORDER_DEFAULT
  2. | SUBPIXEL_ORDER_RGB
  3. | SUBPIXEL_ORDER_BGR
  4. | SUBPIXEL_ORDER_VRGB
  5. | SUBPIXEL_ORDER_VBGR
type hint_style =
  1. | HINT_STYLE_DEFAULT
  2. | HINT_STYLE_NONE
  3. | HINT_STYLE_SLIGHT
  4. | HINT_STYLE_MEDIUM
  5. | HINT_STYLE_FULL
type hint_metrics =
  1. | HINT_METRICS_DEFAULT
  2. | HINT_METRICS_OFF
  3. | HINT_METRICS_ON
module Font_options : sig ... end
type slant =
  1. | Upright
  2. | Italic
  3. | Oblique
type weight =
  1. | Normal
  2. | Bold
type font_type = [
  1. | `Ft
  2. | `Quartz
  3. | `Toy
  4. | `User
  5. | `Win32
]
module Font_face : sig ... end
type font_extents = {
  1. ascent : float;
  2. descent : float;
  3. baseline : float;
  4. max_x_advance : float;
  5. max_y_advance : float;
}
module Scaled_font : sig ... end
val select_font_face : context -> ?slant:slant -> ?weight:weight -> string -> unit
val set_font_size : context -> float -> unit
val set_font_matrix : context -> Matrix.t -> unit
val get_font_matrix : context -> Matrix.t
val show_text : context -> string -> unit
val font_extents : context -> font_extents
val text_extents : context -> string -> text_extents
type rectangle = {
  1. x : float;
  2. y : float;
  3. w : float;
  4. h : float;
}
type content =
  1. | COLOR
  2. | ALPHA
  3. | COLOR_ALPHA
module Surface : sig ... end
module Image : sig ... end
module PDF : sig ... end
module PNG : sig ... end
module PS : sig ... end
module SVG : sig ... end
module Recording : sig ... end
module Pattern : sig ... end
val create : Surface.t -> context
val save : context -> unit
val restore : context -> unit
val get_target : context -> Surface.t
module Group : sig ... end
val set_source_rgb : context -> r:float -> g:float -> b:float -> unit
val set_source_rgba : context -> r:float -> g:float -> b:float -> a:float -> unit
val set_source : context -> [< `Gradient | `Linear | `Radial | `Solid | `Surface ] Pattern.t -> unit
val set_source_surface : context -> Surface.t -> x:float -> y:float -> unit
val get_source : context -> Pattern.any
val set_antialias : context -> antialias -> unit
val get_antialias : context -> antialias
val set_dash : context -> ?ofs:float -> float array -> unit
val get_dash : context -> float array * float
type fill_rule =
  1. | WINDING
  2. | EVEN_ODD
val set_fill_rule : context -> fill_rule -> unit
val get_fill_rule : context -> fill_rule
type line_cap =
  1. | BUTT
  2. | ROUND
  3. | SQUARE
val set_line_cap : context -> line_cap -> unit
val get_line_cap : context -> line_cap
type line_join =
  1. | JOIN_MITER
  2. | JOIN_ROUND
  3. | JOIN_BEVEL
val set_line_join : context -> line_join -> unit
val get_line_join : context -> line_join
val set_line_width : context -> float -> unit
val get_line_width : context -> float
val set_miter_limit : context -> float -> unit
val get_miter_limit : context -> float
type operator =
  1. | CLEAR
  2. | SOURCE
  3. | OVER
  4. | IN
  5. | OUT
  6. | ATOP
  7. | DEST
  8. | DEST_OVER
  9. | DEST_IN
  10. | DEST_OUT
  11. | DEST_ATOP
  12. | XOR
  13. | ADD
  14. | SATURATE
val set_operator : context -> operator -> unit
val get_operator : context -> operator
val set_tolerance : context -> float -> unit
val get_tolerance : context -> float
val clip : context -> unit
val clip_preserve : context -> unit
val clip_extents : context -> rectangle
val clip_reset : context -> unit
val clip_rectangle_list : context -> rectangle list
val fill : context -> unit
val fill_preserve : context -> unit
val fill_extents : context -> rectangle
val in_fill : context -> x:float -> y:float -> bool
val mask : context -> [< `Gradient | `Linear | `Radial | `Solid | `Surface ] Pattern.t -> unit
val mask_surface : context -> Surface.t -> x:float -> y:float -> unit
val paint : ?alpha:float -> context -> unit
val stroke : context -> unit
val stroke_preserve : context -> unit
val stroke_extents : context -> rectangle
val in_stroke : context -> x:float -> y:float -> bool
val copy_page : context -> unit
val show_page : context -> unit
type path_data =
  1. | MOVE_TO of float * float
  2. | LINE_TO of float * float
  3. | CURVE_TO of float * float * float * float * float * float
  4. | CLOSE_PATH
module Path : sig ... end
val arc : context -> x:float -> y:float -> r:float -> a1:float -> a2:float -> unit
val arc_negative : context -> x:float -> y:float -> r:float -> a1:float -> a2:float -> unit
val curve_to : context -> x1:float -> y1:float -> x2:float -> y2:float -> x3:float -> y3:float -> unit
val line_to : context -> x:float -> y:float -> unit
val move_to : context -> x:float -> y:float -> unit
val rectangle : context -> x:float -> y:float -> w:float -> h:float -> unit
val rel_curve_to : context -> x1:float -> y1:float -> x2:float -> y2:float -> x3:float -> y3:float -> unit
val rel_line_to : context -> x:float -> y:float -> unit
val rel_move_to : context -> x:float -> y:float -> unit
val translate : context -> x:float -> y:float -> unit
val scale : context -> x:float -> y:float -> unit
val rotate : context -> angle:float -> unit
val transform : context -> Matrix.t -> unit
val set_matrix : context -> Matrix.t -> unit
val get_matrix : context -> Matrix.t
val identity_matrix : context -> unit
val user_to_device : context -> x:float -> y:float -> float * float
val user_to_device_distance : context -> x:float -> y:float -> float * float
val device_to_user : context -> x:float -> y:float -> float * float
val device_to_user_distance : context -> x:float -> y:float -> float * float
OCaml

Innovation. Community. Security.