package JsOfOCairo

  1. Overview
  2. Docs

Parameters

module C : S

Signature

include S
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
  31. | INVALID_SIZE
  32. | USER_FONT_NOT_IMPLEMENTED
  33. | DEVICE_TYPE_MISMATCH
  34. | DEVICE_ERROR
  35. | INVALID_MESH_CONSTRUCTION
  36. | DEVICE_FINISHED
  37. | JBIG2_GLOBAL_MISSING
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;
}
type slant =
  1. | Upright
  2. | Italic
  3. | Oblique
type weight =
  1. | Normal
  2. | Bold
type font_extents = {
  1. ascent : float;
  2. descent : float;
  3. baseline : float;
  4. max_x_advance : float;
  5. max_y_advance : float;
}
val select_font_face : context -> ?slant:slant -> ?weight:weight -> string -> unit
val set_font_size : context -> float -> unit
val show_text : context -> string -> unit
val font_extents : context -> font_extents
val text_extents : context -> string -> text_extents
module Pattern : sig ... end
val save : context -> unit
val restore : context -> unit
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 -> 'a Pattern.t -> unit
val get_source : context -> Pattern.any
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
val set_dash : context -> ?ofs:float -> float array -> unit
val get_dash : context -> float array * 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
type fill_rule =
  1. | WINDING
  2. | EVEN_ODD
val set_fill_rule : context -> fill_rule -> unit
val get_fill_rule : context -> fill_rule
val clip : context -> unit
val clip_preserve : context -> unit
val fill : context -> unit
val fill_preserve : context -> unit
val paint : ?alpha:float -> context -> unit
val stroke : context -> unit
val stroke_preserve : context -> unit
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
val create : C.context -> context
val calls : context -> string list
OCaml

Innovation. Community. Security.