The OpenD Programming Language

Win32ScaledFont

The Microsoft Windows font backend is primarily used to render text on Microsoft Windows systems.

Constructors

this
this(cairo_scaled_font_t* ptr)

Create a Win32ScaledFont from a existing cairo_surface_t*. Win32ScaledFont 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
this(Win32FontFace font_face, Matrix font_matrix, Matrix ctm, FontOptions options)

Members

Functions

doneFont
void doneFont()

Releases any resources allocated by Win32ScaledFont.selectFont()

getDeviceToLogical
Matrix getDeviceToLogical()

Gets the transformation mapping device space to the logical space used by ScaledFont.

getLogicalToDevice
Matrix getLogicalToDevice()

Gets the transformation mapping the logical space used by ScaledFont to device space.

getMetricsFactor
double getMetricsFactor()

Gets a scale factor between logical coordinates in the coordinate space used by Win32ScaledFont.selectFont() (that is, the coordinate system used by the Windows functions to return metrics) and font space coordinates.

selectFont
void selectFont(HDC hdc)

Selects the font into the given device context and changes the map mode and world transformation of the device context to match that of the font. This function is intended for use when using layout APIs such as Uniscribe to do text layout with the cairo font. After finishing using the device context, you must call Win32ScaledFont.doneFont() to release any resources allocated by this function.

Inherited Members

From ScaledFont

__anonymous
mixin CairoCountedClass!(cairo_scaled_font_t*, "cairo_scaled_font_")
checkError
void checkError()

Method for use in subclasses. Calls cairo_scaled_font_status(nativePointer) and throws an exception if the status isn't CAIRO_STATUS_SUCCESS

createFromNative
ScaledFont createFromNative(cairo_scaled_font_t* ptr, bool adjRefCount)

The createFromNative method for the ScaledFont classes. See https://github.com/jpf91/cairoD/wiki/Memory-Management#createFromNative for more information.

extents
FontExtents extents()

Gets the metrics for a ScaledFont.

textExtents
TextExtents textExtents(string text)

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().

glyphExtents
TextExtents glyphExtents(Glyph[] glyphs)

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().

textToGlyphs
Glyph[] textToGlyphs(double x, double y, string text, Glyph[] glyphBuffer)
Glyph[] textToGlyphs(Point!double p1, string text, Glyph[] glyphBuffer)
textToTextGlyph
TextGlyph textToTextGlyph(double x, double y, string text, Glyph[] glyphBuffer, TextCluster[] clusterBuffer)
TextGlyph textToTextGlyph(Point!double p1, string text, Glyph[] glyphBuffer, TextCluster[] clusterBuffer)

Converts UTF-8 text to an array of glyphs, optionally with cluster mapping, that can be used to render later using ScaledFont.

getFontFace
FontFace getFontFace()

Gets the font face that this scaled font uses. This is the font face passed to new ScaledFont().

fontFace
alias fontFace = getFontFace

convenience alias

getFontOptions
FontOptions getFontOptions()

Returns the font options with which ScaledFont was created.

fontOptions
alias fontOptions = getFontOptions

convenience alias

getFontMatrix
Matrix getFontMatrix()

Returns the font matrix with which ScaledFont was created.

fontMatrix
alias fontMatrix = getFontMatrix

convenience alias

getCTM
Matrix 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.

CTM
alias CTM = getCTM

convenience alias

getScaleMatrix
Matrix 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.

scaleMatrix
alias scaleMatrix = getScaleMatrix

convenience alias

getType
FontType getType()

This function returns the C type of a ScaledFont. See FontType for available types.

type
alias type = getType

convenience alias

Meta