Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UFont Class Reference

Active Font Property. More...

#include <ufont.hpp>

Inheritance diagram for UFont:

UProp UBrick List of all members.

Public Types

enum  FontStyle {
  BOLD = 1<<0, ITALIC = 1<<1, FILL = 1<<2, UNDERLINE = 1<<3,
  OVERLINE = 1<<4, STRIKETHROUGH = 1<<5
}

Public Member Functions

 UFont (const class UFontFamily &family, int style=0, int lsize=0, u_modes=0)
 creates a new Font with custom characteristics

 UFont (const UFont &=UFont::standard)
 creates a new Font that is a copy of another Font.

UFontoperator= (const UFont &)
 copies font characteristics (same as set() but not virtual).

virtual void set (const UFont &)
 copies font characteristics (same as operator = but virtual).

virtual void merge (const UFont &)
 merge font characteristics

virtual bool equals (const UFont &) const
 returns true if font characteristics are the same

bool isBold () const
bool isItalic () const
 is this font in the Bold or Italic style ?.

bool isFilled () const
bool isUnderlined () const
bool isOverlined () const
bool isStrikethrough () const
void setFamily (const UFont &)
void setFamily (const class UFontFamily &)
 changes the Font Family of this font object (see: UFontFamily).

const class UFontFamilygetFamily () const
 returns the Font Family of this font object (see: UFontFamily).

void setStyle (const UFont &)
void setStyle (signed int font_styles, bool update)
 changes the Font Style of this font object

void setSize (const UFont &f)
 copies font size from another font object.

int getLsize () const
 returns LOGICAL font size (in range: UFont::MIN_LSIZE to UFont::MAX_LSIZE).

void setLsize (int logical_size, bool update=true)
 changes LOGICAL font size (in range: UFont::MIN_LSIZE to UFont::MAX_LSIZE).

int getPointSize () const
int getPtsize () const
 returns POINT size.

void setPointSize (int point_size, bool update=true)
void setPtsize (int point_size, bool update=true)
 changes POINT size.

virtual void update ()
 update parents' graphics.

bool realize (class UDisp *)
 [impl] allocates physical resources


Static Public Attributes

const int MIN_LSIZE = 1
const int MEDIUM_LSIZE = 8
const int MAX_LSIZE = 23
 minimum, medium and maximum LOGICAL size (not a point size!).

const int FONTMAP_SIZE = 4 * (UFont::MAX_LSIZE + 1)
 internals.

UFont normal
UFont bold
UFont italic
UFont fill
UFont underline
UFont overline
UFont strikethrough
UFont _bold
UFont _italic
UFont _fill
UFont _underline
UFont _overline
UFont _strikethrough
 Font Style Modifiers.

UFont xx_small
UFont x_small
UFont small
UFont medium
UFont large
UFont x_large
UFont xx_large
 Font Size Modifiers.

UFont standard
UFont inherit
UFont helvetica
UFont courier
UFont times
UFont fixed
 Font Family Modifiers.


Friends

UFontufont (const UFont &_f)
 creator shortcut that is equivalent to: *new UFont().


Detailed Description

Active Font Property.


Constructor & Destructor Documentation

UFont::UFont const class UFontFamily family,
int  style = 0,
int  lsize = 0,
u_modes  = 0
 

creates a new Font with custom characteristics

arguments:

  • 'family': the UFontFamily of this new font
  • 'style' : the font style: an ORed combination of UFont::FontStyle constants (ex: BOLD|ITALIC or -BOLD|-ITALIC). negative values deactivate these styles
  • 'lsize' : the LOGICAL size (not the point size!), which must be in range [UFont::MIN_LSIZE, UFont::MAX_LSIZE] or 0 (in which case the size is inherited from parents


Member Function Documentation

void UFont::merge const UFont  )  [virtual]
 

merge font characteristics

sets NON default values and combines styles

bool UFont::realize class UDisp  ) 
 

[impl] allocates physical resources

this function is automatically called when this font is used for the first time. There no need to call it in client code except for loading fonts in advance.

  • note: the argument can be the UAppli (the Application Context)

void UFont::setStyle signed int  font_styles,
bool  update
 

changes the Font Style of this font object

'font_styles' is an integer bitmask (values are ORed from enum FontStyle) 'font_styles' can be negative, which means 'disable these styles' (as in: UFont::_italic, etc)


Member Data Documentation

UFont UFont::_strikethrough [static]
 

Font Style Modifiers.

  • 'normal' means not bold, not italic, not underlined
  • prefix '_' means NOT (for example: '_bold' means 'not bold')
  • Font Mofifiers can be combined (when applicable) Example:
      ubox( UFont::bold + UFont::italic + "abcd" )  

UFont UFont::fixed [static]
 

Font Family Modifiers.

  • 'standard' is the default Font Family (with 'medium' size)
  • 'inherit' means that the font is inherited from parents

UFont UFont::xx_large [static]
 

Font Size Modifiers.

'medium' is equivalent to: logical lsize = MEDIUM_LSIZE


The documentation for this class was generated from the following files:
Generated on Fri Aug 13 12:12:14 2004 for Ubit[Eric.Lecolinet@enst.fr] by doxygen 1.3.7