ged2doc.dumbemf¶
Python module for generating EMF.
Only the most trivial features are implemented, stuff that is required by ged2doc package.
Classes
|
Class for EMF, top-level structure. |
|
Base class for all EMF records. |
|
|
|
|
|
Base class for all EMF records. |
|
-
class
ged2doc.dumbemf.
EMF
(width, height)[source]¶ Bases:
object
Class for EMF, top-level structure.
- Parameters
- width, height
ged2doc.size.Size
Document width and height, accepts anything convertible to
ged2doc.size.Size
.
- width, height
Methods
data
()Produce complete EMF structure.
polyline
(points)Draw polyline.
rectangle
(left, top, right, bottom)Draw rectangle.
set_bkmode
(mode)Set background mode.
text
(x, y, text)Draw text.
text_align
([align_mode])Set text alignment for next text drawing operation
text_color
(color)Set text color for next text drawing operation
use_font
(size[, fontname])Context manager which sets font parameters.
use_pen
(style, width, color)Context manager which sets pen parameters.
-
use_pen
(style, width, color)[source]¶ Context manager which sets pen parameters.
- Parameters
- style
str
Pen style.
- width
ged2doc.size.Size
Pen width.
- color
int
Pen color.
- style
-
use_font
(size, fontname='Times New Roman')[source]¶ Context manager which sets font parameters.
- Parameters
- size
ged2doc.size.Size
Font size.
- fontname
str
Font family name.
- size
-
set_bkmode
(mode)[source]¶ Set background mode.
- Parameters
- mode
int
Mode, one of
BackgroundMode
constants.
- mode
-
polyline
(points)[source]¶ Draw polyline.
- Parameters
- points
list
[tuple
] List of 2-tuples with (x, y) coordinates, each coordinate is
ged2doc.size.Size
.
- points
-
rectangle
(left, top, right, bottom)[source]¶ Draw rectangle.
- Parameters
- left, top, right, bottom
ged2doc.size.Size
Rectangle coordinates.
- left, top, right, bottom
-
text_align
(align_mode='c')[source]¶ Set text alignment for next text drawing operation
- Parameters
- align_mode
str
, optional One of “l”, “c”, “r”.
- align_mode
-
text
(x, y, text)[source]¶ Draw text.
- Parameters
- x, y
ged2doc.size.Size
Text coordinates.
- text
str
Text to draw.
- x, y