Returns: | the encoded version |
---|---|
Return type: | int |
Returns the version of the underlying C cairo library, encoded in a single integer.
Returns: | the encoded version |
---|---|
Return type: | str |
Returns the version of the underlying C cairo library as a human-readable string of the form “X.Y.Z”.
the pycairo version, as a string
the pycairo version, as a tuple
1 if the feature is present in the underlying C cairo library, 0 otherwise
ANTIALIAS specifies the type of antialiasing to do when rendering text or shapes.
Use the default antialiasing for the subsystem and target device
Use a bilevel alpha mask
Perform single-color antialiasing (using shades of gray for black text on a white background, for example).
Perform antialiasing by taking advantage of the order of subpixel elements on devices such as LCD panels.
These constants are used to describe the content that a Surface will contain, whether color information, alpha information (translucence vs. opacity), or both.
The surface will hold color content only.
The surface will hold alpha content only.
The surface will hold color and alpha content.
These constants are used to describe how Pattern color/alpha will be determined for areas “outside” the pattern’s natural area, (for example, outside the surface bounds or outside the gradient geometry).
The default extend mode is EXTEND_NONE for SurfacePattern and EXTEND_PAD for Gradient patterns.
pixels outside of the source pattern are fully transparent
the pattern is tiled by repeating
the pattern is tiled by reflecting at the edges (Implemented for surface patterns since 1.6)
pixels outside of the pattern copy the closest pixel from the source (Since 1.2; but only implemented for surface patterns since 1.6)
New entries may be added in future versions.
These constants are used to select how paths are filled. For both fill rules, whether or not a point is included in the fill is determined by taking a ray from that point to infinity and looking at intersections with the path. The ray can be in any direction, as long as it doesn’t pass through the end point of a segment or have a tricky intersection such as intersecting tangent to the path. (Note that filling is not actually implemented in this way. This is just a description of the rule that is applied.)
The default fill rule is FILL_RULE_WINDING.
If the path crosses the ray from left-to-right, counts +1. If the path crosses the ray from right to left, counts -1. (Left and right are determined from the perspective of looking along the ray from the starting point.) If the total count is non-zero, the point will be filled.
Counts the total number of intersections, without regard to the orientation of the contour. If the total number of intersections is odd, the point will be filled.
New entries may be added in future versions.
These constants are used to indicate what filtering should be applied when reading pixel values from patterns. See SurfacePattern.set_filter() for indicating the desired filter to be used with a particular pattern.
A high-performance filter, with quality similar FILTER_NEAREST
A reasonable-performance filter, with quality similar to FILTER_BILINEAR
The highest-quality available, performance may not be suitable for interactive use.
Nearest-neighbor filtering
Linear interpolation in two dimensions
This filter value is currently unimplemented, and should not be used in current code.
These constants specify variants of a FontFace based on their slant.
Upright font style
Italic font style
Oblique font style
These constants specify variants of a FontFace based on their weight.
Normal font weight
Bold font weight
These constants are used to identify the memory format of ImageSurface data.
New entries may be added in future versions.
each pixel is a 32-bit quantity, with alpha in the upper 8 bits, then red, then green, then blue. The 32-bit quantities are stored native-endian. Pre-multiplied alpha is used. (That is, 50% transparent red is 0x80800000, not 0x80ff0000.)
each pixel is a 32-bit quantity, with the upper 8 bits unused. Red, Green, and Blue are stored in the remaining 24 bits in that order.
each pixel is a 8-bit quantity holding an alpha value.
each pixel is a 1-bit quantity holding an alpha value. Pixels are packed together into 32-bit quantities. The ordering of the bits matches the endianess of the platform. On a big-endian machine, the first pixel is in the uppermost bit, on a little-endian machine the first pixel is in the least-significant bit.
each pixel is a 16-bit quantity with red in the upper 5 bits, then green in the middle 6 bits, and blue in the lower 5 bits.
These constants specify whether to hint font metrics; hinting font metrics means quantizing them so that they are integer values in device space. Doing this improves the consistency of letter and line spacing, however it also means that text will be laid out differently at different zoom factors.
Hint metrics in the default manner for the font backend and target device
Do not hint font metrics
Hint font metrics
These constants specify the type of hinting to do on font outlines. Hinting is the process of fitting outlines to the pixel grid in order to improve the appearance of the result. Since hinting outlines involves distorting them, it also reduces the faithfulness to the original outline shapes. Not all of the outline hinting styles are supported by all font backends.
Use the default hint style for font backend and target device
Do not hint outlines
Hint outlines slightly to improve contrast while retaining good fidelity to the original shapes.
Hint outlines with medium strength giving a compromise between fidelity to the original shapes and contrast
Hint outlines to maximize contrast
New entries may be added in future versions.
These constants specify how to render the endpoints of the path when stroking.
The default line cap style is LINE_CAP_BUTT
start(stop) the line exactly at the start(end) point
use a round ending, the center of the circle is the end point
use squared ending, the center of the square is the end point
These constants specify how to render the junction of two lines when stroking.
The default line join style is LINE_JOIN_MITER
use a sharp (angled) corner, see Context.set_miter_limit()
use a rounded join, the center of the circle is the joint point
use a cut-off join, the join is cut off at half the line width from the joint point
These constants are used to set the compositing operator for all cairo drawing operations.
The default operator is OPERATOR_OVER.
The operators marked as unbounded modify their destination even outside of the mask layer (that is, their effect is not bound by the mask layer). However, their effect can still be limited by way of clipping.
To keep things simple, the operator descriptions here document the behavior for when both source and destination are either fully transparent or fully opaque. The actual implementation works for translucent layers too.
For a more detailed explanation of the effects of each operator, including the mathematical definitions, see http://cairographics.org/operators.
clear destination layer (bounded)
replace destination layer (bounded)
draw source layer on top of destination layer (bounded)
draw source where there was destination content (unbounded)
draw source where there was no destination content (unbounded)
draw source on top of destination content and only there
ignore the source
draw destination on top of source
leave destination only where there was source content (unbounded)
leave destination only where there was no source content
leave destination on top of source content and only there (unbounded)
source and destination are shown where there is only one of them
source and destination layers are accumulated
like over, but assuming source and dest are disjoint geometries
These constants are used to describe the type of one portion of a path when represented as a Path.
A move-to operation
A line-to operation
A curve-to operation
A close-path operation
These constants are used to describe the language level of the PostScript Language Reference that a generated PostScript file will conform to. Note: the constants are only defined when cairo has been compiled with PS support enabled.
The language level 2 of the PostScript specification.
The language level 3 of the PostScript specification.
The subpixel order specifies the order of color elements within each pixel on the display device when rendering with an antialiasing mode of ANTIALIAS_SUBPIXEL.
Use the default subpixel order for for the target device
Subpixel elements are arranged horizontally with red at the left
Subpixel elements are arranged horizontally with blue at the left
Subpixel elements are arranged vertically with red at the top
Subpixel elements are arranged vertically with blue at the top