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
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
bool operator== (const Font &cOther)
bool operator!= (const Font &cOther)
Font & operator= (const Font &cOther)

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

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:
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]
 

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

void Font::AddRef
 

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]
 

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

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

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

font_direction Font::GetDirection const
 

int Font::GetEncoding const
 

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

int Font::GetFamilyCount [static]
 

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

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

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

uint32 Font::GetFlags const
 

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

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

float Font::GetRotation const
 

float Font::GetShear const
 

float Font::GetSize const
 

int 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]
 

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

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

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

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

void Font::Release
 

bool Font::Rescan [static]
 

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

Description:
Note:
Warning:
Parameters:
return  
See also:
Author:
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
 

bool Font::operator!= const Font & cOther
 

Font & Font::operator= const Font & cOther
 

bool Font::operator== const Font & cOther
 


Friends And Related Function Documentation

friend class View [friend]
 


Generated at Tue Sep 11 15:27:47 2001 for AtheOS higlevel API by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001