Back to index

nux  3.0.0
Public Types | Public Member Functions | Private Attributes
nux::CairoFont Class Reference

#include <TextEntry.h>

List of all members.

Public Types

 Enum used to specify font weight. More...

Public Member Functions

 CairoFont (const std::string &family, double size, Style style, Weight weight)
 Constructor for CairoFont.
virtual ~CairoFont ()
virtual Style GetStyle () const
virtual Weight GetWeight () const
virtual double GetPointSize () const
virtual void Destroy ()
const PangoFontDescription * GetFontDescription () const

Private Attributes

PangoFontDescription * font_
double size_
Style style_
Weight weight_

Detailed Description

Definition at line 34 of file TextEntry.h.

Member Enumeration Documentation


Definition at line 37 of file TextEntry.h.

Enum used to specify font weight.


Definition at line 45 of file TextEntry.h.

Constructor & Destructor Documentation

nux::CairoFont::CairoFont ( const std::string &  family,
double  size,
Style  style,
Weight  weight 

Constructor for CairoFont.

Takes a PangoFontDescription object and its ownership. Will free the PangoFontDescription object on destruction.

Definition at line 83 of file TextEntry.cpp.

    : font_(pango_font_description_new())
    , size_(pt_size * PANGO_SCALE * 96 / 72)
    , style_(style)
    , weight_(weight)
    pango_font_description_set_family(font_, family.c_str());
    pango_font_description_set_absolute_size(font_, size_);

    if (weight_ == CairoFont::WEIGHT_BOLD)
      pango_font_description_set_weight(font_, PANGO_WEIGHT_BOLD);

    if (style_ == CairoFont::STYLE_ITALIC)
      pango_font_description_set_style(font_, PANGO_STYLE_ITALIC);

Definition at line 107 of file TextEntry.cpp.


Member Function Documentation

virtual void nux::CairoFont::Destroy ( ) [inline, virtual]

Definition at line 66 of file TextEntry.h.

{delete this;}

Here is the caller graph for this function:

const PangoFontDescription* nux::CairoFont::GetFontDescription ( ) const [inline]

Definition at line 68 of file TextEntry.h.

{return font_;}

Here is the caller graph for this function:

virtual double nux::CairoFont::GetPointSize ( ) const [inline, virtual]

Definition at line 64 of file TextEntry.h.

{return size_;}
virtual Style nux::CairoFont::GetStyle ( ) const [inline, virtual]

Definition at line 62 of file TextEntry.h.

{return style_;}
virtual Weight nux::CairoFont::GetWeight ( ) const [inline, virtual]

Definition at line 63 of file TextEntry.h.

{return weight_;}

Member Data Documentation

PangoFontDescription* nux::CairoFont::font_ [private]

Definition at line 71 of file TextEntry.h.

double nux::CairoFont::size_ [private]

Definition at line 72 of file TextEntry.h.

Definition at line 73 of file TextEntry.h.

Definition at line 74 of file TextEntry.h.

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