Method summary
- __init__(self, gc)
- arc(self, x, y, radius, start_angle, end_angle, clockwise)
- arc_to(self, x1, y1, x2, y2, radius)
- begin_page(self)
- begin_path(self)
- clear_rect(self, rect)
- clip(self)
- clip_to_rect(self, rect)
- clip_to_rects(self)
- close_path(self)
- concat_ctm(self, transform)
- curve_to(self, cp1x, cp1y, cp2x, cp2y, x, y)
- draw_image(self)
- draw_path(self, mode)
- end_page(self)
- eof_fill_path(self)
- even_odd_clip(self)
- fill_path(self)
- fill_rect(self, rect)
- fill_rects(self)
- flush(self)
- get_ctm(self)
- get_path_bounding_box(self)
- get_path_current_point(self)
- get_text_matrix(self)
- get_text_position(self)
- is_path_empty(self)
- line_to(self, x, y)
- lines(self, points)
- move_to(self, x, y)
- quad_curve_to(self, cpx, cpy, x, y)
- rect(self, x, y, sx, sy)
- rects(self, rects)
- restore_state(self)
- rotate_ctm(self, angle)
- save_state(self)
- scale_ctm(self, sx, sy)
- select_font(self, name, size, textEncoding)
- set_alpha(self, alpha)
- set_character_spacing(self)
- set_fill_color(self, color)
- set_fill_color_space(self)
- set_flatness(self, flatness)
- set_font(self, font)
- set_font_size(self, size)
- set_line_cap(self, style)
- set_line_dash(self, lengths, phase = 0)
- set_line_join(self, style)
- set_line_width(self, width)
- set_miter_limit(self, limit)
- set_rendering_intent(self)
- set_should_antialias(self, value)
- set_stroke_color(self, color)
- set_stroke_color_space(self)
- set_text_drawing_mode(self)
- set_text_matrix(self, ttm)
- set_text_position(self, x, y)
- show_glyphs(self)
- show_text(self, text, x = None, y = None)
- stroke_path(self)
- stroke_rect(self, rect)
- stroke_rect_with_width(self, rect, width)
- synchronize(self)
- translate_ctm(self, tx, ty)
Methods
- __init__(self, gc)
- arc(self, x, y, radius, start_angle, end_angle, clockwise)
- arc_to(self, x1, y1, x2, y2, radius)
- begin_page(self)
Create a new page within the graphics context.
- begin_path(self)
Clear the current drawing path and begin a new one.
- clear_rect(self, rect)
- clip(self)
- clip_to_rect(self, rect)
Clip context to the given rectangular region.
Region should be a 4-tuple or a sequence.
- clip_to_rects(self)
- close_path(self)
Close the path of the current subpath.
- concat_ctm(self, transform)
Concatenate the transform to current coordinate transform matrix.
- transform:affine_matrix -- the transform matrix to concatenate with
- the current coordinate matrix.
- curve_to(self, cp1x, cp1y, cp2x, cp2y, x, y)
- draw_image(self)
- draw_path(self, mode)
Walk through all the drawing subpaths and draw each element.
Each subpath is drawn separately.
- end_page(self)
End drawing in the current page of the graphics context.
- eof_fill_path(self)
- even_odd_clip(self)
- fill_path(self)
- fill_rect(self, rect)
- fill_rects(self)
- flush(self)
Send all drawing data to the destination device.
- get_ctm(self)
Return the current coordinate transform matrix.
- XXX: This should really return a 3x3 matrix (or maybe an affine
- object?) like the other API's. Needs thought.
- get_path_bounding_box(self)
should return a tuple or array instead of a strange object.
- get_path_current_point(self)
Return the current point from the graphics context.
Note: This should be a tuple or array.
- get_text_matrix(self)
- get_text_position(self)
- is_path_empty(self)
Test to see if the current drawing path is empty
- line_to(self, x, y)
Add a line from the current point to the given point (x,y).
The current point is moved to (x,y).
- lines(self, points)
Add a series of lines as a new subpath.
Currently implemented by calling line_to a zillion times.
Points is an Nx2 array of x,y pairs.
current_point is moved to the last point in points
- move_to(self, x, y)
Start a new drawing subpath at place the current point at (x,y).
- quad_curve_to(self, cpx, cpy, x, y)
- rect(self, x, y, sx, sy)
Add a rectangle as a new subpath.
- rects(self, rects)
Add multiple rectangles as separate subpaths to the path.
Currently implemented by calling rect a zillion times.
- restore_state(self)
Restore the previous graphics state.
- rotate_ctm(self, angle)
Rotates the coordinate space for drawing by the given angle.
- angle:float -- the angle, in radians, to rotate the coordinate
- system
- save_state(self)
Save the current graphic's context state.
This should always be paired with a restore_state
- scale_ctm(self, sx, sy)
Set the coordinate system scale to the given values, (sx,sy).
sx:float -- The new scale factor for the x axis sy:float -- The new scale factor for the y axis
- select_font(self, name, size, textEncoding)
- set_alpha(self, alpha)
- set_character_spacing(self)
- set_fill_color(self, color)
- set_fill_color_space(self)
- set_flatness(self, flatness)
Not implemented
It is device dependent and therefore not recommended by the PDF documentation.
- set_font(self, font)
Set the font for the current graphics context.
I need to figure out this one.
- set_font_size(self, size)
- set_line_cap(self, style)
Specify the style of endings to put on line ends.
- style:cap_style -- the line cap style to use. Available styles
- are CAP_ROUND,CAP_BUTT,CAP_SQUARE
- set_line_dash(self, lengths, phase = 0)
- lengths:float array -- An array of floating point values
- specifing the lengths of on/off painting pattern for lines.
- phase:float -- Specifies how many units into dash pattern
- to start. phase defaults to 0.
- set_line_join(self, style)
Set style for joining lines in a drawing.
- style:join_style -- The line joining style. The available
- styles are JOIN_ROUND, JOIN_BEVEL, JOIN_MITER.
- set_line_width(self, width)
Set the line width for drawing
width:float -- The new width for lines in user space units.
- set_miter_limit(self, limit)
Specifies limits on line lengths for mitering line joins.
If line_join is set to miter joins, the limit specifies which line joins should actually be mitered. If lines aren't mitered, they are joined with a bevel. The line width is divided by the length of the miter. If the result is greater than the limit, the bevel style is used.
limit:float -- limit for mitering joins.
- set_rendering_intent(self)
- set_should_antialias(self, value)
Set/Unset antialiasing for bitmap graphics context.
- set_stroke_color(self, color)
- set_stroke_color_space(self)
- set_text_drawing_mode(self)
- set_text_matrix(self, ttm)
- set_text_position(self, x, y)
- show_glyphs(self)
- show_text(self, text, x = None, y = None)
Draw text on the device at current text position.
This is also used for showing text at a particular point specified by x and y.
- stroke_path(self)
- stroke_rect(self, rect)
- stroke_rect_with_width(self, rect, width)
- synchronize(self)
Prepares drawing data to be updated on a destination device.
- translate_ctm(self, tx, ty)
Translate the coordinate system by the given value by (tx,ty)
tx:float -- The distance to move in the x direction ty:float -- The distance to move in the y direction