cairomm  1.16.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Cairo::Win32ScaledFont Class Reference

Scaled Font implementation for Microsoft Windows fonts. More...

#include <cairomm/win32_font.h>

Inheritance diagram for Cairo::Win32ScaledFont:
Inheritance graph
[legend]

Public Member Functions

void select_font (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. More...
 
void done_font ()
 Releases any resources allocated by select_font() More...
 
double get_metrics_factor () const
 Gets a scale factor between logical coordinates in the coordinate space used by select_font() (that is, the coordinate system used by the Windows functions to return metrics) and font space coordinates. More...
 
void get_logical_to_device (Matrix & logical_to_device) const
 Gets the transformation mapping the logical space used by this scaled font to device space. More...
 
void get_device_to_logical (Matrix & device_to_logical) const
 Gets the transformation mapping device space to the logical space used by this scaled font. More...
 
- Public Member Functions inherited from Cairo::ScaledFont
cobjectcobj ()
 Provides acces to the underlying C cairo object. More...
 
const cobjectcobj () const
 Provides acces to the underlying C cairo object. More...
 
 ScaledFont (cobject *cobj, bool has_reference=false)
 Create a C++ wrapper object from the C instance. More...
 
 ScaledFont (const ScaledFont &)=delete
 
ScaledFontoperator= (const ScaledFont &)=delete
 
virtual ~ScaledFont ()
 
void get_extents (FontExtents & extents) const
 Gets the metrics for a ScaledFont. More...
 
void get_text_extents (const std::string & utf8, TextExtents & extents) const
 Gets the extents for a string of text. More...
 
void get_glyph_extents (const std::vector< Glyph > & glyphs, TextExtents & extents)
 Gets the extents for an array of glyphs. More...
 
RefPtr< FontFaceget_font_face () const
 The FontFace with which this ScaledFont was created. More...
 
void get_font_options (FontOptions & options) const
 Gets the FontOptions with which the ScaledFont was created. More...
 
void get_font_matrix (Matrix & font_matrix) const
 Gets the font matrix with which the ScaledFont was created. More...
 
void get_ctm (Matrix & ctm) const
 Gets the CTM with which the ScaledFont was created. More...
 
FontType get_type () const
 Gets the type of scaled Font. More...
 
void text_to_glyphs (double x, double y, const std::string & utf8, std::vector< Glyph > & glyphs, std::vector< TextCluster > & clusters, TextClusterFlags & cluster_flags)
 
void get_scale_matrix (Matrix & scale_matrix) const
 Stores the scale matrix of this scaled font into matrix. More...
 

Static Public Member Functions

static RefPtr< Win32ScaledFontcreate (const RefPtr< Win32FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
 Creates a scaled font for the given Win32FontFace. More...
 
- Static Public Member Functions inherited from Cairo::ScaledFont
static RefPtr< ScaledFontcreate (const RefPtr< FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
 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. More...
 

Protected Member Functions

 Win32ScaledFont (const RefPtr< Win32FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
 
- Protected Member Functions inherited from Cairo::ScaledFont
 ScaledFont (const RefPtr< FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
 

Additional Inherited Members

- Public Types inherited from Cairo::ScaledFont
typedef cairo_scaled_font_t cobject
 The underlying C cairo object type. More...
 
- Protected Attributes inherited from Cairo::ScaledFont
cobjectm_cobject
 The underlying C cairo object that is wrapped by this ScaledFont. More...
 

Detailed Description

Scaled Font implementation for Microsoft Windows fonts.

Since
1.8

Constructor & Destructor Documentation

◆ Win32ScaledFont()

Cairo::Win32ScaledFont::Win32ScaledFont ( const RefPtr< Win32FontFace > &  font_face,
const Matrix font_matrix,
const Matrix ctm,
const FontOptions options = FontOptions() 
)
protected

Member Function Documentation

◆ create()

static RefPtr<Win32ScaledFont> Cairo::Win32ScaledFont::create ( const RefPtr< Win32FontFace > &  font_face,
const Matrix font_matrix,
const Matrix ctm,
const FontOptions options = FontOptions() 
)
static

Creates a scaled font for the given Win32FontFace.

Since
1.8

◆ done_font()

void Cairo::Win32ScaledFont::done_font ( )

Releases any resources allocated by select_font()

Since
1.8

◆ get_device_to_logical()

void Cairo::Win32ScaledFont::get_device_to_logical ( Matrix device_to_logical) const

Gets the transformation mapping device space to the logical space used by this scaled font.

Parameters
device_to_logicalmatrix to return
Since
1.8

◆ get_logical_to_device()

void Cairo::Win32ScaledFont::get_logical_to_device ( Matrix logical_to_device) const

Gets the transformation mapping the logical space used by this scaled font to device space.

Parameters
logical_to_devicematrix to return
Since
1.8

◆ get_metrics_factor()

double Cairo::Win32ScaledFont::get_metrics_factor ( ) const

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

Returns
factor to multiply logical units by to get font space coordinates.
Since
1.8

◆ select_font()

void Cairo::Win32ScaledFont::select_font ( 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 done_font() to release any resources allocated by this function.

See get_metrics_factor() for converting logical coordinates from the device context to font space.

Normally, calls to SaveDC() and RestoreDC() would be made around the use of this function to preserve the original graphics state.

Parameters
scaled_fontA cairo_scaled_font_t from the Win32 font backend. Such an object can be created with Win32FontFace::create_for_logfontw().
hdca device context
Since
1.8

The documentation for this class was generated from the following file: