Class ScaledFont
Font face at particular size
and options
ScaledFont
represents a realization of a font face at a particular
size
and transformation and a certain set of font options.
Inherits from
-
Object
(base class)
Constructors
Name | Description |
---|---|
this
|
Create a ScaledFont from a existing cairo_scaled_font_t*.
ScaledFont is a garbage collected class. It will call cairo_scaled_font_destroy
when it gets collected by the GC or when dispose() is called.
|
this
|
Creates a ScaledFont object from a font face and
matrices that describe the size of the font and the
environment in which it will be used.
|
Methods
Name | Description |
---|---|
createFromNative
|
The createFromNative method for the ScaledFont classes.
See https://github.com/jpf91/cairoD/wiki/Memory-Management#createFromNative
for more information.
|
extents
|
Gets the metrics for a ScaledFont .
|
getCTM
|
Returns the CTM with which ScaledFont was created.
Note that the translation offsets (x0, y0) of the CTM are
ignored by new ScaledFont (). So, the matrix this function
returns always has 0,0 as x0,y0.
|
getFontFace
|
Gets the font face that this scaled font uses. This is the
font face passed to new ScaledFont ().
|
getFontMatrix
|
Returns the font matrix with which ScaledFont
was created.
|
getFontOptions
|
Returns the font options with which ScaledFont
was created.
|
getScaleMatrix
|
Returns the scale matrix of ScaledFont .
The scale matrix is product of the font matrix and the
ctm associated with the scaled font, and hence is the
matrix mapping from font space to device space.
|
getType
|
This function returns the C type of a ScaledFont . See FontType
for available types.
|
glyphExtents
|
Gets the extents for an array of glyphs . The extents describe
a user-space rectangle that encloses the "inked" portion
of the glyphs , (as they would be drawn by Context.showGlyphs ()
if the cairo graphics state were set to the same fontFace ,
fontMatrix , ctm, and fontOptions as scaled_font). Additionally,
the x_advance and y_advance values indicate the amount by
which the current point would be advanced by Context.showGlyphs ().
|
textExtents
|
Gets the extents for a string of text . The extents describe a
user-space rectangle that encloses the "inked" portion of the
text drawn at the origin (0,0) (as it would be drawn by
Context.showText () if the cairo graphics state were set
to the same fontFace , fontMatrix , ctm, and fontOptions
as ScaledFont ). Additionally, the x_advance and y_advance
values indicate the amount by which the current point would
be advanced by Context.showText ().
|
textToGlyphs
|
Converts UTF-8 text to an array of glyphs, optionally with
cluster mapping, that can be used to render later using ScaledFont .
|
textToTextGlyph
|
Converts UTF-8 text to an array of glyphs, optionally with
cluster mapping, that can be used to render later using ScaledFont .
|
checkError
|
Method for use in subclasses. Calls cairo_scaled_font_status(nativePointer) and throws an exception if the status isn't CAIRO_STATUS_SUCCESS |
Aliases
Name | Description |
---|---|
CTM
|
convenience alias |
fontFace
|
convenience alias |
fontMatrix
|
convenience alias |
fontOptions
|
convenience alias |
scaleMatrix
|
convenience alias |
type
|
convenience alias |
Templates
Name | Description |
---|---|
CairoCountedClass!(cairo_scaled_font_t*, "cairo_scaled_font_")
|
Authors
Johannes Pfau | cairoD |
Andrej Mitrovic | cairoD |
cairo team | cairo |
Copyright
License
cairoD wrapper/bindings | Boost License 1.0 |
cairo | LGPL 2.1 / MPL 1.1 |