Module Graph.XDotDraw
Parses xdot drawing operations
Types
type style_attr
=
|
Filled
|
Invisible
|
Diagonals
|
Rounded
|
Dashed
|
Dotted
|
Solid
|
Bold
|
StyleString of string
Style attributes
type operation
=
|
Filled_ellipse of pos * width * height
|
Unfilled_ellipse of pos * width * height
|
Filled_polygon of pos array
|
Unfilled_polygon of pos array
|
Polyline of pos array
|
Bspline of pos array
|
Filled_bspline of pos array
|
Text of pos * align * width * string
|
Fill_color of string
|
Pen_color of string
|
Font of float * string
|
Style of style_attr list
Drawing operations
val string_scale_size : fontMeasure:(fontName:string -> fontSize:int -> string -> int * int) -> string -> float -> string -> width * height
string_scale_size ~fontMeasure font font_size text
. Interpolates the font metrics we have to use to draw the giventext
with the given font but preserving the bounding box of thetext
even with a proportional font. For a fixed width font the result isfont_size*font_size
.
Parsing and drawing state
val parse : string -> operation list
type draw_state
= private
{
mutable fill_color : string;
mutable pen_color : string;
mutable font : float * string;
mutable style : style_attr list;
}
val draw_with : (draw_state -> operation -> unit) -> operation list -> unit
Iterates on the drawing operations and updates the implicit drawing state