Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

os::Font Class Reference

Text font class. More...

#include <font.h>

List of all members.

Public Types

typedef std::vector<float> size_list_t

Public Methods

 Font ()
 Font (const Font &font)
 Font (const font_properties &sProps)
 Font (const std::string &cConfigName)
void AddRef ()
void Release ()
status_t SetProperties (const font_properties &sProps)
status_t SetProperties (const std::string &cConfigName)
status_t SetFamilyAndStyle (const char *pzFamily, const char *pzStyle)
void SetSize (float vSize)
void SetShear (float vShear)
void SetRotation (float vRotation)
void SetSpacing (int nSpacing)
void SetEncoding (int nEncoding)
void SetFace (uint16 nFace)
void SetFlags (uint32 nFlags)
status_t SetProperties (float vSize, float vShear=0.0f, float vRotation=0.0f)
void GetFamilyAndStyle (const char *pzFamily, const char *pzStyle) const
float GetSize () const
float GetShear () const
float GetRotation () const
int GetSpacing () const
int GetEncoding () const
int GetFace () const
uint32 GetFlags () const
font_direction GetDirection () const
void GetTruncatedStrings (const char *stringArray[], int32 numStrings, uint32 mode, float width, char *resultArray[]) const
float GetStringWidth (const char *pzString) const
float GetStringWidth (const char *pzString, int nLength) const
float GetStringWidth (const std::string &pzString) const
void GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const
int GetStringLength (const char *pzString, float vWidth, bool bIncludeLast=false) const
int GetStringLength (const char *pzString, int nLength, float vWidth, bool bIncludeLast=false) const
int GetStringLength (const std::string &cString, float vWidth, bool bIncludeLast=false) const
void GetStringLengths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float vWidth, int anMaxLengthArray[], bool bIncludeLast=false) const
void GetHeight (font_height *psHeight) const
int GetFontID (void) const

Static Public Methods

status_t GetConfigNames (std::vector< string > *pcTable)
 Get a list of default font names. More...

status_t GetDefaultFont (const std::string &cName, font_properties *psProps)
 Get the properties of a default font. More...

status_t SetDefaultFont (const std::string &cName, const font_properties &sProps)
 Set the properties of a default font. More...

status_t AddDefaultFont (const std::string &cName, const font_properties &sProps)
 Add a default font, or modify one if it already exists. More...

int GetFamilyCount ()
 Get number of installed font families. More...

status_t GetFamilyInfo (int nIndex, char *pzFamily)
 Get the name of a given font family. More...

int GetStyleCount (const char *pzFamily)
 Get number of styles in a given family. More...

status_t GetStyleInfo (const char *pzFamily, int nIndex, char *pzStyle, uint32 *pnFlags=NULL)
 Get info about a given font style. More...

status_t GetBitmapSizes (const std::string &cFamily, const std::string &cStyle, size_list_t *pcList)
bool Rescan ()

Friends

class  View


Detailed Description

Text font class.

Description:
The os::View class need a text font to be able to render text. The font represent all the properties of the text like with and height of each glyph, rotation/shearing of the glyps and most importantly the actual graphical "image" of each glyph.

Font objects are reference counted to ease sharing between views. If the same font is set on two views they will both be affected by subsequent changes to the font.

A font keeps track of all view's it has been added to so it can notify them whenever one of the properties of the font changes.

AtheOS primarily use scalable truetype fonts but can also use various bitmap fonts. When using truetype font's the glyphs will be scaled to the requested point-size but When using bitmap fonts the size will be "snapped" to the closest size supported by the font.

When rendering truetype fonts the glyphs will be antialiazed to improve the quality of the fonts. The view can eighter antialiaze against a fixed background color to maximize speed or against the background it is actually rendered at.

See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)


Member Typedef Documentation

typedef std::vector< float > os::Font::size_list_t
 


Constructor & Destructor Documentation

Font::Font ( )
 

Font::Font ( const Font & cOrig )
 

Font::Font ( const font_properties & sProps )
 

Font::Font ( const std::string & cConfigName )
 


Member Function Documentation

