CairoTable of Contents
The Cairo classIntroductionSimple class with some static helper methods. Class synopsisCairo
class Cairo
{
/* Methods */
public static array availableFonts
( void
)
public static array availableSurfaces
( void
)
public static string statusToString
( int
$status
)
public static int version
( void
)
public static string versionString
( void
)
}The CairoContext classIntroductionContext is the main object used when drawing with cairo. To draw with cairo, you create a CairoContext, set the target CairoSurface, and drawing options for the CairoContext, create shapes with functions . like CairoContext::moveTo and CairoContext::lineTo, and then draw shapes with CairoContext::stroke or CairoContext::fill. Contexts can be pushed to a stack via CairoContext::save. They may then safely be changed, without loosing the current state. Use CairoContext::restore to restore to the saved state. Class synopsisCairoContext
class CairoContext
{
/* Methods */
public void appendPath
( CairoPath
$path
)
public void arc
( float
$x
, float $y
, float $radius
, float $angle1
, float $angle2
)
public void arcNegative
( float
$x
, float $y
, float $radius
, float $angle1
, float $angle2
)
public void clip
( void
)
public array clipExtents
( void
)
public void clipPreserve
( void
)
public array clipRectangleList
( void
)
public void closePath
( void
)
public __construct
( CairoSurface
$surface
)
public void copyPage
( void
)
public CairoPath copyPath
( void
)
public CairoPath copyPathFlat
( void
)
public void curveTo
( float
$x1
, float $y1
, float $x2
, float $y2
, float $x3
, float $y3
)
public array deviceToUser
( float
$x
, float $y
)
public array deviceToUserDistance
( float
$x
, float $y
)
public void fill
( void
)
public array fillExtents
( void
)
public void fillPreserve
( void
)
public array fontExtents
( void
)
public int getAntialias
( void
)
public array getCurrentPoint
( void
)
public array getDash
( void
)
public int getDashCount
( void
)
public int getFillRule
( void
)
public void getFontFace
( void
)
public void getFontMatrix
( void
)
public void getFontOptions
( void
)
public void getGroupTarget
( void
)
public int getLineCap
( void
)
public int getLineJoin
( void
)
public float getLineWidth
( void
)
public void getMatrix
( void
)
public float getMiterLimit
( void
)
public int getOperator
( void
)
public void getScaledFont
( void
)
public void getSource
( void
)
public void getTarget
( void
)
public float getTolerance
( void
)
public void glyphPath
( array
$glyphs
)
public bool hasCurrentPoint
( void
)
public void identityMatrix
( void
)
public bool inFill
( string
$x
, string $y
)
public bool inStroke
( string
$x
, string $y
)
public void lineTo
( string
$x
, string $y
)
public void mask
( string
$pattern
)
public void maskSurface
( string
$surface
[, string $x
[, string $y
]] )
public void moveTo
( string
$x
, string $y
)
public void newPath
( void
)
public void newSubPath
( void
)
public void paint
( void
)
public void paintWithAlpha
( string
$alpha
)
public array pathExtents
( void
)
public void popGroup
( void
)
public void popGroupToSource
( void
)
public void pushGroup
( void
)
public void pushGroupWithContent
( string
$content
)
public void rectangle
( string
$x
, string $y
, string $width
, string $height
)
public void relCurveTo
( string
$x1
, string $y1
, string $x2
, string $y2
, string $x3
, string $y3
)
public void relLineTo
( string
$x
, string $y
)
public void relMoveTo
( string
$x
, string $y
)
public void resetClip
( void
)
public void restore
( void
)
public void rotate
( string
$angle
)
public void save
( void
)
public void scale
( string
$x
, string $y
)
public void selectFontFace
( string
$family
[, string $slant
[, string $weight
]] )
public void setAntialias
([ string
$antialias
] )
public void setDash
( string
$dashes
[, string $offset
] )
public void setFillRule
( string
$setting
)
public void setFontFace
( CairoFontFace
$fontface
)
public void setFontMatrix
( string
$matrix
)
public void setFontOptions
( string
$fontoptions
)
public void setFontSize
( string
$size
)
public void setLineCap
( string
$setting
)
public void setLineJoin
( string
$setting
)
public void setLineWidth
( string
$width
)
public void setMatrix
( string
$matrix
)
public void setMiterLimit
( string
$limit
)
public void setOperator
( string
$setting
)
public void setScaledFont
( string
$scaledfont
)
public void setSource
( string
$pattern
)
public void setSourceRGB
( string
$red
, string $green
, string $blue
)
public void setSourceRGBA
( string
$red
, string $green
, string $blue
, string $alpha
)
public void setSourceSurface
( string
$surface
[, string $x
[, string $y
]] )
public void setTolerance
( string
$tolerance
)
public void showPage
( void
)
public void showText
( string
$text
)
public int status
( void
)
public void stroke
( void
)
public array strokeExtents
( void
)
public void strokePreserve
( void
)
public array textExtents
( string
$text
)
public void textPath
( string
$string
)
public void transform
( string
$matrix
)
public void translate
( string
$x
, string $y
)
public array userToDevice
( string
$x
, string $y
)
public array userToDeviceDistance
( string
}$x
, string $y
)The CairoException classIntroductionException class throwed by Cairo functions and methods Class synopsisCairoException
class CairoException
extends
Exception
{
/* Inherited properties */
protected
string
$message
;
protected
int
$code
;
protected
string
$file
;
protected
int
$line
;
/* Inherited methods */
final public string Exception::getMessage
( void
)
final public Exception Exception::getPrevious
( void
)
final public mixed Exception::getCode
( void
)
final public string Exception::getFile
( void
)
final public int Exception::getLine
( void
)
final public array Exception::getTrace
( void
)
final public string Exception::getTraceAsString
( void
)
public string Exception::__toString
( void
)
final private void Exception::__clone
( void
)
}The CairoStatus classIntroductionCairoStatus is used to indicate errors that can occur when using Cairo. In some cases it is returned directly by functions. but when using CairoContext, the last error, if any, is stored in the object and can be retrieved with CairoContext::status or cairo_status. New entries may be added in future versions. Use Cairo::statusToString or cairo_status_to_string to get a human-readable representation of an error message. Class synopsisCairoStatus
class CairoStatus
{
/* Constants */
const
integer
CairoStatus::SUCCESS
= 0
;
const
integer
CairoStatus::NO_MEMORY
= 1
;
const
integer
CairoStatus::INVALID_RESTORE
= 2
;
const
integer
CairoStatus::INVALID_POP_GROUP
= 3
;
const
integer
CairoStatus::NO_CURRENT_POINT
= 4
;
const
integer
CairoStatus::INVALID_MATRIX
= 5
;
const
integer
CairoStatus::INVALID_STATUS
= 6
;
const
integer
CairoStatus::NULL_POINTER
= 7
;
const
integer
CairoStatus::INVALID_STRING
= 8
;
const
integer
CairoStatus::INVALID_PATH_DATA
= 9
;
const
integer
CairoStatus::READ_ERROR
= 10
;
const
integer
CairoStatus::WRITE_ERROR
= 11
;
const
integer
CairoStatus::SURFACE_FINISHED
= 12
;
const
integer
CairoStatus::SURFACE_TYPE_MISMATCH
= 13
;
const
integer
CairoStatus::PATTERN_TYPE_MISMATCH
= 14
;
const
integer
CairoStatus::INVALID_CONTENT
= 15
;
const
integer
CairoStatus::INVALID_FORMAT
= 16
;
const
integer
CairoStatus::INVALID_VISUAL
= 17
;
const
integer
CairoStatus::FILE_NOT_FOUND
= 18
;
const
integer
CairoStatus::INVALID_DASH
= 19
;
const
integer
CairoStatus::INVALID_DSC_COMMENT
= 20
;
const
integer
CairoStatus::INVALID_INDEX
= 21
;
const
integer
CairoStatus::CLIP_NOT_REPRESENTABLE
= 22
;
const
integer
CairoStatus::TEMP_FILE_ERROR
= 23
;
const
integer
CairoStatus::INVALID_STRIDE
= 24
;
}Predefined Constants
The CairoSurface classIntroductionThis is the base-class for all other Surface types. CairoSurface is the abstract type representing all different drawing targets that cairo can render to. The actual drawings are performed using a CairoContext. Class synopsisCairoSurface
class CairoSurface
{
/* Methods */
public __construct
( void
)
public void copyPage
( void
)
public void createSimilar
( CairoSurface
$other
, int $content
, string $width
, string $height
)
public void finish
( void
)
public void flush
( void
)
public int getContent
( void
)
public array getDeviceOffset
( void
)
public void getFontOptions
( void
)
public int getType
( void
)
public void markDirty
( void
)
public void markDirtyRectangle
( string
$x
, string $y
, string $width
, string $height
)
public void setDeviceOffset
( string
$x
, string $y
)
public void setFallbackResolution
( string
$x
, string $y
)
public void showPage
( void
)
public int status
( void
)
public void writeToPng
( string
}$file
)Svg Surface BackendIntroductionSvg specific surface class, uses the SVG (standard vector graphics) surface backend. Class synopsisCairoSvgSurface
class CairoSvgSurface
extends
CairoSurface
{
/* Methods */
public __construct
( string
$file
, float $width
, float $height
)
public static array getVersions
( void
)
public void restrictToVersion
( string
$version
)
public static string versionToString
( int
$version
)/* Inherited methods */
public CairoSurface::__construct
( void
)
public void CairoSurface::copyPage
( void
)
public void CairoSurface::createSimilar
( CairoSurface
$other
, int $content
, string $width
, string $height
)
public void CairoSurface::finish
( void
)
public void CairoSurface::flush
( void
)
public int CairoSurface::getContent
( void
)
public array CairoSurface::getDeviceOffset
( void
)
public void CairoSurface::getFontOptions
( void
)
public int CairoSurface::getType
( void
)
public void CairoSurface::markDirty
( void
)
public void CairoSurface::markDirtyRectangle
( string
$x
, string $y
, string $width
, string $height
)
public void CairoSurface::setDeviceOffset
( string
$x
, string $y
)
public void CairoSurface::setFallbackResolution
( string
$x
, string $y
)
public void CairoSurface::showPage
( void
)
public int CairoSurface::status
( void
)
public void CairoSurface::writeToPng
( string
}$file
)The CairoImageSurface classIntroductionCairoImageSurface provide the ability to render to memory buffers either allocated by cairo or by the calling code. The supported image formats are those defined in CairoFormat. Class synopsisCairoImageSurface
class CairoImageSurface
extends
CairoSurface
{
/* Methods */
public __construct
( int
$format
, int $width
, int $height
)
public static void createForData
( string
$data
, int $format
, int $width
, int $height
[, int $stride = -1
] )
public static CairoImageSurface createFromPng
( string
$file
)
public string getData
( void
)
public int getFormat
( void
)
public int getHeight
( void
)
public int getStride
( void
)
public int getWidth
( void
)
/* Inherited methods */
public CairoSurface::__construct
( void
)
public void CairoSurface::copyPage
( void
)
public void CairoSurface::createSimilar
( CairoSurface
$other
, int $content
, string $width
, string $height
)
public void CairoSurface::finish
( void
)
public void CairoSurface::flush
( void
)
public int CairoSurface::getContent
( void
)
public array CairoSurface::getDeviceOffset
( void
)
public void CairoSurface::getFontOptions
( void
)
public int CairoSurface::getType
( void
)
public void CairoSurface::markDirty
( void
)
public void CairoSurface::markDirtyRectangle
( string
$x
, string $y
, string $width
, string $height
)
public void CairoSurface::setDeviceOffset
( string
$x
, string $y
)
public void CairoSurface::setFallbackResolution
( string
$x
, string $y
)
public void CairoSurface::showPage
( void
)
public int CairoSurface::status
( void
)
public void CairoSurface::writeToPng
( string
}$file
)The CairoPdfSurface classIntroduction
Class synopsisCairoPdfSurface
class CairoPdfSurface
extends
CairoSurface
{
/* Methods */
public __construct
( string
$file
, float $width
, float $height
)
public void setSize
( string
$width
, string $height
)/* Inherited methods */
public CairoSurface::__construct
( void
)
public void CairoSurface::copyPage
( void
)
public void CairoSurface::createSimilar
( CairoSurface
$other
, int $content
, string $width
, string $height
)
public void CairoSurface::finish
( void
)
public void CairoSurface::flush
( void
)
public int CairoSurface::getContent
( void
)
public array CairoSurface::getDeviceOffset
( void
)
public void CairoSurface::getFontOptions
( void
)
public int CairoSurface::getType
( void
)
public void CairoSurface::markDirty
( void
)
public void CairoSurface::markDirtyRectangle
( string
$x
, string $y
, string $width
, string $height
)
public void CairoSurface::setDeviceOffset
( string
$x
, string $y
)
public void CairoSurface::setFallbackResolution
( string
$x
, string $y
)
public void CairoSurface::showPage
( void
)
public int CairoSurface::status
( void
)
public void CairoSurface::writeToPng
( string
}$file
)The CairoPsSurface classIntroduction
Class synopsisCairoPsSurface
class CairoPsSurface
extends
CairoSurface
{
/* Methods */
public __construct
( string
$file
, float $width
, float $height
)
public void dscBeginPageSetup
( void
)
public void dscBeginSetup
( void
)
public void dscComment
( string
$comment
)
public bool getEps
( void
)
public static array getLevels
( void
)
public static string levelToString
( int
$level
)
public void restrictToLevel
( string
$level
)
public void setEps
( string
$level
)
public void setSize
( string
$width
, string $height
)/* Inherited methods */
public CairoSurface::__construct
( void
)
public void CairoSurface::copyPage
( void
)
public void CairoSurface::createSimilar
( CairoSurface
$other
, int $content
, string $width
, string $height
)
public void CairoSurface::finish
( void
)
public void CairoSurface::flush
( void
)
public int CairoSurface::getContent
( void
)
public array CairoSurface::getDeviceOffset
( void
)
public void CairoSurface::getFontOptions
( void
)
public int CairoSurface::getType
( void
)
public void CairoSurface::markDirty
( void
)
public void CairoSurface::markDirtyRectangle
( string
$x
, string $y
, string $width
, string $height
)
public void CairoSurface::setDeviceOffset
( string
$x
, string $y
)
public void CairoSurface::setFallbackResolution
( string
$x
, string $y
)
public void CairoSurface::showPage
( void
)
public int CairoSurface::status
( void
)
public void CairoSurface::writeToPng
( string
}$file
)The CairoSurfaceType classIntroduction
Class synopsisCairoSurfaceType
class CairoSurfaceType
{
/* Constants */
const
integer
CairoSurfaceType::IMAGE
= 0
;
const
integer
CairoSurfaceType::PDF
= 1
;
const
integer
CairoSurfaceType::PS
= 2
;
const
integer
CairoSurfaceType::XLIB
= 3
;
const
integer
CairoSurfaceType::XCB
= 4
;
const
integer
CairoSurfaceType::GLITZ
= 5
;
const
integer
CairoSurfaceType::QUARTZ
= 6
;
const
integer
CairoSurfaceType::WIN32
= 7
;
const
integer
CairoSurfaceType::BEOS
= 8
;
const
integer
CairoSurfaceType::DIRECTFB
= 9
;
const
integer
CairoSurfaceType::SVG
= 10
;
const
integer
CairoSurfaceType::OS2
= 11
;
const
integer
CairoSurfaceType::WIN32_PRINTING
= 12
;
const
integer
CairoSurfaceType::QUARTZ_IMAGE
= 13
;
}Predefined Constants
The CairoFontFace classIntroductionCairoFontFace abstract class represents a particular font at a particular weight, slant, and other characteristic but no transformation or size. Note: This class can not be instantiated directly, it is created by CairoContext::getFontFace or cairo_scaled_font_get_font_face. Class synopsisCairoFontFace
class CairoFontFace
{
/* Methods */
public __construct
( void
)
public int getType
( void
)
public int status
( void
)
}The CairoFontOptions classIntroductionAn opaque structure holding all options that are used when rendering fonts. Individual features of a cairo_font_options_t can be set or accessed using functions named cairo_font_options_set_feature_name and cairo_font_options_get_feature_name, like cairo_font_options_set_antialias() and cairo_font_options_get_antialias(). New features may be added to CairoFontOptions in the future. For this reason CairoFontOptions::copy, CairoFontOptions::equal, CairoFontOptions::merge, CairoFontOptions::hash (cairo_font_options_copy(), cairo_font_options_equal(), cairo_font_options_merge(), and cairo_font_options_hash() in procedural way) should be used to copy, check for equality, merge, or compute a hash value of CairoFontOptions objects. Class synopsisCairoFontOptions
class CairoFontOptions
{
/* Methods */
public __construct
( void
)
public bool equal
( string
$other
)
public int getAntialias
( void
)
public int getHintMetrics
( void
)
public int getHintStyle
( void
)
public int getSubpixelOrder
( void
)
public int hash
( void
)
public void merge
( string
$other
)
public void setAntialias
( string
$antialias
)
public void setHintMetrics
( string
$hint_metrics
)
public void setHintStyle
( string
$hint_style
)
public void setSubpixelOrder
( string
$subpixel_order
)
public int status
( void
)
}The CairoFontSlant classIntroductionSpecifies variants of a font face based on their slant. Class synopsisCairoFontSlant
class CairoFontSlant
{
/* Constants */
const
integer
CairoFontSlant::NORMAL
= 0
;
const
integer
CairoFontSlant::ITALIC
= 1
;
const
integer
CairoFontSlant::OBLIQUE
= 2
;
}Predefined Constants
The CairoFontType classIntroductionCairoFontType class is an abstract final class that contains constants used to describe the type of a given CairoFontFace or CairoScaledFont. The font types are also known as "font backends" within cairo. The type of a CairoFontFace is determined by the how it is created, an example would be the CairoToyFontFace::__construct. The CairoFontFace type can be queried with CairoFontFace::getType or cairo_font_face_get_type The various CairoFontFace functions can be used with a font face of any type. The type of a CairoScaledFont is determined by the type of the CairoFontFace passed to CairoScaledFont::__construct or cairo_scaled_font_create. The scaled font type can be queried with CairoScaledFont::getType or cairo_scaled_font_get_type. Class synopsisCairoFontType
class CairoFontType
{
/* Constants */
const
integer
CairoFontType::TOY
= 0
;
const
integer
CairoFontType::FT
= 1
;
const
integer
CairoFontType::WIN32
= 2
;
const
integer
CairoFontType::QUARTZ
= 3
;
}Predefined Constants
The CairoFontWeight classIntroductionSpecifies variants of a font face based on their weight. Class synopsisCairoFontWeight
class CairoFontWeight
{
/* Constants */
const
integer
CairoFontWeight::NORMAL
= 0
;
const
integer
CairoFontWeight::BOLD
= 1
;
}Predefined Constants
The CairoScaledFont classIntroduction
Class synopsisCairoScaledFont
class CairoScaledFont
{
/* Methods */
public __construct
( CairoFontFace
$font_face
, CairoMatrix $matrix
, CairoMatrix $ctm
, CairoFontOptions $options
)
public array extents
( void
)
public CairoMatrix getCtm
( void
)
public void getFontFace
( void
)
public void getFontMatrix
( void
)
public void getFontOptions
( void
)
public void getScaleMatrix
( void
)
public int getType
( void
)
public array glyphExtents
( string
$glyphs
)
public int status
( void
)
public array textExtents
( string
}$text
)The CairoToyFontFace classIntroductionThe CairoToyFontFace class can be used instead of CairoContext::selectFontFace to create a toy font independently of a context. Class synopsisCairoToyFontFace
class CairoToyFontFace
extends
CairoFontFace
{
/* Inherited methods */
}The CairoPatternType classIntroductionCairoPatternType is used to describe the type of a given pattern.
The type of a pattern is determined by the function used to create it.
The cairo_pattern_create_rgb and cairo_pattern_create_rgba
functions create Class synopsisCairoPatternType
class CairoPatternType
{
/* Constants */
const
integer
CairoPatternType::SOLID
= 0
;
const
integer
CairoPatternType::SURFACE
= 1
;
const
integer
CairoPatternType::LINEAR
= 2
;
const
integer
CairoPatternType::RADIAL
= 3
;
}Predefined Constants
The CairoPattern classIntroductionCairoPattern is the abstract base class from which all the other pattern classes derive. It cannot be instantiated directly Class synopsisCairoPattern
class CairoPattern
{
/* Methods */
public __construct
( void
)
public void getMatrix
( void
)
public int getType
( void
)
public void setMatrix
( string
$matrix
)
public int status
( void
)
}The CairoGradientPattern classIntroductionCairoGradientPattern is an abstract base class from which other Pattern classes derive. It cannot be instantiated directly. Class synopsisCairoGradientPattern
class CairoGradientPattern
extends
CairoPattern
{
/* Methods */
public void addColorStopRgb
( string
$offset
, string $red
, string $green
, string $blue
)
public void addColorStopRgba
( string
$offset
, string $red
, string $green
, string $blue
, string $alpha
)
public int getColorStopCount
( void
)
public array getColorStopRgba
( string
$index
)
public int getExtend
( void
)
public void setExtend
( int
$extend
)/* Inherited methods */
public CairoPattern::__construct
( void
)
public void CairoPattern::getMatrix
( void
)
public int CairoPattern::getType
( void
)
public void CairoPattern::setMatrix
( string
$matrix
)
public int CairoPattern::status
( void
)
}The CairoSolidPattern classIntroduction
Class synopsisCairoSolidPattern
class CairoSolidPattern
extends
CairoPattern
{
/* Methods */
public __construct
( float
$red
, float $green
, float $blue
[, float $alpha = 0
] )
public array getRgba
( void
)
/* Inherited methods */
public CairoPattern::__construct
( void
)
public void CairoPattern::getMatrix
( void
)
public int CairoPattern::getType
( void
)
public void CairoPattern::setMatrix
( string
$matrix
)
public int CairoPattern::status
( void
)
}The CairoSurfacePattern classIntroduction
Class synopsisCairoSurfacePattern
class CairoSurfacePattern
extends
CairoPattern
{
/* Methods */
public __construct
( CairoSurface
$surface
)
public int getExtend
( void
)
public int getFilter
( void
)
public void getSurface
( void
)
public void setExtend
( int
$extend
)
public void setFilter
( string
$filter
)/* Inherited methods */
public CairoPattern::__construct
( void
)
public void CairoPattern::getMatrix
( void
)
public int CairoPattern::getType
( void
)
public void CairoPattern::setMatrix
( string
$matrix
)
public int CairoPattern::status
( void
)
}The CairoLinearGradient classIntroductionCreate a new CairoLinearGradient along the line defined Class synopsisCairoLinearGradient
class CairoLinearGradient
extends
CairoGradientPattern
{
/* Methods */
public __construct
( float
$x0
, float $y0
, float $x1
, float $y1
)
public array getPoints
( void
)
/* Inherited methods */
public void CairoGradientPattern::addColorStopRgb
( string
$offset
, string $red
, string $green
, string $blue
)
public void CairoGradientPattern::addColorStopRgba
( string
$offset
, string $red
, string $green
, string $blue
, string $alpha
)
public int CairoGradientPattern::getColorStopCount
( void
)
public array CairoGradientPattern::getColorStopRgba
( string
$index
)
public int CairoGradientPattern::getExtend
( void
)
public void CairoGradientPattern::setExtend
( int
}$extend
)The CairoRadialGradient classIntroduction
Class synopsisCairoRadialGradient
class CairoRadialGradient
extends
CairoGradientPattern
{
/* Methods */
public __construct
( float
$x0
, float $y0
, float $r0
, float $x1
, float $y1
, float $r1
)
public array getCircles
( void
)
/* Inherited methods */
public void CairoGradientPattern::addColorStopRgb
( string
$offset
, string $red
, string $green
, string $blue
)
public void CairoGradientPattern::addColorStopRgba
( string
$offset
, string $red
, string $green
, string $blue
, string $alpha
)
public int CairoGradientPattern::getColorStopCount
( void
)
public array CairoGradientPattern::getColorStopRgba
( string
$index
)
public int CairoGradientPattern::getExtend
( void
)
public void CairoGradientPattern::setExtend
( int
}$extend
)The CairoAntialias classIntroductionEnum class that specifies the type of antialiasing to do when rendering text or shapes. Class synopsisCairoAntialias
class CairoAntialias
{
/* Constants */
const
integer
CairoAntialias::MODE_DEFAULT
= 0
;
const
integer
CairoAntialias::MODE_NONE
= 1
;
const
integer
CairoAntialias::MODE_GRAY
= 2
;
const
integer
CairoAntialias::MODE_SUBPIXEL
= 3
;
}Predefined Constants
The CairoContent classIntroductionCairoContent is used to describe the content that a surface will contain, whether color information, alpha information (translucence vs. opacity), or both. Note: The large values here are designed to keep CairoContent values distinct from CairoContent values so that the implementation can detect the error if users confuse the two types. Class synopsisCairoContent
class CairoContent
{
/* Constants */
const
integer
CairoContent::COLOR
= 4096
;
const
integer
CairoContent::ALPHA
= 8192
;
const
integer
CairoContent::COLOR_ALPHA
= 12288
;
}Predefined Constants
The CairoExtend classIntroduction
Class synopsisCairoExtend
class CairoExtend
{
/* Constants */
const
integer
CairoExtend::NONE
= 0
;
const
integer
CairoExtend::REPEAT
= 1
;
const
integer
CairoExtend::REFLECT
= 2
;
const
integer
CairoExtend::PAD
= 3
;
}Predefined Constants
The CairoFormat classIntroductionCairoFormat enums are used to identify the memory format of the image data. Class synopsisCairoFormat
class CairoFormat
{
/* Constants */
const
integer
CairoFormat::ARGB32
= 0
;
const
integer
CairoFormat::RGB24
= 1
;
const
integer
CairoFormat::A8
= 2
;
const
integer
CairoFormat::A1
= 3
;
/* Methods */
public static int strideForWidth
( int
}$format
, int $width
)Predefined Constants
The CairoFillRule classIntroductionA CairoFillRule is 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 Class synopsisCairoFillRule
class CairoFillRule
{
/* Constants */
const
integer
CairoFillRule::WINDING
= 0
;
const
integer
CairoFillRule::EVEN_ODD
= 1
;
}Predefined Constants
The CairoFilter classIntroductionA CairoFilter is used to indicate what filtering should be applied when reading pixel values from patterns. See CairoPattern::setSource or cairo_pattern_set_source for indicating the desired filter to be used with a particular pattern. Class synopsisCairoFilter
class CairoFilter
{
/* Constants */
const
integer
CairoFilter::FAST
= 0
;
const
integer
CairoFilter::GOOD
= 1
;
const
integer
CairoFilter::BEST
= 2
;
const
integer
CairoFilter::NEAREST
= 3
;
const
integer
CairoFilter::BILINEAR
= 4
;
const
integer
CairoFilter::GAUSSIAN
= 5
;
}Predefined Constants
The CairoHintMetrics classIntroductionSpecifies 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. Class synopsisCairoHintMetrics
class CairoHintMetrics
{
/* Constants */
const
integer
CairoHintMetrics::METRICS_DEFAULT
= 0
;
const
integer
CairoHintMetrics::METRICS_OFF
= 1
;
const
integer
CairoHintMetrics::METRICS_ON
= 2
;
}Predefined Constants
The CairoHintStyle classIntroductionSpecifies 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. Class synopsisCairoHintStyle
class CairoHintStyle
{
/* Constants */
const
integer
CairoHintStyle::STYLE_DEFAULT
= 0
;
const
integer
CairoHintStyle::STYLE_NONE
= 1
;
const
integer
CairoHintStyle::STYLE_SLIGHT
= 2
;
const
integer
CairoHintStyle::STYLE_MEDIUM
= 3
;
const
integer
CairoHintStyle::STYLE_FULL
= 4
;
}Predefined Constants
The CairoLineCap classIntroductionSpecifies how to render the endpoints of the path when stroking.
The default line cap style is Class synopsisCairoLineCap
class CairoLineCap
{
/* Constants */
const
integer
CairoLineCap::BUTT
= 0
;
const
integer
CairoLineCap::ROUND
= 1
;
const
integer
CairoLineCap::SQUARE
= 2
;
}Predefined Constants
The CairoLineJoin classIntroduction
Class synopsisCairoLineJoin
class CairoLineJoin
{
/* Constants */
const
integer
CairoLineJoin::MITER
= 0
;
const
integer
CairoLineJoin::ROUND
= 1
;
const
integer
CairoLineJoin::BEVEL
= 2
;
}Predefined Constants
The CairoMatrix classIntroductionMatrices are used throughout cairo to convert between different coordinate spaces. Class synopsisCairoMatrix
class CairoMatrix
{
/* Methods */
public __construct
([ float
$xx = 1.0
[, float $yx = 0.0
[, float $xy = 0.0
[, float $yy = 1.0
[, float $x0 = 0.0
[, float $y0 = 0.0
]]]]]] )
public static void initIdentity
( void
)
public static void initRotate
( float
$radians
)
public static void initScale
( float
$sx
, float $sy
)
public static void initTranslate
( float
$tx
, float $ty
)
public void invert
( void
)
public static CairoMatrix multiply
( CairoMatrix
$matrix1
, CairoMatrix $matrix2
)
public void rotate
( string
$sx
, string $sy
)
public void scale
( float
$sx
, float $sy
)
public array transformDistance
( string
$dx
, string $dy
)
public array transformPoint
( string
$dx
, string $dy
)
public void translate
( string
}$tx
, string $ty
)The CairoOperator classIntroductionThis is used to set the compositing operator for all cairo drawing operations.
The default operator is 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/. Class synopsisCairoOperator
class CairoOperator
{
/* Constants */
const
integer
CairoOperator::CLEAR
= 0
;
const
integer
CairoOperator::SOURCE
= 1
;
const
integer
CairoOperator::OVER
= 2
;
const
integer
CairoOperator::IN
= 3
;
const
integer
CairoOperator::OUT
= 4
;
const
integer
CairoOperator::ATOP
= 5
;
const
integer
CairoOperator::DEST
= 6
;
const
integer
CairoOperator::DEST_OVER
= 7
;
const
integer
CairoOperator::DEST_IN
= 8
;
const
integer
CairoOperator::DEST_OUT
= 9
;
const
integer
CairoOperator::DEST_ATOP
= 10
;
const
integer
CairoOperator::XOR
= 11
;
const
integer
CairoOperator::ADD
= 12
;
const
integer
CairoOperator::SATURATE
= 13
;
}Predefined Constants
The CairoPath classIntroduction
Note: CairoPath class cannot be instantiated directly, doing so will result in Fatal Error if used or passed Class synopsisCairoPath
class CairoPath
{
}The CairoPsLevel classIntroduction
Class synopsisCairoPsLevel
class CairoPsLevel
{
/* Constants */
const
integer
CairoPsLevel::LEVEL_2
= 0
;
const
integer
CairoPsLevel::LEVEL_3
= 1
;
}Predefined Constants
The CairoSubpixelOrder classIntroduction
Class synopsisCairoSubpixelOrder
class CairoSubpixelOrder
{
/* Constants */
const
integer
CairoSubpixelOrder::ORDER_DEFAULT
= 0
;
const
integer
CairoSubpixelOrder::ORDER_RGB
= 1
;
const
integer
CairoSubpixelOrder::ORDER_BGR
= 2
;
const
integer
CairoSubpixelOrder::ORDER_VRGB
= 3
;
const
integer
CairoSubpixelOrder::ORDER_VBGR
= 4
;
}Predefined Constants
The CairoSvgVersion classIntroduction
Class synopsisCairoSvgVersion
class CairoSvgVersion
{
/* Constants */
const
integer
CairoSvgVersion::VERSION_1_1
= 0
;
const
integer
CairoSvgVersion::VERSION_1_2
= 1
;
}Predefined Constants
|