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

A simple font face used for the cairo 'toy' font API. More...

#include <cairomm/fontface.h>

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

Public Types

enum class  Slant {
  NORMAL = CAIRO_FONT_SLANT_NORMAL ,
  ITALIC = CAIRO_FONT_SLANT_ITALIC ,
  OBLIQUE = CAIRO_FONT_SLANT_OBLIQUE
}
 Specifies variants of a font face based on their slant. More...
 
enum class  Weight {
  NORMAL = CAIRO_FONT_WEIGHT_NORMAL ,
  BOLD = CAIRO_FONT_WEIGHT_BOLD
}
 Specifies variants of a font face based on their weight. More...
 
- Public Types inherited from Cairo::FontFace
typedef cairo_font_face_t cobject
 

Public Member Functions

std::string get_family () const
 Gets the familly name of a toy font. More...
 
Slant get_slant () const
 Gets the slant a toy font. More...
 
Weight get_weight () const
 Gets the weight a toy font. More...
 
- Public Member Functions inherited from Cairo::FontFace
 FontFace (cairo_font_face_t *cobject, bool has_reference=false)
 Create a C++ wrapper for the C instance. More...
 
 FontFace (const FontFace &)=delete
 
FontFaceoperator= (const FontFace &)=delete
 
virtual ~FontFace ()
 
FontType get_type () const
 Returns the type of the backend used to create a font face. More...
 
cobjectcobj ()
 
const cobjectcobj () const
 
void reference () const
 
void unreference () const
 

Static Public Member Functions

static RefPtr< ToyFontFacecreate (const std::string & family, Slant slant, Weight weight)
 Creates a font face from a triplet of family, slant, and weight. More...
 

Protected Member Functions

 ToyFontFace (const std::string & family, Slant slant, Weight weight)
 

Additional Inherited Members

- Protected Attributes inherited from Cairo::FontFace
cobjectm_cobject
 

Detailed Description

A simple font face used for the cairo 'toy' font API.

Since
1.8

Member Enumeration Documentation

◆ Slant

Specifies variants of a font face based on their slant.

Enumerator
NORMAL 

Upright font style.

ITALIC 

Italic font style.

OBLIQUE 

Oblique font style.

◆ Weight

Specifies variants of a font face based on their weight.

Enumerator
NORMAL 

Normal font weight.

BOLD 

Bold font weight.

Constructor & Destructor Documentation

◆ ToyFontFace()

Cairo::ToyFontFace::ToyFontFace ( const std::string family,
Slant  slant,
Weight  weight 
)
protected

Member Function Documentation

◆ create()

static RefPtr<ToyFontFace> Cairo::ToyFontFace::create ( const std::string family,
Slant  slant,
Weight  weight 
)
static

Creates a font face from a triplet of family, slant, and weight.

These font faces are used in implementation of the the Context "toy" font API.

If family is the zero-length string "", the platform-specific default family is assumed. The default family then can be queried using get_family().

The Context::select_font_face() function uses this to create font faces. See that function for limitations of toy font faces.

Parameters
familya font family name, encoded in UTF-8.
slantthe slant for the font.
weightthe weight for the font.
Examples
toy-text.cc, and user-font.cc.

◆ get_family()

std::string Cairo::ToyFontFace::get_family ( ) const

Gets the familly name of a toy font.

◆ get_slant()

Slant Cairo::ToyFontFace::get_slant ( ) const

Gets the slant a toy font.

◆ get_weight()

Weight Cairo::ToyFontFace::get_weight ( ) const

Gets the weight a toy font.


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