status_t Font::AddDefaultFont ( const std::string & cName,
const font_properties & sProps ) [static]
 

Add a default font, or modify one if it already exists.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

void Font::AddRef ( void )
 

status_t Font::GetBitmapSizes ( const std::string & cFamily,
const std::string & cStyle,
size_list_t * pcList ) [static]
 

status_t Font::GetConfigNames ( std::vector< string > * pcTable ) [static]
 

Get a list of default font names.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

status_t Font::GetDefaultFont ( const std::string & cName,
font_properties * psProps ) [static]
 

Get the properties of a default font.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

font_direction os::Font::GetDirection ( ) const
 

int os::Font::GetEncoding ( ) const
 

int os::Font::GetFace ( ) const
 

void os::Font::GetFamilyAndStyle ( const char * pzFamily,
const char * pzStyle ) const
 

int Font::GetFamilyCount ( ) [static]
 

Get number of installed font families.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

status_t Font::GetFamilyInfo ( int nIndex,
char * pzFamily ) [static]
 

Get the name of a given font family.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

uint32 os::Font::GetFlags ( ) const
 

int os::Font::GetFontID ( void ) const [inline]
 

void os::Font::GetHeight ( font_height * psHeight ) const [inline]
 

float os::Font::GetRotation ( ) const
 

float os::Font::GetShear ( ) const
 

float os::Font::GetSize ( ) const
 

int os::Font::GetSpacing ( ) const
 

int Font::GetStringLength ( const std::string & cString,
float vWidth,
bool bIncludeLast = false ) const
 

int Font::GetStringLength ( const char * pzString,
int nLength,
float vWidth,
bool bIncludeLast = false ) const
 

int Font::GetStringLength ( const char * pzString,
float vWidth,
bool bIncludeLast = false ) const
 

void os::Font::GetStringLengths ( const char ** apzStringArray,
const int * anLengthArray,
int nStringCount,
float vWidth,
int anMaxLengthArray[],
bool bIncludeLast = false ) const
 

float Font::GetStringWidth ( const std::string & cString ) const
 

float Font::GetStringWidth ( const char * pzString,
int nLength ) const
 

float Font::GetStringWidth ( const char * pzString ) const
 

void Font::GetStringWidths ( const char ** apzStringArray,
const int * anLengthArray,
int nStringCount,
float * avWidthArray ) const
 

int Font::GetStyleCount ( const char * pzFamily ) [static]
 

Get number of styles in a given family.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

status_t Font::GetStyleInfo ( const char * pzFamily,
int nIndex,
char * pzStyle,
uint32 * pnFlags = NULL ) [static]
 

Get info about a given font style.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

void os::Font::GetTruncatedStrings ( const char * stringArray[],
int32 numStrings,
uint32 mode,
float width,
char * resultArray[] ) const
 

void Font::Release ( void )
 

bool Font::Rescan ( ) [static]
 

status_t Font::SetDefaultFont ( const std::string & cName,
const font_properties & sProps ) [static]
 

Set the properties of a default font.

Description:
Note:
Warning:
Parameters:
return  
See also:
Author(s):
Kurt Skauen (kurt@atheos.cx)

void os::Font::SetEncoding ( int nEncoding )
 

void os::Font::SetFace ( uint16 nFace )
 

status_t Font::SetFamilyAndStyle ( const char * pzFamily,
const char * pzStyle )
 

void os::Font::SetFlags ( uint32 nFlags )
 

status_t Font::SetProperties ( float vSize,
float vShear = 0.0f,
float vRotation = 0.0f )
 

status_t Font::SetProperties ( const std::string & cConfigName )
 

status_t Font::SetProperties ( const font_properties & sProps )
 

void Font::SetRotation ( float vRotation )
 

void Font::SetShear ( float vShear )
 

void Font::SetSize ( float vSize )
 

void os::Font::SetSpacing ( int nSpacing )
 


Friends And Related Function Documentation

class View [friend]
 


The documentation for this class was generated from the following files:
Generated at Sat Apr 7 16:11:34 2001 for AtheOS higlevel API by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001