FTSize Class Reference

#include <FTSize.h>

List of all members.

Public Member Functions

 FTSize ()
virtual ~FTSize ()
bool CharSize (FT_Face *face, unsigned int point_size, unsigned int x_resolution, unsigned int y_resolution)
unsigned int CharSize () const
float Ascender () const
float Descender () const
float Height () const
float Width () const
float Underline () const
FT_Error Error () const
 FTSize ()
virtual ~FTSize ()
bool CharSize (FT_Face *face, unsigned int point_size, unsigned int x_resolution, unsigned int y_resolution)
unsigned int CharSize () const
float Ascender () const
float Descender () const
float Height () const
float Width () const
float Underline () const
FT_Error Error () const

Private Attributes

FT_FaceftFace
FT_Size ftSize
unsigned int size
unsigned int xResolution
unsigned int yResolution
FT_Error err
FT_FaceftFace


Detailed Description

FTSize class provides an abstraction layer for the Freetype Size.

See also:
"Freetype 2 Documentation"

Definition at line 18 of file FTSize.h.


Constructor & Destructor Documentation

FTSize::FTSize (  ) 

Default Constructor

Definition at line 4 of file FTSize.cxx.

FTSize::~FTSize (  )  [virtual]

Destructor

Definition at line 14 of file FTSize.cxx.

FTSize::FTSize (  ) 

Default Constructor

virtual FTSize::~FTSize (  )  [virtual]

Destructor


Member Function Documentation

bool FTSize::CharSize ( FT_Face face,
unsigned int  point_size,
unsigned int  x_resolution,
unsigned int  y_resolution 
)

Sets the char size for the current face.

This doesn't guarantee that the size was set correctly. Clients should check errors.

Parameters:
face Parent face for this size object
point_size the face size in points (1/72 inch)
x_resolution the horizontal resolution of the target device.
y_resolution the vertical resolution of the target device.
Returns:
true if the size has been set. Clients should check Error() for more information if this function returns false()

Definition at line 18 of file FTSize.cxx.

References err, FT_Set_Char_Size(), ftFace, ftSize, RooFitShortHand::L(), size, xResolution, and yResolution.

Referenced by FTFont::FaceSize(), and FTFace::Size().

unsigned int FTSize::CharSize (  )  const

get the char size for the current face.

Returns:
The char size in points

Definition at line 42 of file FTSize.cxx.

References size.

float FTSize::Ascender (  )  const

Gets the global ascender height for the face in pixels.

Returns:
Ascender height

Definition at line 48 of file FTSize.cxx.

References FT_Size_Metrics_::ascender, ftSize, and FT_SizeRec_::metrics.

Referenced by FTFont::Ascender().

float FTSize::Descender (  )  const

Gets the global descender height for the face in pixels.

Returns:
Ascender height

Definition at line 54 of file FTSize.cxx.

References FT_Size_Metrics_::descender, ftSize, and FT_SizeRec_::metrics.

Referenced by FTFont::Descender().

float FTSize::Height (  )  const

Gets the global face height for the face.

If the face is scalable this returns the height of the global bounding box which ensures that any glyph will be less than or equal to this height. If the font isn't scalable there is no guarantee that glyphs will not be taller than this value.

Returns:
height in pixels.

Definition at line 60 of file FTSize.cxx.

References FT_IS_SCALABLE, ftFace, ftSize, FT_Size_Metrics_::height, FT_SizeRec_::metrics, and FT_Size_Metrics_::y_ppem.

Referenced by FTFont::LineHeight(), and FTGLTextureFont::MakeGlyph().

float FTSize::Width (  )  const

Gets the global face width for the face.

If the face is scalable this returns the width of the global bounding box which ensures that any glyph will be less than or equal to this width. If the font isn't scalable this value is the max_advance for the face.

Returns:
width in pixels.

Definition at line 72 of file FTSize.cxx.

References FT_IS_SCALABLE, ftFace, ftSize, FT_Size_Metrics_::max_advance, FT_SizeRec_::metrics, and FT_Size_Metrics_::x_ppem.

Referenced by FTGLTextureFont::MakeGlyph().

float FTSize::Underline (  )  const

Gets the underline position for the face.

Returns:
underline position in pixels

Definition at line 84 of file FTSize.cxx.

FT_Error FTSize::Error (  )  const [inline]

Queries for errors.

Returns:
The current error code.

Definition at line 102 of file FTSize.h.

Referenced by FTFace::Size().

bool FTSize::CharSize ( FT_Face face,
unsigned int  point_size,
unsigned int  x_resolution,
unsigned int  y_resolution 
)

Sets the char size for the current face.

This doesn't guarantee that the size was set correctly. Clients should check errors.

Parameters:
face Parent face for this size object
point_size the face size in points (1/72 inch)
x_resolution the horizontal resolution of the target device.
y_resolution the vertical resolution of the target device.
Returns:
true if the size has been set. Clients should check Error() for more information if this function returns false()

unsigned int FTSize::CharSize (  )  const

get the char size for the current face.

Returns:
The char size in points

float FTSize::Ascender (  )  const

Gets the global ascender height for the face in pixels.

Returns:
Ascender height

float FTSize::Descender (  )  const

Gets the global descender height for the face in pixels.

Returns:
Ascender height

float FTSize::Height (  )  const

Gets the global face height for the face.

If the face is scalable this returns the height of the global bounding box which ensures that any glyph will be less than or equal to this height. If the font isn't scalable there is no guarantee that glyphs will not be taller than this value.

Returns:
height in pixels.

float FTSize::Width (  )  const

Gets the global face width for the face.

If the face is scalable this returns the width of the global bounding box which ensures that any glyph will be less than or equal to this width. If the font isn't scalable this value is the max_advance for the face.

Returns:
width in pixels.

float FTSize::Underline (  )  const

Gets the underline position for the face.

Returns:
underline position in pixels

FT_Error FTSize::Error (  )  const [inline]

Queries for errors.

Returns:
The current error code.

Definition at line 102 of file FTSize.h.


Member Data Documentation

FT_Face* FTSize::ftFace [private]

The current Freetype face that this FTSize object relates to.

Definition at line 108 of file FTSize.h.

Referenced by CharSize(), Height(), and Width().

FT_Size FTSize::ftSize [private]

The Freetype size.

Definition at line 113 of file FTSize.h.

Referenced by Ascender(), CharSize(), Descender(), Height(), and Width().

unsigned int FTSize::size [private]

The size in points.

Definition at line 118 of file FTSize.h.

Referenced by CharSize().

unsigned int FTSize::xResolution [private]

The horizontal resolution.

Definition at line 123 of file FTSize.h.

Referenced by CharSize().

unsigned int FTSize::yResolution [private]

The vertical resolution.

Definition at line 128 of file FTSize.h.

Referenced by CharSize().

FT_Error FTSize::err [private]

Current error code. Zero means no error.

Definition at line 133 of file FTSize.h.

Referenced by CharSize().

FT_Face* FTSize::ftFace [private]

The current Freetype face that this FTSize object relates to.

Definition at line 108 of file FTSize.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:25:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1